StringLib.getNextToken returns a token from a substring.
eglx.lang
static function getNextToken (source string in,
index int inout,
delimiters string in)
returns (string?);
In the following code, source is 20 characters, or 40 bytes:
program MyProgram type BasicProgram{}
source string = "CALL PROG1 arg1,arg2";
delimiters string = ", ";
index int = 1;
max int;
tokens string[];
token string? = "";
function main()
max = source.length();
SysLib.writeStdout("max = " + max);
while(index < max)
token = StringLib.getNextToken(source, index, delimiters);
if(token != null)
SysLib.writeStdout(token + " <--- " + index);
end
end
end
end
max = 20 CALL <--- 5 PROG1 <--- 11 arg1 <--- 16 arg2 <--- 21
| Target | Issue |
|---|---|
| Java | No issues. |
| JavaScript | No issues. |