NetBasic v4.11 ships with IntranetWare and NetWare 4.11. NetBasic v6.0, at the present time, is in Beta and is available from the Hitecsoft Web site (www.hitecsoft.com) or from the DeveloperNet essentials CD distributed at Brainshare and Java One in early 1997.
The differences between the two versions may cause existing scripts to function improperly or not function at all.
Location of Web Scripts
In v4.11 you could place web scripts anywhere under SYS:NetBasic/Web. ie. SYS:NetBasic/Web/Mystuff/test.bas
In v6.0 this is prohibited because of other features that were added which will be discussed later. All web scripts MUST be placed IN SYS:NetBasic/Web. ie. SYS:NetBasic/Web/test.bas
Calling Web Scripts from Browsers
Another critical difference is the way the scripts are called from a Web browser.
In v4.11, you could call the script with or without specifying the .BAS extention.
In v6.0, if the script is not compiled (another feature that will be discussed later), you must call the script by specifying the .BAS extention. ie. http://myserver/netbasic/test.bas Otherwise, NetBasic will not be able to find the script.
Calling Subroutines
Another added feature with v6.0 that makes the calling convention different, is the ability to call individual Subroutines within a script. This feature gives you the ability to have one script perform several CGI functions, ie. one subroutine to generate a form, another to process the form, etc. In v4.11 this functionality was possible only through a complex method of If statements and Query Strings.
Example: If you had a script named, WEBPIZZA.BAS that had three subroutines:
Main (required) PaintForm (used to generate a pizza order form) ProcessOrder (used to retrieve the order data and process it)
You could generate the form with the URL: http://myserver/netbasic/webpizza/PaintForm The form would specify the URL to process the data as: http://myserver/netbasic/webpizza.bas/ProcessOrder
See the NetBasic documentation on URI (Universal Resource Identifier) in the NetBasic IDE Tutorial contained in the User's Guide. The URI macro defined in doc.h eliminates the need to know whether or not the script is compiled and should be used to reference in all NetBasic scripts/NLMS that reference other NetBasic Scripts/NLMs.
Compiling
NetBasic v6.0 allows you to compile your script into an NLM. Once a script is compiled, it is placed in the SYS:System/NMX directory. It is then called from a browser with the same calling convention as a normal script, except the .BAS extention is eliminated.
See the NetBasic documentation on URI (Universal Resource Identifier) in the NetBasic IDE Tutorial contained in the User's Guide. The URI macro defined in doc.h eliminates the need to know whether or not the script is compiled and should be used to reference in all NetBasic scripts/NLMS that reference other NetBasic scripts/NLMs.
New APIs
Several new APIs were added in NetBasic v6.0. Many were added to the DOC class (for Frames, Tables, multi-valued CGI variables, etc), and various additions are also found in many other classes.
| xntb01.exe | 21.1 K | 2005-04-06 |
© 2008 Novell, Inc. All Rights Reserved.