Initial data commit
This commit is contained in:
parent
72d218235f
commit
f23f22d71c
199087 changed files with 3378941 additions and 0 deletions
20
Task/Named-parameters/Icon/named-parameters.icon
Normal file
20
Task/Named-parameters/Icon/named-parameters.icon
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
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("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
|
||||
Loading…
Add table
Add a link
Reference in a new issue