Note : These pages are
no longer active. Please reset your bookmarks and visit our current Products
page.
Using NebulaFCCreateSection & NebulaFCReplaceSection
Here is a "pseudo" code sample showing how to use these routines
to generate the output shown in Example 1
using the template from Sample 2. Some variables are assumed to contain data, other
details not pertinent to this example are omitted, this is intended
to profile the use of the new subroutines and not to present a functional
application.
Total = Total + amount<1,line>
HTML = ""
Flags = "c"
call NebulaFCCreateSection(PageName, Section, subs, HTML, Flags)
DetailBlock = DetailBlock : HTML next n
UpdatePage: * PageName = ""
Flags = "c"
SectionName = "detailitem"
call NebulaFCReplaceSection(PageName,DetailBlock,Section,Flags)
SectionName = "total"
call NebulaFCReplaceSection(PageName,Total,Section,Flags)
call w3HtmlFooter("","")
return
In the BuildPage routine above, standard FlashCONNECT subroutines are
used to setup the initial page. (Assume the default template is null
and contains no HTML.) After w3HtmlInsert is called, the page is now
in memory and waiting to be returned to the user.
In the CreateDetail routine, NebulaFCCreateSection uses the detailitem
section from the template, performs substitutions on it, then returns
a block of HTML code. That HTML is accumulated in the DetailBlock variable.
Note that this function of retrieving an HTML segment from a template
is not possible using standard FlashCONNECT subroutines.
In the UpdatePage routine, NebulaFCReplaceSection uses the page thus
far created by FlashCONNECT as a source page. It scans for the template
block contained with the <!--detailitem--> start and end tags,
then replaces that entire section with the new completed block. The
template section is itself a placeholder for the new data! The next
call to NebulaFCReplaceSection replaces the <!--total--> section
with the generated order total.
The SectionName was specified for NebulaFCReplaceSection using just
the name of the section, it automatically adds the <!--comment-->
start and end tags if the Flag is "c". If the Flag is not
"c", any text can be used to denote a block to be replaced,
the SectionName in this case will have two attributes, atb1 is the starting
text and atb2 is the ending text. If the Flag contains the letter "m",
multiple occurences of the text will be replaced with the data provided.
This by itself is a very powerful function for web page manipulation.
(Subject to change)
Both NebulaFCCreateSection and NebulaFCReplaceSection are available
for purchase as a bundled set for the low cost of only $20US. Payment
can be made via PayPal or by check
(see our Contact page for mailing info),
and code will be e-mailed upon receipt of payment.
For more information or examples of Nebula components, please contact
us at
.
Thank you for your interest in software from Nebula Research and Development!