MLP

From HEWIKI
Jump to: navigation, search

Contents

Modify List on Prototype

MLP <prototype identifier> <field specifier>; <edit type> [<arguments>]

Arguments

<prototype identifier> 
The ID# of the prototype which contains the list to be modified.
<field specifier> 
Field specification which identifies the list or lookup list to be modified.
<edit type> 
One of four modification commands described below.
<arguments> 
Depending on the edit type, an argument or two may be needed.

Description

This is a CLI command that modifies a field on a prototype which is a list. It gives more control over editing lists and lookup lists than the MP command.

Edit Types

To add a new element to the list or lookup list, use this edit type. The position should be a positive number if inserting into a list, or the lookup list's indexed by type for inserting into a lookup list. The value should match the value type of the list or lookup list.

This edit type removes a value from the list or lookup list. The position should be a number for lists, and the indexed by type for lookup lists.

This edit type only works on regular lists. It changes the length of the list to be the given size. If the list contains more elements than the new size, the end elements are truncated from the list. If the list is smaller than the new size, new elements are added, with the default value for the value type in the fields.

This edit type removes all entries from a list or lookup list.


Example

The following example creates:

It then modifies the prototype, adding elements to the list: first, second, and this is the third string

The MLP command is then used to add and remove elements to the list

: ccd mlnexample data
 
: cfd mlnexamplefield list of string
 
: cpfc mlnexample mlnprototype
 
: mcdaf mlnexample; mlnexamplefield
 
: mp mlnprototype; mlnexamplefield[1]="first"
 
: mp mlnprototype; mlnexamplefield[2]="second"
 
: mp mlnprototype; mlnexamplefield[3]="this is the third string"
 
: mlp mlnprototype mlnexamplefield; insert 2 "inserted string"
 
: mlp mlnprototype mlnexamplefield; remove 4
 
: mlp mlnprototype mlnexamplefield; size 10
 
: mlp mlnprototype mlnexamplefield; clear
Personal tools
Namespaces
Variants
Actions
Navigation
Toolbox