Hi there,
Reuben provided this get around which works ok for us. It has to run at the very start of the program before there is any user or screen interactions.
If the function returns true we use "ui.Interface.frontCall" to display a PDF document telling the user the license count had been exceeded and exit the menu system. This works for GAS as well as GDC.
#Name : license_exceeded()
#Description: function to check 4J's Licence count
#Parameters : -
#Returns : TRUE if no programs running else FALSE
FUNCTION license_exceeded()
DEFINE ch
base.ChannelDEFINE line STRING
DEFINE tok base.StringTokenizer
DEFINE in_use, limit INTEGER
LET ch = base.Channel.create()
CALL ch.openPipe("fglWrt -a info users", "rw")
WHILE TRUE
LET line = ch.readLine()
IF ch.isEof() THEN
EXIT WHILE
END IF
IF line.subString(1,5) = "Users" THEN
LET tok = base.StringTokenizer.createExt(line.subString(16, line.getLength()), "/","", TRUE)
LET in_use = tok.nextToken()
LET limit = tok.nextToken()
IF in_use >= limit THEN
RETURN TRUE
ELSE
RETURN FALSE
END IF
END IF
END WHILE
-- Shouldn't get there but in case we do
RETURN FALSE
END FUNCTION {license_exceeded}