adding condition to if statement
new syntax is if_true( . .. . ) where any string is allowed in case of true
This commit is contained in:
@ -1,6 +1,6 @@
|
||||
class Ifi
|
||||
int ofthen(int n)
|
||||
if(0)
|
||||
if_zero(0)
|
||||
isit = 42
|
||||
else
|
||||
maybenot = 667
|
||||
|
@ -1,5 +1,5 @@
|
||||
int ofthen(int n)
|
||||
if(0)
|
||||
if_plus(0)
|
||||
isit = 42
|
||||
else
|
||||
maybenot = 667
|
||||
|
@ -1,5 +1,5 @@
|
||||
int retvar(int n)
|
||||
if( n > 5)
|
||||
if_positive( n - 5)
|
||||
return 10
|
||||
else
|
||||
return 20
|
||||
|
@ -1,4 +1,4 @@
|
||||
if(0)
|
||||
if_true(0)
|
||||
fourty = 10
|
||||
else
|
||||
twenty = 5
|
||||
|
@ -1,4 +1,4 @@
|
||||
if(3 > var)
|
||||
if_yes(3 > var)
|
||||
Object.initialize(3)
|
||||
else
|
||||
var.new(33)
|
||||
|
@ -1,4 +1,4 @@
|
||||
if(0)
|
||||
if_zero(0)
|
||||
four = 42
|
||||
end
|
||||
-- -- --
|
||||
|
@ -1,4 +1,4 @@
|
||||
if(3 > var)
|
||||
if_overflow(3 + 100000 )
|
||||
Object.initialize(3)
|
||||
end
|
||||
-- -- --
|
||||
|
Reference in New Issue
Block a user