check if a variable is not initialized

  • I could not find information about how to check a variable is not initialized (invalid) in IF BLOCK in expert programming manual.


    Is there a way to do it in IF BLOCK something like that


    IF (X == NULL) THEN
    ; do something
    ENDIF

  • As Panic says, the VARSTATE system function will do this. The trick is that the variable name must be put into quote marks.


    There's another trick, for more recent KSS versions, that uses ON_ERROR_PROCEED. If your robot has the library MsgLib, you can look inside that for many working examples.

Advertising from our partners