Current Help System: Tutor Translator (View Core Help)

### ENCODE Functions

The variables that are used as part of the ENCODE functions are defined as follows:

- INT_VAR is an Integer variable.

- IND is an integer variable.

- REAL_VAR is a real variable with format info (total and decimal digit)

- BOOL_VAR is a Boolean variable.

The translation of the ENCODE command never fails.

The logical function

ENCODE(STR_VAR,INT_VAR, IND) translates to è

ASSIGN/ENCODE_STR = STR(E.INT_VAR)
ASSIGN/ENCODE_LEN = LEN(ENCODE_STR)
ASSIGN/LENCODE_STR = LEFT(E.STR_VAR, E.IND-1)
ASSIGN/ E.IND = E.IND+ENCODE_LEN
ASSIGN/RENCODE_STR = MID(E.STR_VAR, E.IND-1)
ASSIGN/ E.STR_VAR = STR(LENCODE_STR)+ STR(ENCODE_STR) + STR(RENCODE_STR)
ASSIGN/ENCODE = 1

IF ENCODE(STR_VAR,INT_VAR, IND) THEN
. . . .
. . . .
END_IF translates to è

…….Same as ENCODE(STR_VAR, INT_VAR,IND) function plus the following lines are added:

IF/ENCODE == 1
. . . .
. . . .
END_IF/

BOOL_VAR = ENCODE(STR_VAR,INT_VAR,IND) translates to è

…….Same as ENCODE(STR_VAR, INT_VAR,IND) function plus the following line is added:

ASSIGN/ E.BOOL_VAR =ENCODE

ENCODE(STR_VAR,REAL_VAR:11:4,IND) translates to è

ASSIGN/ENCODE_STR = FORMAT("%11.4f", E.REAL_VAR)
ASSIGN/ENCODE_LEN = LEN(ENCODE_STR)
ASSIGN/LENCODE_STR = LEFT(E.STR_VAR, E.IND-1)
ASSIGN/ E.IND = E.IND+ENCODE_LEN
ASSIGN/RENCODE_STR = MID(E.STR_VAR, E.IND-1)
ASSIGN/ E.STR_VAR = LENCODE_STR + ENCODE_STR + RENCODE_STR
ASSIGN/ENCODE = 1

IF ENCODE(STR_VAR,REAL_VAR:11:4,IND) THEN
. . . .
. . . .
END_IF translates to è

…….Same as ENCODE(STR_VAR,REAL_VAR:11:4,IND) function plus the following lines are added:

IF/ENCODE == 1
. . . .
. . . .
END_IF/

BOOL_VAR= ENCODE(STR_VAR,REAL_VAR:11:4,IND) translates to è

…….Same as ENCODE(STR_VAR,REAL_VAR:11:4,IND) function plus the following line is added:

ASSIGN/ E.BOOL_VAR=ENCODE

The logical function

ENCODE(STR_VAR,BOOL_VAR,IND) translates to è

ASSIGN/ENCODE_STR = E.BOOLVAL(E.BOOL_VAR)
ASSIGN/ENCODE_LEN = LEN(ENCODE_STR)
ASSIGN/LENCODE_STR = LEFT(E.STR_VAR, E.IND-1)
ASSIGN/ E.IND = E.IND+ENCODE_LEN
ASSIGN/RENCODE_STR = MID(E.STR_VAR, E.IND -1)
ASSIGN/ E.STR_VAR = STR(LENCODE_STR)+ STR(ENCODE_STR)+ STR(RENCODE_STR)
ASSIGN/ENCODE = 1

IF ENCODE(STR_VAR,BOOL_VAR,IND) THEN
. . . .
. . . .
END_IF translates to è

…….Same as ENCODE(STR_VAR,BOOL_VAR,IND) function plus the following lines are added:

IF/ENCODE == 1
. . . .
. . . .
END_IF/

BOOL_VAR1=ENCODE(STR_VAR,BOOL_VAR,INDEX) translates to è

…….Same as ENCODE(STR_VAR,BOOL_VAR,IND) function plus the following line is added:

ASSIGN/ E.BOOL_VAR=ENCODE

The logical function

ENCODE(STR_VAR,INT_VAR) translates to è

ASSIGN/ENCODE_STR = STR(E.INT_VAR)
ASSIGN/ENCODE_LEN = LEN(ENCODE_STR)
ASSIGN/LENCODE_STR = LEFT(E.STR_VAR,0)
ASSIGN/RENCODE_STR = MID(E.STR_VAR,ENCODE_LEN)
ASSIGN/ E.STR_VAR = LENCODE_STR + ENCODE_STR + RENCODE_STR
ASSIGN/ENCODE = 1

IF ENCODE(STR_VAR,INT_VAR) THEN
. . . .
. . . .
END_IF translates to è

…….Same as ENCODE(STR_VAR,INT_VAR) function plus the following lines are added:

IF/ENCODE == 1
. . . .
. . . .
END_IF/

BOOLVAR=ENCODE(STR_VAR,INT_VAR) translates to è

…….Same as ENCODE(STR_VAR,INT_VAR) function plus the following line is added:

ASSIGN/ E.BOOL_VAR=ENCODE

The logical function

ENCODE(STR_VAR, REAL_VAR:11:4) translates to è

ASSIGN/ENCODE_STR = FORMAT("%11.4f", E.REAL_VAR)
ASSIGN/ENCODE_LEN = LEN(ENCODE_STR)
ASSIGN/LENCODE_STR = LEFT(E.STR_VAR,0)
ASSIGN/RENCODE_STR = MID(E.STR_VAR,ENCODE_LEN)
ASSIGN/ E.STR_VAR = LENCODE_STR + ENCODE_STR + RENCODE_STR
ASSIGN/ENCODE = 1

IF ENCODE(STR_VAR, REAL_VAR:11:4) THEN
. . . .
. . . .
END_IF translates to è

…….Same as ENCODE(STR_VAR,REAL_VAR:11:4) function plus the following lines are added:

IF/ENCODE == 1
. . . .
. . . .
END_IF/

BOOL_VAR=ENCODE(STR_VAR, REAL_VAR:11:4) translates to è

…….Same as ENCODE(STR_VAR,REAL_VAR:11:4) function plus the following line is added:

ASSIGN/ E.REAL_VAR=ENCODE

The logical function

ENCODE(STR_VAR, BOOL_VAR) translates to è

ASSIGN/ENCODE_STR = E.BOOLVAL(E.BOOL_VAR)
ASSIGN/ENCODE_LEN = LEN(ENCODE_STR)
ASSIGN/LENCODE_STR = LEFT(E.STR_VAR,0)
ASSIGN/RENCODE_STR = MID(E.STR_VAR,ENCODE_LEN)
ASSIGN/ E.STR_VAR = LENCODE_STR + ENCODE_STR + RENCODE_STR
ASSIGN/ENCODE = 1\

IF ENCODE(STR_VAR, BOOL_VAR) THEN
. . . .
. . . .
END_IF translates to è

…….Same as ENCODE(STR_VAR,BOOL_VAR) function plus the following lines are added:

IF/ENCODE == 1
. . . .
. . . .
END_IF/

ASSIGN/BOOL_VAR1=ENCODE(STR_VAR,BOOL_VAR) translates to è

…….Same as ENCODE(STR_VAR,BOOL_VAR) function plus the following line is added:

ASSIGN/ E.BOOL_VAR1=ENCODE