The following works on jBASE 4.x.
Note that the routine takes about 3 seconds to complete.

Lucian

SUBROUTINE LICENSE.INFO(A,B)
* A : Licenses
* B : Number of users

EQU CR  TO CHAR(13)     ;* Carriage Return
EQU LF  TO CHAR(10)     ;* Line Feed
EQU TAB TO CHAR(9)      ;* Tab

  A = 0
  B = 0
  DATA 'view','exit'
  EXECUTE @IM:'k jLicServer console' CAPTURING ZZZ
  ZZZ = UPCASE(ZZZ)
  NRI = DCOUNT(ZZZ,@FM)
  FOR I = 1 TO NRI
    LINE = ZZZ<I>
    CONVERT TAB:LF:CR TO '   ' IN LINE
    LINE = TRIM(LINE)
    CONVERT ' ' TO @FM IN LINE
    IF LINE<1> = 'USERS' THEN B += 1
    K = DCOUNT(LINE,@FM)
    IF LINE<K-2> = 'USERS' AND LINE<K> MATCHES '1N0N' THEN A = LINE<K>
  NEXT I
  RETURN
END

--~--~---------~--~----~------------~-------~--~----~
Please read the posting guidelines at: 
http://groups.google.com/group/jBASE/web/Posting%20Guidelines

IMPORTANT: Type T24: at the start of the subject line for questions specific to 
Globus/T24

To post, send email to [email protected]
To unsubscribe, send email to [email protected]
For more options, visit this group at http://groups.google.com/group/jBASE?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to