Documentation
Getting Started
New Features
Component Guide
Programming
    Language Guide
    Language Ref.
       General Design
       Lexical Structure
       Expressions
       Objects
       Methods
       Classes
       heitml Tags
       heitml Functions
          ArAppend
          ArConcat
          ArSearch
          array
          asc
          caltime
          chr
          class
          clone
          contains
          ContainsCase
          copy
          copyfile
          crypt
          _dbcolumns
          _dbforeignkey
          _dbprimarykey
          _dbtables
          default
          deletefile
          directory
          findex
          flush
          fname
          gmtime
          htmlbool
          http_content_type
          http_empty_document
          http_expires
          http_header
          http_last_modified
          http_location
          http_set_cookie
          http_request_header
          index
          IndexCase
          integer
          isbool
          isdecl
          isempty
          isinteger
          isnull
          isstring
          istuple
          isreal
          left
          len
          localtime
          MD5
          mkdir
          mktime
          movefile
          offstotabcol
          random
          readFileLines
          _readini
          _readodbcdrv
          _readodbcdsn
          real
          resize
          right
          _serverdocroot
          _shelltemp
          srandom
          splitstring
          stat
          strftime
          subst
          substall
          substring
          tabcoltooffs
          tolower
          toupper
          trim
          trimleft
          trimright
          TuAppField
          TuAssField
          TuAssign
          TuSlice
          TuDelField
          TuFieldSort
          TuInsField
          TuMerge
          TuName
          TuProject
          _writeini
       Database Access
       Global Variables
       Form Fields
       Server Variables
       Sessions
       heitml Syntax
    Component Ref.
    Class Library
    User Components
    Tryout Form
    Tutorial
    heitml 1
User Guide
Registration
Frame
    

TuAppField, TuInsField, TuAssField

Format: TuAppField (object.field, value [, name])
Format: TuInsField (object.field, value [, name])
Format: TuAssField (object.field, value [, name])

Purpose: Inserts fields into objects or assigns values to object fields. The object.field parameter must denote an object field, which means that it must be an expression of the form t.name or t[expr] where t must be an object. The value parameter can be an object field or any value. The name parameter must be a string, if given.

The new/replaced object field gets the value specified by the value parameter. If the name parameter is given, then the new/replaced object field gets the field name denoted by name. If the name parameter is not given, but the value parameter specifies an object field, then the name of this field is taken. Otherwise the new/replaced object field gets no name. If the name specified leads to a name clash (i.e. there is already a field with the same name in the object), then the new/replaced object field also gets no name.

The function TuAppField() inserts a new object field into the object denoted by object. The field is inserted after the field given as the first parameter.

The function TuInsField() inserts a new object field into the object denoted by object. The field is inserted before the field given as the first parameter.

The function TuAssField() replaces the object field denoted by the first parameter within the object denoted by object.

Return Values: None of these functions return a useful value.

Example:

heitml input:
// Create a sorted list of names.

<let names=emptytuple;
ArAppend(names, "Claus");
TuAppField(names[0], "Markus", "markus");
TuInsField(names.markus, "Christian", "christian");
? names; ? "<br >" html;

// We found that Claus' name is Claus-Thomas
// and that ArAppend didn't create a field name.

TuAssField(names[0], "Claus-Thomas", "claus-thomas");
? names
>
resulting output:

([0]="Claus", christian="Christian", markus="Markus")
(claus-thomas="Claus-Thomas", christian="Christian", markus="Markus")

See Also: TuAssign(), TuDelField(), TuFieldSort(), TuMerge(), TuName(), TuProject(), TuSlice().


This page was dynamically generated by heitml
© 1996-2009 H.E.I. All Rights Reserved