2023-07-01 11:58:00 -04:00
|
|
|
procedure main()
|
|
|
|
|
testproc("x:=",1,"y:=",2,"z:=",3)
|
|
|
|
|
testproc("x:=",3,"y:=",1,"z:=",2)
|
|
|
|
|
testproc("z:=",4,"x:=",2,"y:=",3)
|
|
|
|
|
testproc("i:=",1,"y:=",2,"z:=",3)
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
procedure testproc(A[]) #: demo to test named parameters
|
|
|
|
|
write("Calling testproc")
|
|
|
|
|
|
|
|
|
|
while a := get(A) do # implement named parameters here
|
|
|
|
|
(( a ? (v := =!["x","y","z"], =":=") | # valid parameter name?
|
2025-08-11 18:05:26 -07:00
|
|
|
stop(&output,"No parameter ",a)) & # . . no
|
2023-07-01 11:58:00 -04:00
|
|
|
((variable(a[1:-2]) := get(A)) | # assign
|
|
|
|
|
runerr(205,a))) # . . problem
|
|
|
|
|
|
|
|
|
|
write(" x:=",x)
|
|
|
|
|
write(" y:=",y)
|
|
|
|
|
write(" z:=",z)
|
|
|
|
|
end
|