Current Help System: Tutor Translator (View Core Help)

### FOUND Functions

The intrinsic function FOUND is not available on PC-DMIS.

The following translations are logical functions:

FOUND(F0,”GOOFY”) translates to è

ASSIGN/SEARCH_STR = "GOOFY"
ASSIGN/SIZE_F0 = LEN(SEARCH_STR)
ASSIGN/FOUND_F0 = 0

DO/
FILE/SAVE_POSITION,E.F0.PTR

STS_F0 =FILE/READLINE,E.F0.PTR,{LINE_F0}

IF/STS_F0<>"EOF"
ASSIGN/FOUND_F0 = INDEX(LINE_F0,SEARCH_STR)

IF/FOUND_F0 > 0
FILE/RECALL_POSITION,E.F0.PTR

LINE_F0 =FILE/READ_BLOCK,E.F0.PTR,FOUND_F0+SIZE_F0-1

END_IF/
END_IF/
UNTIL/(STS_F0=="EOF") OR (FOUND_F0 <> 0)

IF FOUND(F0,”GOOFY”) THEN
. . . .
. . . .
END_IF translates to è

…….Same as FOUND(F0,”GOOFY”) function plus the following lines are added:

IF/FOUND_F0 <> 0
. . . .
. . . .
END_IF/

BOOL_VAR = FOUND(F0,”GOOFY”) translates to è

…….Same as FOUND(F0,”GOOFY”) function plus the following line is added:

ASSIGN/BOOL_VAR=FOUND_E.F0

FOUND(F0,STR_VAL) translates to è

ASSIGN/SEARCH_STR = STR_VAL
ASSIGN/SIZE_F0 = LEN(SEARCH_STR)
ASSIGN/FOUND_F0 = 0

DO/
FILE/SAVE_POSITION,E.F0.PTR

STS_F0 =FILE/READLINE,E.F0.PTR,{LINE_F0}

IF/STS_F0<>"EOF"
ASSIGN/FOUND_F0 = INDEX(LINE_F0,SEARCH_STR)

IF/FOUND_F0 > 0
FILE/RECALL_POSITION,E.F0.PTR

LINE_F0 =FILE/READ_BLOCK,E.F0.PTR,FOUND_F0+SIZE_F0-1

END_IF/
END_IF/
UNTIL/(STS_F0=="EOF") OR (FOUND_F0 <> 0)

IF FOUND(F0,STR_VAR) THEN
. . . .
. . . .
END_IF translates to è

…….Same as FOUND(F0,STR_VAL) function plus the following lines are added:

IF/FOUND_F0 <> 0
. . . .
. . . .
END_IF/

BOOL_VAR = FOUND(F0,STR_VAL) translates to è

…….Same as FOUND(F0,STR_VAL) function plus the following line is added:

ASSIGN/BOOL_VAR=FOUND_E.F0

FOUND(F0,”GOOFY”:3) translates to è

ASSIGN/SEARCH_STR = "GOOFY”
ASSIGN/SIZE_F0 = 3
ASSIGN/FOUND_F0 = 0

DO/
FILE/SAVE_POSITION,E.F0.PTR

STS_F0 =FILE/READLINE,E.F0.PTR,{LINE_F0}

IF/STS_F0<>"EOF"
ASSIGN/FOUND_F0 = INDEX(LINE_F0,SEARCH_STR)

IF/FOUND_F0 > 0
FILE/RECALL_POSITION,E.F0.PTR

LINE_F0 =FILE/READ_BLOCK,E.F0.PTR,FOUND_F0+SIZE_ F0-1

END_IF/
END_IF/
UNTIL/(STS_ F0=="EOF") OR (FOUND_ F0 <> 0)

IF FOUND(F0,”GOOFY”:3) THEN
. . . .
. . . .
END_IF translates to è

…….Same as FOUND(F0,”GOOFY”:3) function plus the following lines are added:

IF/FOUND_F0 <> 0
. . . .
. . . .
END_IF/

BOOL_VAR = FOUND(F0,”GOOFY”) translates to è

…….Same as FOUND(F0,”GOOFY”:3) function plus the following line is added:

ASSIGN/BOOL_VAR=FOUND_E.F0

For file F1 use the SIZE_F1, FOUND_F1,STS_F1, LINE_F1 and E.F1PTR. If FOUND intrinsic function is used in an expression the FOUND_Fx variable is evaluated before expression translation (x value is 0,1, 2, or 3)