20 lines
651 B
Text
20 lines
651 B
Text
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?
|
|
stop(&output,"No parameter ",a)) & # . . no
|
|
((variable(a[1:-2]) := get(A)) | # assign
|
|
runerr(205,a))) # . . problem
|
|
|
|
write(" x:=",x)
|
|
write(" y:=",y)
|
|
write(" z:=",z)
|
|
end
|