Code: Select all
Procedure Test(val1,val2,val3,val4,val5,val6,val7,val8)
If val1=0 And val2=0 And val3=0 And val8=0 ;if val 4,5,6,7
Debug "code1 stuff here"
color=200
ElseIf val2=0 And val5=0 And val6=0 And val8=0 ;if val 1,3,4,7
Debug "code2 stuff here"
color=100
ElseIf val1=0 And val3=0 And val5=0 And val7=0 ;if val 2,4,6,8
Debug "code3 stuff here"
color=255
Else ;if none of the conditions above was met
Debug "oops"
EndIf
;B code stuff here
Debug "Weeee, zoom zoom"
Debug color
EndProcedure
; Let's test it :)
Test(2,0,5,1,0,0,9,0)

Code: Select all
Procedure Test2(method,val1,val2,val3,val4,val5,val6,val7,val8)
If method=1
Debug "code1 stuff here"
color=200
ElseIf method=2
Debug "code2 stuff here"
color=100
ElseIf method=3
Debug "code3 stuff here"
color=255
Else ;if none of the conditions above was met
Debug "oops"
EndIf
;B code stuff here
Debug "Weeee, zoom zoom"
Debug color
EndProcedure
Test2(3,0,0,0,0,0,0,0,0) ;I just used 0, to lazy to come up with nice numbers :P
;In this 2nd example, just keep the argument names as they are, val1 etc.
;however their contents/value will obviously be different,
;and each if block will treat i.e val1 differently.
;as long as you use the correct method when you call the procedure this shouldn't be a issue.
