Leo<HTML>

Macro Tags

Tags - Referenz
Tag Syntax
Include Tag
Macro Tags
    Beschreibung
    Hard Macros
    Soft Macros
Menu Tags
Locale Tags
Char Tag
File Tags
Image Tag
Delete Tag
Init System
Der Interpreter
Eigene Tags
Index

Quellen von macro.html:
  
     
 
<include file="top.lhhtml"> 
 
<lconf pos="/macro" pagename="macro"> 
 
<section link="/macro/description" local="description"> 
 
<locale> 
  <locale language="en"> 
 
There are 2 different macro types at <leohtml>. Soft and hard 
macros. Both macros are simple text substitutions. The different 
is the calling sheme. Soft macros are called explicitely. Hard macros 
are more dangerous but more puwerful too. 
 
  </locale> 
  <locale language="de"> 
 
Es gibts 2 verschiedene Typen von Makros. Soft und Hard Makros. 
Beide Arten sind einfache Text substitutionen. Der Unterschied 
is das Aufrufschema. Soft Makros werden explizit aufgerufen. Hard 
Macros sind mächtiger, aber auch gefährlicher. 
 
  </locale> 
</locale> 
 
</section> 
 
<!-- ********************* --> 
 
 
<section link="/macro/hard" local="hard"> 
 
<definition title="Hard Macro Tag Definition:"> 
<include file="hard-macro.def"> 
</definition> 
 
<locale> 
  <locale language="en"> 
 
The <b>name</b> of the macro is the text that should be substituted by the text 
that is definied at the <b>text</b> option. To define a hard macro, the 
macro has to be marked as such a macro type by setting the <b>hard</b> option. 
 
  </locale> 
  <locale language="de"> 
 
Der <b>name</b> des Makros ist der Text der durch den Text, der durch die <b>text</b> 
Option definiert ist ersetzt werden soll. Um ein Hard-Makro zu definieren,  
muß die <b>hard</b> Option gesetzt sein. 
 
  </locale> 
</locale> 
 
<example mode=fixed> 
<char latin1> 
<macro name="foobar" text="The Foo Bar" hard> 
</char> 
 
</example> 
 
 
<br><br> 
 
<locale> 
  <locale language="de"> 
 
Nun wird, sobald der Text "foobar" gefunden wird dieser durch "The Foo Bar" ersetzt. 
 
  </locale> 
  <locale language="en"> 
 
If the compiler finds now the text "foobar" it will be substituated by "The Foo Bar". 
 
  </locale> 
</locale> 
 
<example mode="sfixed"> 
 
<locale> 
 <locale language="en"> 
 
// before substituation<br> 
The quick brown fox jumps over the foobar. 
 
 </locale> 
 <locale language="de"> 
 
// Vor der Substitution<br> 
Es war einmal ein Mann, der hatte einen foobar. 
 
 </locale> 
</locale> 
 
<br><br> 
 
<locale> 
  <locale language="en"> 
 
// after subtitution<br> 
The quick brown fox jumps over the The Foo Bar. 
 
 </locale> 
 <locale language="de"> 
 
// Nach der Substitution<br> 
Es war einmal ein Mann, der hatte einen The Foo Bar. 
 
 </locale> 
</locale> 
 
<br> 
 
</example> 
 
<br><br> 
 
<locale> 
  <locale language="en"> 
 
But be careful with hard macros if you try to substitute "foobar" by "The foobar Foo" 
<leohtml> will hang in an endles loop. Later i'll explain you an other technic 
which will allow this. 
 
  </locale> 
  <locale language="de"> 
 
Aber sei vorsichtig. Wenn du versuchst "foobar" durch "The foobar Foo" zu ersetzen, 
wird <leohtml> in einer endlosen Schleife hängen bleiben. Später werde ich noch 
Techniken erklären, die so etwas zulassen. 
 
  </locale> 
</locale> 
 
</section> 
 
<!-- ************************* --> 
 
<section link="/macro/soft" local="soft"> 
 
<definition title="Soft Macro Definition:"> 
<include file="soft-macro.def"> 
</definition> 
 
<br><br> 
 
<locale> 
  <locale language="en"> 
 
The declaration of a soft macro is very equal to a hard macros definition. 
But a softmacro is marked with the <b>soft</b> Option. If weather the <b>soft</b> 
or <b>hard</b> option is set the macro will be a soft macro. 
 
  </locale> 
  <locale language="de"> 
 
Die Dekleration eines Soft-Makros unterscheidet sich kaum von der eines Hard-Makros. 
Mit <b>soft</b> wird ein Macro als Soft-Makro definiert. Diese Option kann auch weggelassen 
werden. Ist bei einer Makro Definition weder das <b>soft</b>, noch das <b>hard</b> Flag 
gesetzt ist das Makro ein Soft-Makro. 
 
  </locale> 
</locale> 
 
<definition title="Soft Macro Call Definition:"> 
<include file="call-macro.def"> 
</definition> 
 
<example mode=fixed> 
<char latin1> 
<macro name="foobar" text="The Foo Bar"> 
</char> 
</example> 
 
<br><br> 
 
<lang de text="Das Makro wird aber nun so aufgerufen:"> 
<lang en text="But the soft macro has to be called this way:"> 
 
<example mode="sfixed"> 
<locale> 
 <locale language="en"> 
 
// before substituation<br> 
The quick brown fox jumps over the  
 
 </locale> 
 <locale language="de"> 
 
// Vor der Substitution<br> 
Es war einmal ein Mann, der hatte einen 
 
 </locale> 
</locale> 
 
<char latin1> 
 <macro foobar> 
</char> 
 
<br><br> 
 
<locale> 
  <locale language="en"> 
 
// after subtitution<br> 
The quick brown fox jumps over the The Foo Bar. 
 
 </locale> 
 <locale language="de"> 
 
// Nach der Substitution<br> 
Es war einmal ein Mann, der hatte einen The Foo Bar. 
 
 </locale> 
</locale> 
<br><br> 
</example> 
 
<br><br> 
 
<locale> 
 <locale language="en"> 
 
It's really simple. Such a macro is not very flexible. 
But there is the <b>PARAMETER_X</b> option that makes the stuff 
a little bit simplier: 
 
 </locale> 
 <locale language="de"> 
 
Es ist wirklich einfach. Aber so ein Makro ist nun einmal 
nicht sehr flexibel. Um die Sache doch ein wenig flexibler 
werden zu lassen gibt es die <b>PARAMETER_X</b> Option: 
 
 </locale> 
</locale> 
 
<macro name="foobar" text="The PARAMETER_1 Foo PARAMETER_2"> 
 
<example mode=sfixed> 
 
<br> 
 
<lang de text="// Definition"> 
<lang en text="// definition"><br> 
<char latin1> 
<macro name="foobar" text="The PARAMETER_1 Foo PARAMETER_2"> 
</char> 
  <br> 
  <br> 
 
<lang de text="// Aufruf"> 
<lang en text="// call it"> 
  <br> 
 
<char latin1> 
<lang en text="The quick brown fox jumps over the <macro foobar PARAMETER_1=\"real\" PARAMETER_2=\"Bar\">."> 
<lang de text="Es war einmal ein Mann, der hatte einen <macro foobar PARAMETER_1=\"real\" PARAMETER_2=\"Bar\">."> 
</char> 
  <br> 
  <br> 
 
<lang en text="// Result"> 
<lang de text="// Ergebnis"> 
  <br> 
 
<lang en text="The quick brown fox jumps over the <macro foobar PARAMETER_1=\"real\" PARAMETER_2=\"Bar\">."> 
<lang de text="Es war einmal ein Mann, der hatte einen <macro foobar PARAMETER_1=\"real\" PARAMETER_2=\"Bar\">."> 
  <br> 
  <br> 
 
</example> 
 
<br><br> 
 
<locale> 
  <locale language="de"> 
 
Makros sind ein relativ primitives Werkzeug, und sind recht unflexibel. Aber auch sie 
haben ihre Daseinsberechtigung. Wer allerdings mehr Flexibilität will muß 
früher oder später auf <link path="/define"> zurückgreifen. 
 
  </locale> 
  <locale language="en"> 
 
Macros are a very simple tool. Simple, but often usefule. If you wan't more flexibility 
you'll have to use <link path="/define">. 
 
  </locale> 
</locale> 
 
</section> 
 
                  
    



Diese Seite wurde von King Leo kreiert. Seitengenerator Leo<HTML> Version 0.99.0 .