TEXTVAR

Concept Link IconSee also Concept Link IconExample

Manipulate strings of characters in text variables.

WebVue support - Yes.

Mode

Mnemonic

Syntax

1 BUFTOTEXT 1
2 TEXTTOBUF 1
3 FILETOTEXT 2
4 TEXTTOFILE 3
5 TEXTCOMPARE 4
6 TEXTCOPY 5
7 TEXTLEN 6

Syntax 1

IntVal = TEXTVAR(Mode, Text, Hbuf, Text_Offset, Hbuf_Offset, Size);

Return type: INTEGER.

Argument

Meaning

Text

The name of a text variable. Type STR.

Hbuf, Text_Offset, Hbuf_Offset,

See below.

Size

The number of characters to copy, or 0 for all characters.

Execution

Mode

Mnemonic

Action

1

BUFTOTEXT

Copy the number of characters specified by Size from the buffer specified by its handle Hbuf starting at the offset Hbuf_Offset to the text variable Text, shifted by Text_Offset.

2

TEXTTOBUF

Copy the number of characters specified by Size from the text variable Text starting at the offset Text_Offset to the buffer specified by its handle Hbuf shifted by Hbuf_Offset.

 

 

Return: The number of characters copied by the command.

Syntax 2

IntVal = TEXTVAR(Mode, Text, Filename, Text_Offset, File_Offset, Size);

Return type: INTEGER.

Argument

Meaning

Text

The name of a text variable. Type STR.

Filename

The name of the source file.

If executed in a WebVue session context this instruction is processed by the computer that hosts the web back end and the file must exist on that computer.

Text_Offset, File_Offset, Size

See below.

Execution

Mode

Mnemonic

Action

3

FILETOTEXT

Copy Size characters from the file Filename starting at the offset File_Offset to the text variable Text starting at the offset Text_Offset.

Return: The number of characters copied by the command.

Syntax 3

IntVal = TEXTVAR(Mode, Text, Filename, Text_Offset, FileMode, Size);

Return type: INTEGER.

Argument

Meaning

Text

The name of a text variable. Type STR.

Filename

The name of the destination file. If executed in a WebVue session context this instruction is processed by the computer that hosts the web back end and the file is created on that computer.

Text_Offset, Size

See below.

FileMode

0 Characters are written starting at the beginning of the file and overwrite the existing contents.

1 The characters are appended to the end of the file.

Execution

Mode

Mnemonic

Action

4

TEXTTOFILE

Write the number of characters specified by Size from the variable Text, starting at the offset Text_Offset, to the file Filename.

Return: The number of characters written by the command.

Syntax 4

IntVal = TEXTVAR(Mode, Text1, Text2, size);

Return type: INTEGER.

Argument

Meaning

Text1

The name of a text variable. Type STR.

Text2

The name of another text variable. Type STR.

size

The length of the value of the text variables to compare. Type INTEGER.

Execution

Mode

Mnemonic

Action

5

TEXTCOMPARE

Compare the string values of the text variables Text1 and Text2 for the number of characters specified in Size.

If the size is invalid, the full strings will be compared.

 

 

Return:

Less than 0 if the extract of Text1 < the extract ofText2

0 if the extract of Text1= the extract of Text2

Greater than 0 if the extract of Text1 > the extract of Text2

Syntax 5

IntVal = TEXTVAR(Mode, Text1, Text2);

Return type: INTEGER.

Argument

Meaning

Text1

The name of a text variable. Type STR.

Text2

The name of another text variable. Type STR.

Execution

Mode

Mnemonic

Action

6

TEXTCOPY

Copy the variable Text2 to Text1.

Return: 1 if OK, else 0.

Syntax 6

IntVal = TEXTVAR(Mode, Text);

Return type: INTEGER.

Argument

Meaning

Text

The name of a text variable. Type STR.

Execution

Mode

Mnemonic

Action

7

TEXTLEN

Determine the length of the text variable.

Return: The length in characters of the string Text.

Example

This shows how you can pass a variable to a working integer variable, and then use the working variable as an argument.

Dim iSize As Integer;

iSize =toi(@SIZE);

iReturn = Textvar("TEXTCOMPARE","@TEXT1","@TEXT2", iSize );

For further examples, select the Example link above.