S/Web User Manual 
[top] 
| Equate Name | Value | Description | | WWW_CLIENT$AUTHENTICATED$ | 1 | | | WWW_CLIENT$EXPIRY_DATE$ | 2 | This is the date the client expires | | WWW_CLIENT$EXPIRY_TIME$ | 3 | This is the time the client expires | | WWW_CLIENT$IP_ADDRESS$ | 4 | This is the IP address of the client | | WWW_CLIENT$REQUEST_CACHE_KEY$ | 5 | | | WWW_CLIENT$IP_ADDRESS_HISTORY$ | 6 | | | WWW_CLIENT$USERNAME$ | 7 | | | WWW_CLIENT$USER_DATA_KEY$ | 8 | |
[top] 
| Equate Name | Value | Description | | WWW_REPOSITORY$TABLE_ID$ | 1 | The name of the LH table this repository item is stored in. | | WWW_REPOSITORY$RECORD_ID$ | 2 | The name of the LH record. | | WWW_REPOSITORY$TITLE$ | 3 | A title for the repository item | | WWW_REPOSITORY$DESCRIPTION$ | 4 | A description of the repository item | | WWW_REPOSITORY$CACHE_CONTROL$ | 5 | | | WWW_REPOSITORY$USE_TIMESTAMP$ | 6 | | | WWW_REPOSITORY$HTTP_CONTENT_TYPE$ | 7 | The HTTP content type | | WWW_REPOSITORY$IGNORE_SERVER_CACHE$ | 8 | | | WWW_REPOSITORY$UPDATE_DATE$ | 30 | The date this item was last updated | | WWW_REPOSITORY$UPDATE_TIME$ | 31 | The time this item was last updated | | WWW_REPOSITORY$UPDATE_NOTES$ | 32 | | | WWW_REPOSITORY$BUFFER_COUNT$ | 40 | |
[top] 
This program should never be called by the application developer RTP25 is replacement debugger for the Advanced Revelation instances of the S/WEB server. This program prevents Advanced Revelation from going to the debugger prompt. [top] 
This example program shows how you can return a repository defined document back to the client. This function uses the WWW_EXEC_METHOD, WWW_GET_STATUS , WWW_SET_PROPERTY and WWW_SET_STATUS functions. [top] 
This example program shows how you can return a repository defined image back to the client. This function uses the WWW_EXEC_METHOD, WWW_GET_STATUS , WWW_SET_PROPERTY and WWW_SET_STATUS functions. [top] 
This function is used to logout a user. It allows the developer to specify a URL to redirect the user to. This is done by setting the keyword "URL" to the URL to go to. If no URL is specified the user will be taken to the server home page. Usage: http:/www.myserver.com/scripts/sweb.dll/logout?url=http://www.ask.com [top] 
This function redirects the browser to another URL and is primarily used to illustrate changing the LOCATION property of the RESPONSE object. Usage: http:/www.myserver.com/scripts/sweb.dll/redirect?urli=http://www.ask.com [top] 
This program return back a Boolean value indicating whether the passed variable has been assigned. The primary purpose for this routine was to allow an unassigned variable check in Advanced Revelation and Revelation G versions that do not have the Assigned or UnAssigned functions and opcodes. If your version of Advanced Revelation contains either of these functions or opcodes, this function gives no extra benefits. Usage: if www_Assigned( Variable ) else variable = "" or Status = www_Assigned( Variable ) [top] 
This is the underlying function for the CACHE method of the WWW_EXEC_METHOD function. This program should not be called directly. You should use the WWW_EXEC_METHOD function for all CACHE method access. Sprezzatura does not guarantee that the calling parameters for this function will remain constant. [top] 
This is an equates record used by the WWW_CACHE function. [top] 
This is the underlying function for the CLIENT method of the WWW_EXEC_METHOD function. This program should not be called directly. You should use the WWW_EXEC_METHOD function for all CACHE method access. Sprezzatura does not guarantee that the calling parameters for this function will remain constant. [top] 
This is an equate record used by the WWW_CLIENT function. [top] 
This function is called as a user-defined conversion | Option | IConv | OConv | Description |
|---|
| DATETIME | Yes | Yes | IConv: Returns back standard R/BASIC/Basic+ DateTime format (DT) based on the server type. Different servers store dates and times in different internal formats. Oconv: Converts an R/BASIC/Basic+ DateTime format (DT) to the DateTime format for the required server. | | IPHEX | Yes | Yes | | Iconv converts an 8 byte hex string to a properly formatted IP address | | Command | Result | | @ANS = IConv( "C0A8591D","[WWW_CONV,IPHEX]") | 192.168.89.29 | | OConv Converts an IP address to an 8 byte hex string. | | Command | Result | | @ANS = OConv( "192.168.89.29",[WWW_CONV,IPHEX]") | C0A8591D |
| | DISPTIME | No | Yes | | Displays R/BASIC & Basic+ internal time value as HEX | | Command | Result | | @ANS = OConv( "609429","[WWW_CONV,DISPTIME]") | 7 Days, 01 hours, 17 minutes, 09 seconds |
|
[top] 
This is the underlying function for the CLIENT method of the WWW_EXEC_METHOD function. This program should not be called directly. You should use the WWW_EXEC_METHOD function for all CACHE method access. Sprezzatura does not guarantee that the calling parameters for this function will remain constant. [top] 
This is an equates record used by the WWW_DOCUMENT function. [top] 
This function is designed to show how to write an example login procedure for S/Web applications. It can be modified and used for other applications. S/Web login procedures are called by the CLIENT object's CREATE method if it determines that a client making a request has not been logged into the system yet. Before it gets here it sets up some properties that we can use to determine the state of the request... Once we have determined the state ( i.e. - are we trying to login or not? ) We then check the client's credentials ( if appropriate ) and/or send back the login document. If the client has been properly validated, the CLIENT object is updated. A valid CLIENT object would have the VALID property assigned to logical True. In most cases, a username and other information (company, access rights, e-mail address, etc.) will be stored in the DATA property. [top] 
This is the mother of all programs, such as the saying goes. It is the main calling routine for all the various methods in the S/Web system. All method calls to any object should be made through this routine. For more information on each object, and specific function syntax, please see Chapter 6, S/Web Objects or click on the hyperlink in the table below. General usage: www_Exec_Method( OBJECT, METHOD, Param1, Param2 ,Param3 ,Param4, Param5, Param6,) Specific usage: www_Exec_Method( "REQUEST", "GETQUERYVAL", "UN", 1, 1, username ) | Valid System Objects | Description | | CACHE | This object handles information relating to the S/WEB cache. | | CLIENT | This object handles information relating to the client making the current request. | | DOCUMENT | This object handles information relating to a repository based document | | LH | This object handles information relating to Linear Hash files | | REPOSITORY | This object handles information relating to the S/WEB repository | | REQUEST | This object handles information relating to the HTTP request. | | RESPONSE | This object handles information relating to the HTTP response. | | SERVER | This object handles information relating to this specific running S/WEB server | | SESSION | This object handles information relating to the current S/WEB session |
This function is used to retrieve properties from S/Web object. Multiple objects and properties can be delimited by record marks. For a listing of the properties associated with each object, please see Chapter 6, S/Web Objects. General Syntax: dataArray = www_Get_Property( objxArray, propArray ) Specific Syntax: objxArray = "REQUEST" propArray = "SERVERURL" objxArray := @Rm : "REQUEST" propArray := @Rm : "SERVEREXTENSION" dataArray = www_Get_Property( objxArray, propArray ) [top] 
This function is used to check the error status of a system program. If there is an error, this function will return a logical False. If there was no error, this function will return a logical True. Any error text will be returned in the optional passed parameter General Syntax: errorStatus = www_Get_Status( errorText ) Specific Syntax: .... www_Exec_Method( "REQUEST", "GETQUERYVAL", "UN", 1, 1, username ) If www_Get_Status( errorText ) Else * Danger Will Robinson! Danger! Danger! We have received an error! classID = "HTML" docID = "GENERAL_ERROR" call www_Exec_Method( "DOCUMENT", "READ", classID, docID, docBuffer, docProperties, docBufferNo, docBufferCount ) if www_Get_Status( errorText ) then abort = TRUE$ end else swap "%%ERRORTEXT%%" with errorText in docBuffer call www_Exec_Method( "RESPONSE", "SETCONTENT", docBuffer, "+" ) docBufferNo += 1 if ( docBufferNo > docBufferCount ) then eofDocument = TRUE$ end end until ( eofDocument or abort ) repeat end [top] 
This is the underlying function for the LH method of the WWW_EXEC_METHOD function. This program should not be called directly. You should use the WWW_EXEC_METHOD function for all CACHE method access. Sprezzatura does not guarantee that the calling parameters for this function will remain constant. [top] 
This is an equates record used by the WWW_LH function. [top] 
This equate record contains a list of all the valid system object. [top] 
This function is used to restart the server if a critical error occurs. This program should not be called by the end user. [top] 
This is the underlying function for the REPOSITORY method of the WWW_EXEC_METHOD function. This program should not be called directly. You should use the WWW_EXEC_METHOD function for all REPOSITORY method access. Sprezzatura does not guarantee that the calling parameters for this function will remain constant. [top] 
This is an equates record used by the WWW_DOCUMENT function. [top] 
This is the underlying function for the REQUEST method of the WWW_EXEC_METHOD function. This program should not be called directly. You should use the WWW_EXEC_METHOD function for all REQUEST method access. Sprezzatura does not guarantee that the calling parameters for this function will remain constant. [top] 
This is an equates record used by the WWW_REQUEST function. [top] 
This is the underlying function for the RESPONSE method of the WWW_EXEC_METHOD function. This program should not be called directly. You should use the WWW_EXEC_METHOD function for all RESPONSE method access. Sprezzatura does not guarantee that the calling parameters for this function will remain constant. [top] 
This is an equates record used by the WWW_RESPONSE function. [top] 
This is an equates record used by the WWW_RESPONSE function. [top] 
This function contains additional code for the WWW_RESPONSE function. [top] 
This program starts the main S/WEB server. It should only be called to start and stop the S/Web server. For more information, please see the sections in Chapter 3 on starting the S/Web server in Advanced Revelation or OpenInsight. [top] 
This is an equates record used by the WWW_REQUEST function. [top] 
This is the underlying function for the SESSION method of the WWW_EXEC_METHOD function. This program should not be called directly. You should use the WWW_EXEC_METHOD function for all SESSION method access. Sprezzatura does not guarantee that the calling parameters for this function will remain constant. [top] 
This is an equates record used by the WWW_SESSION function. [top] 
This function is used to set properties into an S/Web object. Multiple objects and properties can be delimited by record marks. The original values are returned from the function. For a listing of the properties associated with each object, please see Chapter 6, S/Web Objects. General Syntax: OrigDataArray = www_Set_Property( objxArray, propArray, dataArray ) Specific Syntax: objxArray = "CLIENT" propArray = "VALID" dataArray = clientValid objxArray := @Rm : "CLIENT" propArray := @Rm : "DATA" dataArray := @Rm : clientData origDataArray = www_Set_Property( objxArray, propArray, dataArray ) [top] 
This function is used to set the error status of a system program. General Syntax: ErrorStatus = www_Get_Status( opFlag, errorText ) Valid opFlag values | Equate Name | Value | Description | | WWWSTATUS_PUSH$ | -3 | Temporarily saves the current error list. | | WWWSTATUS_POP$ | -2 | Restores the last saved error list. | | WWWSTATUS_APPEND$ | -1 | Places the passed error text at the end of the current error list. | | WWWSTATUS_REPLACE$ | 1 | Replaces the current error list | | WWWSTATUS_CLEAR$ | 0 | Clears the current error list. |
Specific Syntax: .... www_Exec_Method( "REQUEST", "GETQUERYVAL", "UN", 1, 1, username ) If www_Get_Status( errorText ) Else * Danger Will Robinson! Danger! Danger! We have received an error! classID = "HTML" docID = "GENERAL_ERROR" call www_Exec_Method( "DOCUMENT", "READ", classID, docID, docBuffer, docProperties, docBufferNo, docBufferCount ) if www_Get_Status( errorText ) then abort = TRUE$ errorText = "Unable to read the " : docID :" document." call www_Set_Status( WWW_STATUS_APPEND$, errorText ) end else swap "%%ERRORTEXT%%" with errorText in docBuffer call www_Exec_Method( "RESPONSE", "SETCONTENT", docBuffer, "+" ) docBufferNo += 1 if ( docBufferNo > docBufferCount ) then eofDocument = TRUE$ end end until ( eofDocument or abort ) repeat end [top] 
This is an equates record used by the WWW_SET_STATUS function. | Equate Name | Value | Description | | WWWSTATUS_PUSH$ | -3 | Temporarily saves the current error list. | | WWWSTATUS_POP$ | -2 | Restores the last saved error list. | | WWWSTATUS_APPEND$ | -1 | Places the passed error text at the end of the current error list. | | WWWSTATUS_REPLACE$ | 1 | Replaces the current error list | | WWWSTATUS_CLEAR$ | 0 | Clears the current error list. |
[top] 
This is an equate record holds the definitive listing of S/Web Linear Hash table names.. [top] 
This is the underlying function for the UI method of the WWW_EXEC_METHOD function. This program should not be called directly. You should use the WWW_EXEC_METHOD function for all UI method access. Sprezzatura does not guarantee that the calling parameters for this function will remain constant. [top] 
This is an equates record used by the WWW_UI function. [top] 
This function provides for various utilities we needed in writing the system. | DOSCOPY | This function copies an OS file to a new location | | DOSMOVE | This function moves an OS file to a new location | | ERRORTEXT | This function takes the error code array and attempts to turn it into a more user-friendly string. | | ESCAPE | This routine escapes a string as per JavaScript and URL encoding - see RFC. 1738 | | FSERROR | Calls the ERRORTEXT method to place the contents of @File.Error into a more user-friendly string | | GETDATEFORMAT | This function grabs the default system DATE format from the specified LND record | | GETRESOURCETEXT | This method retrieves the resource text associated with a particular code(s) passed. The codes and text are stored in the WWW_ENV table in the SWEB_RESOURCE_STRING record. | | GETTIMEFORMAT | This function grabs the default system DATE format from the specified LND record. | | LHASH | This function scrambles a string by converting it into hex with a small bit of flotsam thrown in for good measure. Note: Param1 should not exceed 100 chars | | NAMECAP | Attempts to capitalize a string as befitting a proper name. For example, HOMER SIMPSON would be turned into Homer Simpson while RONALD MCDONALD would be turned into Ronald Mcdonald. | | OSERROR | Moves the content of Status() into @FILE.ERROR for use with the ERRORTEXT method | | RESOLVEPATH | This function attempts to turn an relative path into an absolute path | | RESOLVETIME | | | TOKENISE | Tokenises a string based on a delimiter, respecting quotes | | UNESCAPE | This routine unescapes a string as per JavaScript and URL encoding - see RFC. 1738> | | VERIFYPROC | This function verifies if the passed routine is a valid system routine. Advanced Revelation: A valid system routine is a cataloged RBASIC program with a valid target or exists in the SYSOBJ file. OpenInsight: A valid system routine exists in the SYSOBJ file. The program does not have to be qualified into the current application. |
Calling syntax | Argument | Description |
|---|
| param1 | Full name and path of the source file | | param2 | Full name and path of the destination file | | param3 | Logical TRUE to overwrite the destination file | | param4 | Not used. | | param5 | Not used. | | returnValue | True if successful, false otherwise. |
Calling syntax | Argument | Description |
|---|
| param1 | Full name and path of the source file | | param2 | Full name and path of the destination file | | param3 | Logical TRUE to overwrite the destination file | | param4 | Not used. | | param5 | Not used. | | returnValue | True if successful, false otherwise. |
Calling syntax | Argument | Description |
|---|
| param1 | Error code string | | param2 | Not used | | param3 | Not used. | | param4 | Not used. | | param5 | Not used. | | returnValue | Formatted text string |
Calling syntax | Argument | Description |
|---|
| param1 | String to encode | | param2 | Not used. | | param3 | Not used. | | param4 | Not used. | | param5 | Not used. | | returnValue | Encoded string. |
Calling syntax | Argument | Description |
|---|
| param1 | Not Used. | | param2 | Not used. | | param3 | Not used. | | param4 | Not used. | | param5 | Not used. | | returnValue | Error Text |
Calling syntax | Argument | Description |
|---|
| param1 | Not used. | | param2 | Not used. | | param3 | Not used. | | param4 | Not used. | | param5 | Not used. | | returnValue | Date format value |
Calling syntax | Argument | Description |
|---|
| param1 | @Fm'd list of codes to get the text for | | param2 | @Fm'd list of replaceable parameters for each string | | param3 | Not used. | | param4 | Not used. | | param5 | Not used. | | returnValue | @Fm'd list of text string |
Calling syntax | Argument | Description |
|---|
| param1 | Not used. | | param2 | Not used. | | param3 | Not used. | | param4 | Not used. | | param5 | Not used. | | returnValue | Time format value. |
Calling syntax | Argument | Description |
|---|
| param1 | String to modify NOTE: Must never exceed 100 characters! | | param2 | True to descramble - defaults to false | | param3 | Not used. | | param4 | Not used. | | param5 | Not used. | | returnValue | Hashed value |
Calling syntax | Argument | Description |
|---|
| param1 | String to convert | | param2 | Delimiter - defaults to space | | param3 | Not used. | | param4 | Not used. | | param5 | Not used. | | returnValue | Converted string |
Calling syntax | Argument | Description |
|---|
| param1 | Status() code | | param2 | Name of DOS file that caused the error. | | param3 | Not used. | | param4 | Not used. | | param5 | Not used. | | returnValue | String representing the error. |
Calling syntax | Argument | Description |
|---|
| param1 | The relative path to resolve | | param2 | The current directory - default is REVBOOT | | param3 | Not used. H | | param4 | Not used. | | param5 | Not used. | | returnValue | The absolute path |
Calling syntax | Argument | Description |
|---|
| param1 | | | param2 | | | param3 | | | param4 | | | param5 | | | returnValue | |
Calling syntax | Argument | Description |
|---|
| param1 | String to tokenise | | param2 | character to use as a delimiter in the tokenized string - defaults to @Rm | | param3 | character to use as a delimiter when tokenizing the string - defaults to space | | param4 | Not used. | | param5 | Not used. | | returnValue | Tokenised string |
Calling syntax | Argument | Description |
|---|
| param1 | String to decode | | param2 | Not used. | | param3 | Not used. | | param4 | Not used. | | param5 | Not used. | | returnValue | Decoded string |
Calling syntax | Argument | Description |
|---|
| param1 | Name of routine to check | | param2 | Not used. | | param3 | Not used. | | param4 | Not used. | | param5 | Not used. | | returnValue | True if routine exists. |
This is an equates record used by the WWW_UTILITY function. [top] 
Calls the Yield() opcode in Advanced Revelation (if version 3.12) or the yield() function in OpenInsight. WWW_YIELD surrounds the yield call with a PUSH.SELECT and a POP.SELECT [top] 
|