External Interfaces > RealWeb > RealWeb API > Writing a RealWeb Subroutine > Debugging your RealWeb Subroutines - RW_DEBUG

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

Debugging your RealWeb Subroutines - RW_DEBUG (RealWeb) (debug.htm)

To

Reality

Version

Topic

Submitted by

Company

Location

Email address

Comment

 

 

Debugging your RealWeb Subroutines - RW_DEBUG

RW_DEBUG is an interactive TCL program that allows RealWeb subroutines to be debugged using the DataBasic Debugger. RW_DEBUG prompts for subroutine name, parameters and cookiesClosed . It then calls the subroutine in the correct RealWeb context. When the subroutine completes, the control, output buffer and cookie parameters can be printed on the console.

Procedure

To start a debugging session, enter 

RW_DEBUG

You will see the following prompts:

Enter subroutine name ?

Enter the name of the subroutine you wish to debug.

Enter parameters in the form a=b
?

Enter the name of a parameter that you wish to pass to the subroutine, followed by an equals sign and the parameter value. Each time you press return, you will be prompted with a question mark to enter another parameter. When you have entered all your parameters, press return without entering anything.

Note: These parameters would normally be included in the URL. See Passing Data to a RealWeb Subroutine.

Enter cookie name ?

Enter the name of a cookie that you wish to be available to the subroutine. You will be prompted:

Enter cookie value ?

Enter the value of the cookie.

When you have entered all your cookies, if any, press return in response to the Enter cookie name ? prompt.

Hit RETURN to call subroutine ?

Press return to run your subroutine.

Print control string ?

If you enter Y, RW_DEBUG will output the RealWeb control string containing any system parameters set using RW_SET_TIMEOUTand RW_SET_TYPE.

Print output buffer ?

If you enter Y, RW_DEBUG will output the HTML generated by the subroutine.

Print cookie control ?

If you enter Y, RW_DEBUG will output the RealWeb cookie control string. This is a multivalued string containing any cookies created or modified by the subroutine. The values for each cookie appear in the order: name, value, timeout, path, secure, domain.

Common Errors

Error message: Subroutine not allowed
Your subroutine has not been enabled.
Error message: [B34] Insufficient number of parameters passed to external subroutine; abort!
Your subroutine is expecting to be passed one or more parameters. RealWeb subroutines cannot accept any parameters. Enter your parameters at the Enter parameters  prompt and use RW_GET_PARAMto access them (when calling the RealWeb subroutine from a web browser, these parameters would be included in the URL).

Example 1

:RW_DEBUG
Enter subroutine name ?PJD4
Enter parameters in the form a=b
?REG=G74GUX
?
Enter cookie name ?FRED
Enter cookie value ?A VALUE
Enter cookie name ?
Hit RETURN to call PJD4 ?
Print control string ?
Print output buffer ?Y
<vehicle><reg>G74GUX</reg>
<type>4 DOOR SALOON</type>
<make>FORD</make>
<colour>GREY</colour>
<keeper>FREDA MAY LEONARD</keeper>
<address><street>16 SCHOOL ROAD</street>
<district></district>
<city>DUNDEE</city>
<postcode>DD5 9ZZ</postcode>
</address>
</vehicle>

Print cookie control ?Y

:

Example 2

:RW_DEBUG
Enter subroutine name ?COOKIE
Enter parameters in the form a=b
?
Enter cookie name ?FRED
Enter cookie value ?JUNK
Enter cookie name ?
Hit RETURN to call COOKIE ?
Print control string ?Y

Print output buffer ?Y
NAME: MYCOOKIE<BR>VALUE: <BR>
<BR>
NAME: FRED<BR>VALUE: JUNK<BR>
<BR>
COOKIE LIST: FRED<BR>
Print cookie control ?Y
MYCOOKIE]MY_VALUE]l0^FRED]FRED_VALUE]20]/]FALSE
:

 

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