Writing a RealWeb Subroutine
A RealWeb subroutine is a normal DataBasic external subroutine that accepts no parameters and that calls routines from the RealWeb API to construct an HTML page. Subroutines that will be called remotely using RealWeb must be enabled; see Enabling your RealWeb Subroutine.
Note
If you need to pass parameters to your subroutine, you must include them in the URL and access them using the RW_GET_PARAM API routine. See Passing Data to a RealWeb Subroutine for more details.
You must include the item #RW.INCLUDE.DEFS in all RealWeb subroutines; for example, you could add the line
INCLUDE #RW.INCLUDE.DEFS FROM /SYSFILES/REALWEB,BP
at the start of every subroutine, or create an item to be automatically included containing this line.
This item defines certain symbols that are used when calling some of the output buffer. This parameter can take one of four values: RWD-NORMAL, RWD_HEAD, RWD_JAVASCRIPT, RWD_ERROR; these four symbol names are defined in #RW.INCLUDE.DEFS.
routines. For example, some subroutines take a Control parameter which is used to specify the destinationSee Also
- A First RealWeb Subroutine.
- Two ways to Build your HTML.
- Getting Data from your Database.
- Passing Data to a RealWeb Subroutine.
- Notes on using the API Routines.
- Debugging your RealWeb Subroutines - RW_DEBUG.
Examples
The topics listed above include simple examples to get you started. More comprehensive examples are available:
- In the descriptions of the API routines.
-
In the RealWeb demonstration; this can be installed from the Reality CD.
Note
The RealWeb demonstration is part of the Reality demonstration which you install by clicking the Demo button on the initial screen. If you already have Reality installed, you must choose the Custom option (for details, refer to the Reality External Components, Installation Guide). The RealWeb demonstration can be found on the Demonstration Software menu.