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 APIClosed Application Programming Interface - a set of functions that you can use in your programs to work with a component.  routines. For example, some subroutines take a Control parameter which is used to specify the destination 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.

See Also

Examples

The topics listed above include simple examples to get you started. More comprehensive examples are available: