_PROGRAM APP.FILE APP1A = 'Jack Smith Company' B = '' B<1> = '2471 Jackson Avenue' B<2> = 'Louisville'_PAGE HOST C:/WWW/APP/APP1_P1.HTMBEGIN CASE CASE SUBMIT ... PROCESS THE SUBMIT LOGIC CASE ABORT ... PROCESS THE ABORT LOGIC END CASE |
You should note that the core mv/WEB application code does not include any references to HTML, posted input fields, or other web server elements. Other than calling an HTML display/entry page, the code is very insulated from the web environment. One of the most powerful aspects of mv/WEB is that it allows you to segregate mv/BASIC tasks from HTML layout operations while providing seamless mechanisms to move data between the two environments.
- _PROGRAM APP.FILE APP1
- This line defines where the PLZ program will generate the executable web application. In this case, the application will be stored in the MV file APP.FILE with a base page name of APP1.HTM.
In order to access the APP1.HTM page, you will need to configure the Coyote web server to access the APP.FILE data file. You do this by entering an HTTP LISTEN line in the PLIP.CTRL CONFIG item:HTTP DIR=*:80 /APP/ FILE APP.FILE
- A = ...
- These lines set initial values for the mv/BASIC variable A and dynamic array B. This dynamic array will be used by the web page call to supply initial values to three data entry text input fields.
- _PAGE HOST C:/WWW/APP/APP1_P1.HTM
- This statement actually causes an HTML page to be transmitted to the user's web browser. The page template is located on the c: drive with a path of c:\www\app\app1_p1.htm. Note that host paths are always specified in mv/WEB with forward slashes to delimit directories.
- BEGIN CASE ...
- The logic after the _PAGE call is used to determine which of two submit buttons the user pressed in order to process the page. mv/WEB will set the variables associated with submit buttons to boolian values of 0 or 1 for each submit button. This allows the application program to quickly test variables to determine which submit button was pressed on the HTML page.
In this example, the application core program calls and HTML page. This page needs to:
<html> <head> <title>mv/WEB Demo Application</title> </head> <body> <form> <pre> Company: <input type="text" size="20" name="A"><br> Address: <input type="text" size="20" name="B<2>"><br> City: <input type="text" size="20" name="B<3>"></pre> <p> <input type="submit" name="SUBMIT" value="Submit"> <input type="submit" name="ABORT" value="Abort"> </p> </form> </body> </html> |
|