subroutine calls in a loop
Posted: Thu Mar 24, 2011 8:36 am
Hello,
I am having trouble running a programme loop in the following circumstances:
1. the programme "abcd.prg" is implemented via the command line as follows: abcd(..., a1=0.5,a2=0.5,a3=0.1, ...) ...
2. the programme "abcd.prg" calls the subroutine "efgh" as follows: call efgh(... %a1, %a2 , %a3, ... )
[reading %a1, %a2 , %a3 as strings]
3. the subroutine "efgh" then calls another subroutine called "ijkl" as follows: call ijkl(... {%a1}, {%a2}, {%a3}, ...)
[reading {%a1}, {%a2}, {%a3} as scalars]
This works fine if all three of a1, a2 and a3 are explicitly written as numbers (eg, 0.5, 0.4, 0.1) in the initial implementation of *abcd"
But it breaks down if one of the three is a scalar (used in a loop) defined as, eg, "scalar w1=0.5" and that scalar is used to implement "abcd.prg" as in
abcd(...,a1=w1,a2=0.5,a3=0.1, ...) ...
I am sure there is a simple solution to this, but I do not know what it is. Can anyone help, please?
Regards
Donihue
I am having trouble running a programme loop in the following circumstances:
1. the programme "abcd.prg" is implemented via the command line as follows: abcd(..., a1=0.5,a2=0.5,a3=0.1, ...) ...
2. the programme "abcd.prg" calls the subroutine "efgh" as follows: call efgh(... %a1, %a2 , %a3, ... )
[reading %a1, %a2 , %a3 as strings]
3. the subroutine "efgh" then calls another subroutine called "ijkl" as follows: call ijkl(... {%a1}, {%a2}, {%a3}, ...)
[reading {%a1}, {%a2}, {%a3} as scalars]
This works fine if all three of a1, a2 and a3 are explicitly written as numbers (eg, 0.5, 0.4, 0.1) in the initial implementation of *abcd"
But it breaks down if one of the three is a scalar (used in a loop) defined as, eg, "scalar w1=0.5" and that scalar is used to implement "abcd.prg" as in
abcd(...,a1=w1,a2=0.5,a3=0.1, ...) ...
I am sure there is a simple solution to this, but I do not know what it is. Can anyone help, please?
Regards
Donihue