top of page

Any and All Statement Text Test

This program tests the any and all statements with text values.
The test values are all text.

Program


---

all Statement Test Program no 1

This is an example program showing how to use all statements.

---

prog_vars =

d/pin1 0

d/pin2 1

d/float1 12.5

d/float2 3.141

d/int1 10

d/int2 0

d/pin_no 0


d/text1 "Jack"

d/text2 "Jill"

prog_vars.


prog_start =

print " -------------- "

print "all statement test program"


prog_start.


prog_loop =


-- Test 1 Should be TRUE ie "a" = "a"

all "a" = "a" ->

print "Test 1 TRUE CORRECT"

else

print "Test 1 FALSE WRONG"

exitprog

enda.



-- Test 2 Should be FALSE ie "a" != "b"

all "a" = "b" ->

print "Test 2 TRUE WRONG"

else

print "Test 2 FALSE CORRECT"

exitprog

enda.



-- Test 3 Should be TRUE ie /text1 is != /text2

all /text1 != /text2 ->

print "Test 3 TRUE CORRECT"

else

print "Test 3 FALSE WRONG"

exitprog

enda.



-- Test 4 Should be TRUE ie /text1 is "JacK"

all /text1 = "Jack" ->

print "Test 4 TRUE CORRECT"

else

print "Test 4 FALSE WRONG"

exitprog

enda.


-- Test Should be TRUE ie "Jack" is = "JacK"

all "Jack" = "Jack" ->

print "Test 5 TRUE CORRECT"

else

print "Test 5 FALSE WRONG"

exitprog

enda.


prog_loop.


prog_stop =

print "Bye"

prog_stop.



bottom of page