[Gambas-user] Passing arguments between WebPages

Tobias Boege taboege at ...626...
Thu May 18 17:45:00 CEST 2017


On Thu, 18 May 2017, Tobias Boege wrote:
> (2) The other question is about receiving arguments. If I'm a child page
> and the parent included me by setting the "text" argument (like in (1)),
> then I can print the "text" value via the special syntax
> 
>   <%!text>
> 
> But I want to use this value inside a <% Code %> or <%= Expr %> section,
> to evaluate or manipulate it (this also doesn't work, but hopefully gets
> my question across):
> 
>   <%= Subst$(!text, "#", "No. ") %>
> 
> For instance, is there a hidden Collection containing all the passed
> arguments somewhere in the scope in which <% Code %> and <%= Expr %>
> execute?
> 

Turns out there is and it's called _Arg. (It didn't occur to me before that
I should look at gb.web's source code as well; I only tried to understand
gbc_form_webpage.c). So the following demonstrates that what I wanted is
possible (although not documented, so nobody should use it, of course):

  <%= _Arg!text %>

is the same as

  <%! text %>

Regards,
Tobi

-- 
"There's an old saying: Don't change anything... ever!" -- Mr. Monk




More information about the User mailing list