It is now possible to assign a read and write function to variables. Everytime a variable value is read, PPL can call a user-defined function to validate the value and can also do the same when writing a value to a variable.
Here is a little demo demonstrating this cool new feature:
Here is a little demo demonstrating this cool new feature:
- Code:
// Read write demo written by Alain Deschenes (c) ArianeSoft 2004
// You can do the same thing with object variables too!
func getm (Sender$, Value$, Address$)
return(Value$+1);
end;
func setm (Sender$, Value$, Address$)
if (Value$ > 1000)
Value$ = 1000;
end;
return (Value$);
end;
proc main
ReadWrite(m$, &getm;, &setm;);
m$ = 2000;
ShowMessage(m$); // Display 1001
end;