Passing variables to subroutine in O4W (O4W)
At 06 JUN 2021 12:14:17AM Johan Liebenberg wrote:
Hi all,
Calling a subroutine in O4W. It's all about setting var3 with a value from order<12> and passing it to the subroutine.
* calling program *
Read order from orderfile,orderkey else…
var3 = order<12> ; * set this value
If var3 = "" Then O4WError("Var3 =
") ; * make sure it ok - but we never receive this error msg Call ABC(var1,var2,var3,order) subroutine * subroutine ABC(var1,var2,var3,order) if var3 =
then o4werror("var3 =
":@vm:order<12>) ; * error comes up with var3 = "" * In the sub var3 = "" but order<12> still contains the correct value. What happened to var3? Why is it ""? Thanks for looking :) </QUOTE> —- === At 07 JUN 2021 08:19AM bshumsky wrote: === <QUOTE>Hi, Johan. The only time I've heard of anything like this is if you happen to have the parameter that you're passing also in a named common - might these variables be in common as well? Other than that, there isn't anything "special" about how an O4W routine calls a subroutine versus how a "normal" OI program calls a subroutine - if you extract all the logic to a standalone OI program, and run it, do you get similar results? Thanks, - Bryan Shumsky Revelation Software, Inc. </QUOTE> View this thread on the forum...