I have found that there are two ways that parameters can be passed by reference:

MyFunct1(VarName)
     ;"Input: VarName, the NAME OF the variable to alter
     set @VarName@(1)="Hello"
     quit

MyFunct2(VarArray)
     ;"Input: VarArray -- PASS BY REFERENCE, the array to alter.
     set VarArray(2)="There"
     quit

And These can be called as follows:

Main
   new Array

  do MyFunct1($name(Array))
  do MyFunct2(.Array)
  zwr Array(*)
  quit

This should output this:
Array(1)="Hello"
Array(2)="There"


But I have just encountered an issue when I try to mix these two.  For
example, The following wouldn't work, I believe


MyFunct1(VarName)
     set @VarName@(1)="Hello"
    do MyFunct2([EMAIL PROTECTED])  <------------- This wouldn't work
     quit

MyFunct2(VarArray)
     set VarArray(2)="There"
     quit


Main
  new Array
  do MyFunct1($name(Array))
  zwr Array(*)
  quit


So I have written some functions using both calling methods, and I
have just now had reason to call one from another.
I know that I could create a new array, merge it, pass that array,
then when the function returns merge it back.  But, is there a way to
do this directly--i.e. achieve my erroneous line listed above, perhaps
with different syntax?

Thanks
Kevin


-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid3432&bid#0486&dat1642
_______________________________________________
Hardhats-members mailing list
Hardhats-members@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/hardhats-members

Reply via email to