Consultor Eletrônico



Kbase 19130: How to compile an HTML file with embedded SpeedScript in 4GL
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   11/17/1999
How to compile an HTML file with embedded SpeedScript in 4GL

Title: How to compile an HTML file with embedded SpeedScript in 4GL

KnowledgeBase Number: 19130
Creation Date: 15-SEP-99
Modified Date:
This document applies to: WebSpeed
Version and Release Number: 2.1 and 3.x

Summary:

This knowledgebase entry describes how to compile HTML files with
embedded SpeedScript from within a 4GL program.

It is important to know that an HTML file with embedded SpeedScript
does not have an associated .w or .p 4GL program.
The WebSpeed workshop and the AppBuilder in WebSpeed 3 generate a 4GL
program for the HTML file when you choose the compile or run option.

In order to compile the HTML file embedded SpeedScript you need the
following:
- Start a TTY session using _progres.
- Generate a 4GL program correspoding to the HTML file.
- Use the 4GL COMPILE statement to compile the generated program into
a .r ( r-code ).


- Start a TTY session using _progres
====================================

The program to generate the 4GL code for an HTML file should be run
using the WebSpeed tty client, i.e., _progres.
For example you can start the session using _progres and from the
Procedure Editor run the program.

_progres <database name> <additional connection parameters>


- Generate a 4GL program correspoding to the HTML file
======================================================

This can be accomplish with the following program.
It shows how to generate a "meta.w" file for a "meta.html" file.

This example appears in Chapter 5 of the WebSpeed Developer's Guide.

{ src/web/method/cgidefs.i "NEW"}
/* The line above is required for WS 2.1 and not in WS 3.x */

DEFINE VARIABLE speedfile AS CHARACTER.
DEFINE VARIABLE wsoptions AS CHARACTER.
ASSIGN speedfile = "meta.w"
wsoptions = "".
RUN tty/webutil/e4gl-gen.r
(INPUT "meta.html",
INPUT-OUTPUT speedfile,
INPUT-OUTPUT wsoptions).


IMPORTANT NOTE:
This program will generate a .w file corresponding to the HTML file
with embedded SpeedScript. Use this program only for this type of
HTML web objects.
An HTML file corresponding to a mapped WebObject has a .w file
associated, which has the 4GL code. Using the program above will
overwrite the existing .w file.


- Use the 4GL COMPILE statement to compile the generated program into
a .r ( r-code )
=====================================================================

COMPILE meta.w SAVE.
or
COMPILE VALUE(speedfile) SAVE.


You can customize to this program to fit your needs, for example, add
an option to get the HTML file names from a file or run it from the
command line.


References to Progress documentation
- WebSpeed Developer's Guide
Chapter 5 - Using Embedded SpeedScript