On 11/8/06, Erwin Eliveld <[EMAIL PROTECTED]> wrote:
>
> Hello,
>
> Being having fun with Aftergrasp (again;-) and stumbled onto the following:
>
> How to get a return value from a sub?
>
> ====>
> gosub test_sub
> textln "returned is:"
> text @0
> wait
> exitnow
>
> test_sub:
> local tmp_string "bye bye"
> return @tmp_string
> <=====
>
> In Glpro this example works, in the latest built of Aftergrasp (and before)
> it doesn't. I expect that some things are different from the good old Glpro.

@0 isn't supported for most cases (supporting it resulting in the
creating of an @0 variable after every subroutine, and every command
which really put a drag on the execution speed).

In your example you'd want to write:

  result = test_sub()
  textln "returned is:"
  text @result
  wait
  exitnow

test_sub:
  local tmp_string "bye bye"
  return @tmp_string

The trick to find this out was to to search for @0 in the UPDATE.TXT
log, you will find this from July 2003:

Added New command, INPUTBOX, puts up a very simple EXCEL style dialog
to enter a single text field.

   RESULT = INPUTBOX(VARIABLE)
   RESULT = INPUTBOX(VARIABLE,PROMPT)
   RESULT = INPUTBOX(VARIABLE,PROMPT,TITLE)
   INPUTBOX VARIABLE
   INPUTBOX VARIABLE,PROMPT
   INPUTBOX VARIABLE,PROMPT,TITLE

The return value is either "ok" or "cancel"

Use of @0 is also supported for the return value (like the messagebox
command). Remember @0 is generally NOT support in AfterGRASP, it's only
provided with a few commands (like MESSAGEBOX) to simplify coding and
supporting older scripts.

> BTW any people doing 'something'with Aftergrasp?

Nothing big and public. Mostly quiet projects.

--~--~---------~--~----~------------~-------~--~----~
 You received this message because you are subscribed to the Google Groups 
"aftergrasp" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/aftergrasp?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to