Function EN Version 2.00

@SetVarInVar

Misc System

Syntax

@SetVarInVar(VARDEST1;POSITION2;VARSOURCE2;POSITION4;LENGTH5;MODE6);

Description

Inserts into the variable VARDEST1 at position FN POSITION2 from the variable VARSOURCE2 starting at position FN POSITION4 FN LENGTH bytes and returns the result. With TEXT MODE6 the insertion mode can be specified in more detail.

MODE6:
"B"=Binary *
"I"=Insert
"O"=Overwrite *

* Default

NOTE:
Both position specifications start at 0 for the first byte in each case.
Furthermore, the change is performed in an intermediate buffer. As a result, with TEXT – especially in overwrite mode – a string terminator that is not copied along (one character after the last visible character) may unintentionally extend the new string with arbitrary data.

e.g.: @SetVarInVar("ABCD";2;"12345";2;3;"O");

better here: @SetVarInVar("ABCD";3;"1234";2;4;"O");

Example: @SetVarInVar(VARDEST1;POSITION2;VARSOURCE2;POSITION4;LENGTH5;MODE6);

VARDEST1:="Hallo Welt!";
POSITION2:=6;
VARSOURCE2:="schöne runde blaue";
POSITION4:=7;
LENGTH5:=5;
MODE6:="I";
Ret:=@SetVarInVar(VARDEST1;POSITION2;VARSOURCE2;POSITION4;LENGTH5;MODE6);

returns in Ret "Hallo runde Welt!"

VARDEST1:="Hallo Welt!";
POSITION2:=6;
VARSOURCE2:="Erde Planet";
POSITION4:=5;
LENGTH5:=6;
MODE6:="O";
Ret:=@SetVarInVar(VARDEST1;POSITION2;VARSOURCE2;POSITION4;LENGTH5;MODE6);

returns in Ret "Hallo Planet"

Note : This text was machine-translated and may contain inaccuracies.