Haven't used this yet, but maybe this one will make more sense.

 Code:
Function IsSystem()
  if @userid=@wksta + "$" or @userid="System"
    $IsSystem=1
  endif
endfunction