I have a subroutine that does "wonderful" things. It's argument is a list of variables. Example:
Code: Select all
subroutine test(string %varlist)
for %var {%varlist}
do stuff in loop
next
endsub
call test("var1 var2 var3")
Now a problem. Say I want to loop through the list "var1A var2A var3A var1B var2B var3B". Without the subroutine I could do it (a bit clumpsy, but ...) the following way:
Code: Select all
for %ext A B
for %list var1{%ext} var2{%ext} var3{%ext}
do stuff
next
next
Code: Select all
call test("var1A var2A var3A var1B var2B var3B")
My problem: How can I send something like "var1{%ext} var2{%ext} var3{%ext}" to the subroutine? I would love to do the following:
Code: Select all
for %ext A B
call test("var1{%ext} var2{%ext} var3{%ext}")
next
Code: Select all
for %ext A B
%var = "l_q_id"+%hor "l_rsprd_id"+%hor "
call test(%var)
next
Appreicate help.
Dagfinn
