Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

CRTFORM equivalent in WebFocus?

Status
Not open for further replies.

PeterG5

Programmer
Apr 29, 2003
68
IE
Hi All,
I'm in the process of migrating some of my VM Focus applications to Webfocus 4.3.1 and I'm looking for an equivalent facility to CRTFORM, whereby a screen containing pre-determined variables can be displayed to the user, to change if necesssary, press the Enter key and the program executes. I know that using & or && variables and forcing a screen prompt can be similar but it's not the same, e.g. you cannot pre-populate a field for the user to change
and the prompts appear one at a time. With CRTFORM, they all appear at once.
Any suggestions?
Many Thanks, Peter.
 
-CRTFORM is not an option in WebFOCUS.

The equvalent is going to have to be done in HTML.
The Dialogue Manager logic that treats the & variables can stay the same.

You can look into -HTMLFORM where you can put HTML into a focexec but you still need HTML coded.

In release 5.2 there is a Resource Layout tool that makes this easier.

Prior releases have Desktop intergration with MS Frontpage 2000.
 
Many Thanks, Focman.
Any chance of a tiny example? I've never used/seen
-HTMLFORM but if I saw an example, I'm sure it
would be most helpful.
Thanks again, Peter.
 
Here is a very basic example of how to send parameters from an HTML form (on a server) to a Focus program (in my environment, Focus 7.02 resides on an MVS mainframe). The example below shows how to display the output of an existing Focus program in whatever output format the user selects (limited to a list of options that you provide on the HTML form).

First, the Focus program (residing on the mainframe) - using the Car file:


-SET &OUT = IF &FRMT EQ 'DOC' THEN
- 'ON TABLE PCHOLD FORMAT DOC' ELSE
- IF &FRMT EQ 'EXL2K' THEN
- 'ON TABLE PCHOLD FORMAT EXL2K'
- ELSE ' ';


TABLE FILE CAR
PRINT CAR COUNTRY
WHERE RECORDLIMIT EQ 10
&OUT
END

-* end of program

&FRMT is passed to the above program from the HTML form (see below). &OUT is a simple amper variable that contains the ON TABLE PCHOLD FORMAT 'formattype' program text that will be substituted into the Table File request at the time of execution.

The HTML file looks like this:

<HTML>
<body>

<form action=&quot; method=&quot;GET&quot;>
<input type=&quot;hidden&quot; name=&quot;IBIF_ex&quot; value=&quot;CARTEST&quot;>


<center><h2><font face=&quot;Arial&quot;>Car Test</font></h2></center>

<center>
<table>
<tr>
<td><font size=&quot;2&quot; face=&quot;Arial&quot;><b>
Select report output option:</b></font></td>
<td><font size=&quot;2&quot; face=&quot;Arial&quot;>
<select name=&quot;FRMT&quot;>
<option selected value=&quot;BROWSER&quot;>
Browser format</option>
<option value=&quot;DOC&quot;>Text Document</option>
<option value=&quot;EXL2K&quot;>Excel2000</option>
</select>
</font>
</td>
</tr>
</table>
<p>

<font face=&quot;Arial&quot;>
<input type=&quot;submit&quot; name=&quot;Submit&quot; value=&quot;Run Report&quot;>
<input type=reset name=&quot;reset&quot; value=&quot;Reset Values&quot;>
</font></p>

</form>

<center>
</body>
</HTML>


In this form, the following lines are important:

1. <input type=&quot;hidden&quot; name=&quot;IBIF_ex&quot; value=&quot;CARTEST&quot;>

&quot;CARTEST&quot; is the name of the Focus program (Uppercase - case sensitive).

2. <select name=&quot;FRMT&quot;>...</select>

This HTML phrase gives a name to the variable that is passed to the Focus program (with an ampersand added).

3. <option selected value=&quot;BROWSER&quot;>Browser format</option>
<option value=&quot;DOC&quot;>Text Document</option>
<option value=&quot;EXL2K&quot;>Excel2000</option>

These are the options that the user sees and can select. The default value is prefixed with 'selected', as in the first option. The 'value' associated with the selected option is passed as the value of FRMT back to the Focus program.


When the user clicks the Submit button on the form, a URL is created that contains the Focus program name and the form variables. These values are passed to the server (named in the 'FORM ACTION=' HTML ocde) and then on to Focus.

The mainframe CARTEST program is executed. The value of FRMT that was passed from the form is substituted into the Focus program and the -SET logic creates a PCHOLD statement on the fly. The Table File request is executed and the output is delivered according to how the PCHOLD statement is created.

Hope this helps.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top