First part is this function in Java
(anyone interested ? )
(anyone interested ? )
Quote:function doUserFunctionAssignment() {
' //IJ.log("doUserFunctionAssignment0: "+pgm.decodeToken(token, tokenAddress));
putTokenBack();
int savePC = pc; ' pc is program counter
getToken(); ' // the variable
getToken(); '// '='
getToken(); '// the function name
'example in BASIC way ... -> v = myfn()
bool simpleAssignment = isSimpleFunctionCall(true);
pc = savePC;
If (!simpleAssignment)
getAssignmentExpression();
Else {
getToken();
Variable v1 = lookupLocalVariable(tokenAddress);
If (v1==null)
v1 = push(tokenAddress, 0.0, null, this);
getToken();
If (token!='=')
error("'=' expected");
getToken(); // the function
Variable v2 = runUserFunction();
If (v2==null)
error("No return value");
If (done) Return;
int type = v2.getType();
If (type==Variable.VALUE)
v1.setValue(v2.getValue());
Else If (type==Variable.ARRAY) {
v1.setArray(v2.getArray());
v1.setArraySize(v2.getArraySize());
} Else
v1.setString(v2.getString());
}
}
micro(A)developer
http://basic4us.epizy.com/forum/index.php
http://basic4us.epizy.com/forum/index.php