- System & Metode
- Produkter
- IceBreak
- IceCap
- InterForm
- BlueSeries
- BlueNote
- ZipSeries
- Application Store
- Bestil prisliste
- Download
- Support
- Nyheder

In this sample I split the logic and the design into two files (.ASP and .HTML). I'm using the "Pre-compile time Include with tags" technique in the sample. This will make the ASP source code much easier to understand and the HTML include file will only hold the presentation.
The following list program is written in fixed RPGLE and it loops through a file called Product. All records are putted into a HTML table described in the included file.
The HTML file looks like:
<!--#tag="Init"-->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<link rel="stylesheet" type="text/css" href="/System/Styles/IceBreak.css"/>
</head>
<!--#tag="ListHeader"-->
<body>
<form method="POST" action="#" id="form1" name="form1">
<fieldset><legend>Work with Products</legend>
<table class="ListHead">
<thead>
<tr class="ListHead">
<th></th>
<th>Product<br>ID</th>
<th align="left">Description</th>
<th>Manufacturer<br>ID</th>
<th align="right">Price</th>
<th align="right">Stock<br>Count</th>
<th>Stock<br>Date</th>
</tr>
</thead>
<!--#tag="ListDetail"-->
<tr class="ListDetail">
<td><a title="Detail" href="ex19EdtPrd.asp?ProdKey=<%=%char(ProdKey)%>"><img src="/System/Images/plus2d.jpg" border="0"></a></td>
<td ><% = ProdId %> </td>
<td ><% = Desc %> </td>
<td ><% = ManuID %> </td>
<td align="right"><% = %Editc(Price : 'N') %> </td>
<td align="right"><% = %Editc(StockCnt : 'N') %> </td>
<td><% = %char(StockDate: *ISO) %> </td>
</tr>
<!--#tag="Exit"-->
</table>
</fieldset>
<input type="button" onclick="window.open('ex19EdtPrd.asp', '_parent');" value="Create" name="Func">
<input type="button" onclick="history.back();" value="Back" name="Back">
</form>
</body>
</html>
And the .ASP file looks like:
<% *' ------------------------------------------------------------------------ *' Company . . . . : Agentdata, Denmark *' Design . . . . : Bent Ronne *' Function . . . : List records in a web list * ' *' Created . . . . : 11.11.11 12:12:12 *' *' ------------------------------------------------------------------------ H*Keywords+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++Comments++++++++++++ H DecEdit(*JOBRUN) F*Filename+IPEASFRlen+LKlen+AIDevice+.Keywords+++++++++++++++++++++++++++++Comments++++++++++++ FProduct if A E K disk C*LN01Factor1+++++++Opcode&ExtFactor2+++++++Result++++++++Len++D+HiLoEq....Comments++++++++++++ C exsr init C *loval setll ProductR C read ProductR 80 C *in80 doweq *off C exsr ListDetail C read ProductR 80 C enddo C exsr exit /* ------------------------------------------------------------------------ Init set up the HTML header incl. stylesheets and scripts ------------------------------------------------------------------------ */ C Init Begsr %><!--#include file="Tutorials/ex19WrkPrd.htm" tag="init"--><% %><!--#include file="Tutorials/ex19WrkPrd.htm" tag="ListHeader"--><% C endsr * ------------------------------------------------------------------------ * Write the line * ------------------------------------------------------------------------ C ListDetail Begsr %><!--#include file="Tutorials/ex19WrkPrd.htm" tag="ListDetail"--><% C endsr * ------------------------------------------------------------------------ * Done * ------------------------------------------------------------------------ C exit Begsr %><!--#include file="Tutorials/ex19WrkPrd.htm" tag="exit"--><% C move *on *inlr C return C EndSr %>
Re: Split your program logic and design into sepereted files
Skrevet af itp, lør, 07/01/2006 - 23:00Interesting approach.
How does RPG compiler know what to do with a %><!-- tag --><% ?
Why does the .asp file look suspiciously like RPG?
Hmmm, maybe we are not even dealing with an RPG compiler here?
Do you require Apache sever and/or dedicated application server?
By comparison the CGIDEV2 (as well as Cozzi & Stone) method would look something like this:
c eval IfsMultIndicators = gethtmlifsmult('/CgidevExt/salesReport1ifs.html':'<as400>') C callp updHTMLvar('Region' :myvariable) c callp wrtsection('TableDetail')ref: http://tinyurl.com/jf4jf
Re: Split your program logic and design into sepereted files
Skrevet af Bent Rønne, lør, 07/01/2006 - 23:00Technical Director/CIO. System & Metode A/S. Denmark.
Actually we are talking about a pre-compiler for RPGLE and COBOL. The IceBreak pre-compiler creates a new RPGLE or COBOL behind the scene where special character strings like the <% and %> are converted into to IceBreak build in functions.
So, it is true that we are dealing with real OS400 compiled programs running native OS400 and through the genuine OS400 native application server IceBreak!
Bent
Re: Split your program logic and design into sepereted files
Skrevet af mjhaston, søn, 07/02/2006 - 23:00Looks similar to RPGsp ( RPG Smart Pages ) that profound logic creates.
Re: Split your program logic and design into sepereted files
Skrevet af itp, søn, 07/02/2006 - 23:00and what's running at run tine? Apache HTTP sever, NT web server, websphere, dedicated server? where do you keep html codem on IFS? an how does .net (.asp) factor in? do you need any Microsoft licenses?
Re: Split your program logic and design into sepereted files
Skrevet af itp, søn, 07/02/2006 - 23:00I think RPGsp has the same idea but flips it around.... Add the RPG to your HTML code, sort of like PHP approach but much more goofy looking. (Reminds me of that old commercial... "You got chocolate in my peanut butter, no you got peanut butter in my chocolate").
What is amazing , is the lengths we will go not to have to learn a new language.
Re: Split your program logic and design into sepereted files
Skrevet af Bent Rønne, man, 07/03/2006 - 23:00Technical Director/CIO. System & Metode A/S. Denmark.
I’m sure you agree when I say - you have to learn HTML if you like your application on the WEB!
The IceBreak Application server and your own program are all that runs at runtime – nothing else! IceBreak is the dedicated server needed and it runs directly in OS400. If you use WRKACTJOB you will see a Subsystem called ICEBREAK. Underneath you will see you own program running with OS400 joblogs, open files etc.
Your program sources are placed in the IFS together with HTML. You can mix RPG/COBOL and HTML in the same source or as stated in this thread separated into different files.
You can use any kind of editors: Notepad, Frontpage, WebSphere, HTML-kit, UltraEdit, PSPad and even MAC and EDTF (from 5250).
You do NOT need any Microsoft licenses.