.gsf function return value doesnt work
Jennifer Adams
jma at COLA.IGES.ORG
Wed Mar 11 13:57:25 EDT 2009
If it works as a subroutine in a script but not as a .gsf, then it's
probably a bug. I will look into it. --Jennifer
On Mar 11, 2009, at 1:37 PM, Pablo Romero wrote:
> I'm reposting this question, since I dont know if the listserver
> rejected it the first time...
>
> I've never been able to get the following to work: use the
> 'return(varname)' statement within a .gsf function to return a value.
>
> I've only been able to accomplish the passing of variables around
> between scripts by using '_varname' global variables, but this
> defeats the whole purpose of creating a script function.
>
> I want to create a .gsf function that can actually return a value
> that can be directly assigned to a variable in a .gs file.
>
> example:
>
> *gsf file, addit.gsf
>
> function addit(var1,var2)
> sum=var1+var2
> return (sum)
>
> *test gs file, tst.gs
>
> rc = gsfallow("on")
> tx=addit(2,3)
> say '2+3 is 'tx
>
> however, this doesnt work...
> it simply prints '2+3 is ', so the gsf function is NOT returning the
> value of the 'sum' variable...
>
> Is this by design or am I doing something incorrectly?
> are global variables the ONLY way to pass variables between script/
> script function files?
>
> If this *is* by design, then I would please like to submit a request
> to COLA to consider fixing this in future versions.
>
> P.Romero
> _________________________________________________________________
> Windows Live™ Contacts: Organize your contact list.
> http://windowslive.com/connect/post/marcusatmicrosoft.spaces.live.com-Blog-cns!503D1D86EBB2B53C!2285.entry?ocid=TXT_TAGLM_WL_UGC_Contacts_032009
--
Jennifer M. Adams
IGES/COLA
4041 Powder Mill Road, Suite 302
Calverton, MD 20705
jma at cola.iges.org
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://gradsusr.org/pipermail/gradsusr/attachments/20090311/e34fe331/attachment.html
More information about the gradsusr
mailing list