External Interfaces > RealWeb > RealWeb API > Writing a RealWeb Subroutine > The aClass Parameter

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.

RealityV15.1Online Documentation (MoTW) Revision 7

Notes on using the API Routines (RealWeb) (using.htm)

To

Reality

Version

Topic

Submitted by

Company

Location

Email address

Comment

 

 

Notes on using the API Routines

The aClass Parameter

The majority of the RealWeb APIClosed routines include an aClass parameter. This is a DataBasic dynamic arrayClosed that can be used to set tag attributes in addition to those specified by the other subroutine parameters (parameters are only provided for the most commonly used attributes).

The elements in the aClass array can be of two types:

For example, in the RW_SELECT_LIST routine, the aClass Parameter can be used to specify the following:

Element No. Attribute Description
1 CLASS The name of a tag class defined in a CSSClosedstylesheet.
2 STYLE The style of the list. Enter MULTIPLE to enable multiple selections.
3 SIZE The number of lines in the visible section of the select list.
4 ONCLICK The name of the function to be run when the onClick event occurs.

In addition to the above, any other attribute of the HTML SELECT tag can be explicitly specified as a name:value pair, separated by an equals sign (=). Such elements are copied verbatim into the HTML tag.

Notes:

The following examples show three ways of setting the aClass parameter:

CLASS = ''		* Initialise the class variable
CLASS<1> = '' * Do not specify a class
CLASS<2> = 'MULTIPLE' * Enable multiple selections
CLASS<3> = 5 * Display five lines of the list
CLASS<4> = '' * Do not specify an onClick function
CLASS<5> = 'ID=MyList' * Give the list the ID 'MyList'
CLASS = @AM:'MULTIPLE':@AM:5:@AM:@AM:'ID=MyList'
CLASS = 'ID=MyList'	* Specify only an ID

The last example demonstrates that an explicitly-specified attribute can appear in any position following the last non-null position-dependent attribute.

The resulting dynamic arrayClosedwould then be passed to the RW_SELECT_LIST routine.

Note: In the majority of cases, the first element of the aClass array specifies the name of a CSSClosed class.

Parameter Precedence Rules

Parameters passed to a RealWeb API routine are processed in the following order:

The effect of this is as follows:

In the most extreme case an HTML tag attribute could be initially set to a value specified in a CSS class, and then be redefined, first to a value given in a routine-specific element in the aClass parameter, then to a value set by an explicitly specified element appended to aClass, and finally to a value specified in one of the subroutine's other parameters.

The Control parameter is used to alter the internal behaviour of the subroutine and there are no other ways of setting values that are set by Control, therefore its position in the parameter list doesn't matter.

 

RealityV15.1 (MoTW) Revision 7Comment on this topic