![]() | ![]() | ![]() | ![]() | ![]() |
This "OL_DOC.DH" tag allows you to include all or part of a file in such a manner that it appears to be viewer (IPF or HTML) much like you'd see it in a text editor. The point of this tag is to be able to include example code as is without any modifications being manually applied.
<$ExampleFile FILE="?" [STATE="?"] [INDENT="?"] [FRAGMENT="?"] [ASIS="?"]
The parameters for this tag are:
This example shows some HTML source code.
;--- Create a new clear state, set up new ASIS state, restore state --- #AutoTagState + ;--- Set up aliases for all dangerous character so that they display OK in browser --- #if ['<$DocType>' = 'HTML'] ;--- HTML being generated --- #RexxVar "UMLAUT" =x= "ü" ;;Map an alias (for our use) to the output text #elseif ;--- IPF being generated --- #RexxVar "UMLAUT" =x= "ü" ;;This char OK as is in IPF #endif ;--- We defined aliases above only so that we more easily refer to strings, for example an umlaut looks the same in IPF and HTML until alias replaced --- #AutoTag "ü" "<?xUMLAUT>" ;;Now map char to our alias ;--- Create named ASIS state called "DANGEROUS" --- #AsIs SETUP DANGEROUS #AutoTagState - ;--- Now lets also set up some automatic tagging, adding to existing tagging (only applies to this example otherwise we'd not do it here) --- #AutoTagState + Remember ;;Adding to existing tags (remember current) #AutoTag ^Gr<?xUMLAUT>n^ ^<$DarkGreen Text='Gr<?xUMLAUT>n'>^ ;;Because we used aliases we don't need to check if html/ipf etc to do this step ;--- Load the example (a part of the file - fragment) --- <$ExampleFile STATE="REMEMBER" FILE="OLDOCXMP.DH" FRAGMENT="[ExampleFileTag2]" AsIs=^DANGEROUS^> ;--- Already processed example, remove now obsolete tagging --- #AutoTagState -
The "ASIS" stuff as well as any common "AUTOTAG" steps would normally only occur once at the start of your document. Note that the tagging that you see above and below to create hypertext links is such common code in my document.
;--- Some web addresses ----------------------------------------------------- #define HttpMagazineOs2Ezine http://www.os2ezine.com #define HttpOs2SuperSiteMainPage http://www.os2ss.com ;--- Set up some common styles ---------------------------------------------- #define Red <FONT COLOR=RED>{$Text}</FONT> #define Grün <FONT COLOR=GREEN>{$Text}</FONT> ;;Note international characters can be used in names #define Bold <B>{$Text}</B> #define Quote “{$Text}” ;;Pretty double quotes ;--- Now for some html stuff ------------------------------------------------ <P>Some <$Grün Text="green text"> blah blah...
Notice the green text above is what we asked for, all other tagging (hypertext links) occurred because its set up that way at the start of this document. Hopefully you can recognise the power of this facility just from the fact that I can show you the above source and generated output!
![]() | ![]() | ![]() | ![]() | ![]() |