External Interfaces > RealWeb > RealWeb API > Writing a RealWeb Subroutine > The Structure of a URL

Comment on this topic

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)

To

Reality

Version

Topic

Submitted by

Company

Location

Email address

Comment

 

 

Passing Data to a RealWeb Subroutine

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:

The Structure of a URL

A URL has the following general format:

protocol://hostname:port/pathname?search#hash

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.

Getting the Passed Data

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:

Refer to the description of RW_GET_PARAM for details of other parameter names you can use.

Passing on Data to another Subroutine

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.

 

RealityV15.0Comment on this topic