User guide
eWON 500-2001-4001-4002 User Guide - Programming the eWON
eWON 500®2001®4001®4002® Version 4_3_0 - User Guide - 10/5/05 - ©ACT'L sa - Page 146
9.2.36 INSTR
Syntax [Function]
INSTR I1,S1,S2
• I1 is the index in the string to search (valid value goes from 1 to LEN S1)
• S1 is the string to be search for S2
• S2 is the string to search for in S1
Purpose:
The function returns an integer equal to the position of string S2 in string S1.
The returned index is 0 based. If string S2 is not contained in S1, the function returns 0.
The I1 parameter should be 1 to search the whole S1 string. If I1 is >0 then string S1 is searched starting at offset I1.
The value returned is still referenced to the beginning of S1, example:
INSTR 1, "AAABBC","BB" = 4
and INSTR 3, "AAABBC","BB" = 4 also.
9.2.37 INT
Syntax [function]
INT F1
Purpose:
Extract the integer part of the number. There is no rounding operation.
Example 1:
Example 2:
9.2.38 IOMOD
Syntax [function]
IOMOD S1 / E1
• S1 is the name of the Tag (A = IOMOD "MyTag")
• E1 is the ID of the Tag (A = IOMOD 12 : rem if TagID =12)
Purpose:
Returns '1' if the S1 Tag has been modified in the eWON since the last call to the IOMOD command.
The call to this function resets Tag change internal flag to 0. i.e. if the variable doesn't change anymore, the next call to IOMOD will return 0.
You can achieve an equivalent behavior with the use of ONCHANGE instruction.
Example:
See also:
“ONCHANGE” on page 152
A = INT(10.95)
REM A equals 10.00
A% = 10.95
REM A equals 10 --- automatic type conversion
a% = IOMOD " MYTAG "
IF a% THEN PRINT " mytag has changed "