File: short_if.yab

package info (click to toggle)
yabasic 1%3A2.90.3-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 4,104 kB
  • sloc: ansic: 12,214; sh: 4,417; makefile: 21
file content (40 lines) | stat: -rwxr-xr-x 428 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40

if (1<2) print "hi"
if (1<2) :

x=0
if (1<2) x=1
if (x=0) then
  print "Test 1 failed"
  exit 1
endif

x=0
if (1=2) x=1:x=1:x=1
if (x<>0) then
  print "Test 2 failed"
  exit 1
endif

x=0
if (1=2) x=1:x=1:x=1
x=2
if (x<>2) then
  print "Test 3 failed"
  exit 1
endif

x=0
if (1<2) x=1:y=1:z=1
if (x<>1) then
  print "Test 4 failed"
  exit 1
endif

x=0
if (1=1) x=1:x=2:x=3
if (x<>3) then
  print "Test 5 failed"
  exit 1
endif