Documentation Comments
Use this form to comment on this topic. You can also provide any general observations about the Online Documentation, or request that additional information be added in a future release.
Reality V15.0 ()
Passing Data to a RealWeb Subroutine (RealWeb) (passing.htm)
A RealWeb subroutine can accept no parameters, so any input data must be included in the URL. This can be done in the following ways:
A URL has the following general format:
protocol://hostname:port/pathname?search#hash
These
arguments can be processed in a RealWeb subroutine (by
using the RW_GET_PARAM API call) or, if
included in the URL of a page displayed in the browser, by client-side code
written in
JavaScript
or
VBScript
.
For example:
http://www.foo.com/servlet/reality/hotelConnect/HOTEL/room?number=21#facilities
In the above, "HOTEL" is the name of a RealWeb subroutine and "room" is a parameter passed as an additional path element. In addition, the value 21 for parameter "number" is passed as a search string and the "facilities" anchor is specified.
The RW_GET_PARAM routine provides access to the various parts of the URL. You must specify the name of the parameter you require and a variable in which to return its value:
Parameters passed as name=value
pairs in search strings are accessible by name. For example, if the URL
includes the name=value
pair number=21
, running
CALL RW_GET_PARAM("number", RESULT)
will set the RESULT variable to 21.
Note: A parameter passed in this way can be changed and the new value passed on to another RealWeb subroutine; see Passing on Data to another Subroutine below.
CALL RW_GET_PARAM("__url", RESULT) ANCHOR = GROUP(RESULT, "#", 2, 1)
Refer to the description of RW_GET_PARAM for details of other parameter names you can use.
If required, your RealWeb subroutine can call another RealWeb subroutine; any parameters passed to the original subroutine are passed on and can be accessed with RW_GET_PARAM.
The RW_SET_PARAM routine allows you to modify or add search string parameters. For example:
CALL RW_SET_PARAM("location", "annex") CALL RWSubroutine2()
sets the "location" parameter to the value "annex" and then calls the subroutine RWSubroutine2.
Note: You cannot change the values of the internal RealWeb parameters.