Connectivity MultiValue DBMS

 
 
Nebula Research and Development

Add-On Components for FlashCONNECT cont'd.

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.

BuildPage: *
call w3HtmlInsert("","")
call w3HtmlHeader("","")
subs = "##title##" : @vm : "Sales Order"
subs<-1> = "##orderid##" : @vm : OrderNum
subs<-1> = "##shipdate##" : @vm : oconv(date()+3,"d4")
call w3HtmlInsert("sample2",subs)

CreateDetail: *
PageName = "sample2.htm"
Section = "detailitem"
DetailBlock = ""
Total = 0
ct = dcount(partnumbers,@vm)
for line = 1 to ct

subs = "##line##" : @vm : line
subs<-1> = "##id##" : @vm : partnumbers<1,line>

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!

Back

© 2007 Nebula Research and Development

 
 

Home | About Us | News | FAQ | Products
Services | Articles | Contact Us |Search Site

E-mail for Product and Service inquiries.
Please report site issues to . Thank you!