Check if in single-user mode

D.Cook

Member
Without a relevant session attribute I was struggling to find a way to detect if the session was in single-user mode.
Took me a while to realise a fairly simple solution so I though I'd share:

Code:
CAN-DO(DBPARAM(1), '-1')
 

TomBascom

Curmudgeon
That should be:
Code:
if lookup( "-1", dbparam(1)) > 0 then ...

Using CAN-DO() as a string comparison function perpetuates a bad practice from the dark days before Progress had proper string functions. CAN-DO() is a security oriented function which can behave in very unexpected ways when used to compare strings.
 
Top