Runtime+Variables

Runtime Variables

 * Default Variables**

Each Run BASIC program has access to the following global variables:


 * DefaultDir$ - The folder path where program files are read/written by default
 * Platform$ - The operating system on which Run BASIC is being hosted
 * UserInfo$ - This is information about the user's web browser
 * UrlKeys$ - Contains informational parameters from the URL submitted when the user connected
 * UserAddress$ - Contains the IP address of the user
 * ProjectsRoot$ - The folder path where Run BASIC keeps programming projects
 * ResourcesRoot$ - The folder path where Run BASIC keeps web-servable files
 * Err$ - A description of the last runtime error
 * Err - A numeric code for the last runtime error (errors that have no code use zero)
 * EventKey$ - The id of the object that generated the last user event
 * RowIndex - The numeric index of the table or database accessor link that generated the last user event
 * NullColumn and NullColumn$ - When using a QueryResultRow object Run BASIC will translate NULL values into 0 when asked for a numeric value, and into an empty string when asked for a string. You can change the default values to something else if you like by changing the contents of the NullColumn$ and NullColumn variables, which are globally visible.

Variable names in Run BASIC are case sensitive. Here is a partial list of variables that are pre-filled at runtime. These are also globally visible.


 * **Name** || **Sample Data** ||
 * UserInfo$ || "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1)" ||
 * Platform$ || "win32" ||
 * UrlKeys$ || "app=appName&param1=value1&param2=value2" ||
 * UserAddress$ || "184.11.231.1" ||
 * DefaultDir$ || "c:\rbp" ||
 * EventKey$ || "#key" or "#handle" ||

The demo below will print the contents of the runtime variables when the link is clicked. EventKey$ will contain the handle of the link, which is #display.

code format="vbnet" link #display, "Click Me",[Display] print " " wait

[Display]

print "UserInfo$ is: ";UserInfo$ print "Platform is: ";Platform$ print "UrlKeys$ is: ";UrlKeys$ print "UserAddress$ is: ";UserAddress$ print "EventKey$ is: ";EventKey$ print "DefaultDir$ is: ";DefaultDir$ code