AMT Help Files

REDEFINES

Syntax

Command
Mandatory parameter
Optional parameter
Mandatory keyword
Optional keyword

<Target item> : <Type> REDEFINES <Source item>

Description

Using this option, two or more items can use the same piece of memory. An update in one of these items will also update automatically the value in the other item(s).

Diagram

Returned value type

None

Parameters

Parameter Description
<Target item> The name of the new item, that will use the same piece of memory as the <Source item>.
<Type> The type of the item.
REDEFINES Makes the space of the <Source item> available under the target item name.
<Source item> The name of the item to be called under the name of the <Target item>.

Remarks

With the REDEFINES option, you can refer to a local variable, retained variable, a file item or to a layout control. This option can only be written for the first definitions in the definition-section in a local definition, performed global routine or global routine dll. All items must have a fixed size, so the types STRING, REALSTRING and INTEGER are not supported. For retained variables, a redefine can only be done inside the RETAINED_VAR section. This means that it will not be possible to redefine such an item as a normal variable, file item, etc.

Examples


var
    ws-months
 : alpha 36 value 'JANFEBMRTAPRMAYJUNJULAUGSEPOCTNOVDEC'

    ws-mtable : structure redefines ws-months
      each-month : alpha 3 [12]
    end_structure

    // form-date is a numeric 8 form layout control
    sg-datum : structure redefines form-date
      sgn-year  : numeric 4
      sgn-month : numeric 2
      sgn-day   : numeric 2
    end_structure

 

Return to

Commands