Contact | Privacy | Datenschutzerklärung | Impressum

assign Tag

Format: <assign Variable> heitml </assign>

Purpose: Assign text to a Variable.

Variable must be a valid variable name or object field.

Anything you type between the opening and closing assign tags is processed in HTML mode where the resulting string output is not sent to the browser, as usual, but stored in the Variable.

Useful when a lengthy text is to be produced using some of the formatting features of heitml.

Here's a Source Code example that uses the assign Tag to store a nice little heitml demo routine in a variable gl._prg. (We won't go into detail about the inner workings of the routine itself other than to explain that you can easily adapt it to many purposes, including to convert a string of text to a furl argument that could be passed to another page on the URL line of your Browser.)

Example:

<assign gl._prg>
 <\let x="Convert this string to a furl.">
 <\? x>
 <\br>
 x is <\? len(x)> characters long.
 <\br>
 <\let i=0; z="";
  while i<len(x);
    if x[i]==" ";
       z=z+"+";
    else
       z=z+x[i];
    /if;
    i=i+1;
  /while;
 ? z> <\br>
 z is also <\? len(z)> characters.
</assign>

Now that we've stored the routine into the variable gl._prg, here's what happens when you use the ? Tag to display the contents of the variable.

Example:

input:resulting output:
<? gl._prg>
 
 
 
x is characters long.

z is also characters.

Notice that heitml automatically knew it should omit the escape characters "\" to show the Code in its pure form (i.e. the normal form you would use if you were executing the code directly, without having assigned it to a variable.

And here's what happens when we tell heitml to interpret the contents of the gl._prg variable as heitml Source Code to be executed:

Example:

input:resulting output:
<? gl._prg heitml>
 
 Convert this string to a furl.
 
x is 30 characters long.
Convert+this+string+to+a+furl.
z is also 30 characters.

Note: The assign Tag is Case Sensitive, which means that heitml will not recognize it if you use capital letters (e.g. <ASSIGN Variable>).

This page was dynamically generated by the web application development tool RADpage of H.E.I.

Selected blog articles : 3D Objects on HTML pages, CSS Transition Visibility, and CSS Transition Display.


© 1996-2019 H.E.I. All Rights Reserved.



Homepage
Intro/Features
Component Guide
Programming
  Language Guide
  Language Ref.
    General Design
    Lexical Structure
    Expressions
    Objects
    Methods
    Classes
    heitml Tags
      ? Tag
      assign Tag
      break Tag
      callenv Tag
      dbdatabase Tag
      dbquery Tag
      dbupdate Tag
      def Tag
      defautoclose Tag
      defbody Tag
      defclass Tag
      defcontpara Tag
      defenv Tag
      defhtml Tag
      definpara Tag
      defpara Tag
      defremovecdata Tag
      deftranspara Tag
      defwysiwyg Tag
      for Tag
      forin Tag
      forsep Tag
      if Tag
      elsif Tag
      else Tag
      include Tag
      includeonce Tag
      inherit Tag
      let Tag
      mail Tag
      return Tag
      shell Tag
      while Tag
      writefile Tag
      \ Tag
    heitml Functions
    Advanced Functions
    Database Access
    Global Variables
    Form Fields
    Server Variables
    Sessions
    heitml Syntax
  Component Ref.
  Class Library
  User Components
  Tutorial
  New Features
  heitml 1
User Guide
Services
Privacy
Datenschutz
 
Contact / Impressum