Well i never used to count the no. of user login in my application. well but i have a idea i can share with u!
***Make a Empty or write any thing in TextFile for current user in Current Folder.
FUNCTION GetNumberofLoginedUser
Local lcLoginUsersFiles,lnLoginUsers,laFileData,gnPsFile
lnLoginUsers = 0
lcLoginUsersFiles = Fullpath(Curdir())+"*.PAS"
FOR i = 1 TO ADIR(laFileData,lcLoginUsersFiles )
gnPsFile = FOPEN(laFileData(i,1),12)
IF gnPsFile = -1
lnLoginUsers = lnLoginUsers +1
ENDIF
ENDFOR
RETURN lnLoginUsers
&&& In software when user enter username password check if user is already login. Means Code for your login form
LOCAL lLoginOk,lcUserName
lcUserName= 'abc'
lUserFile = ALLTRIM(lcUserName)+".PAS" &&& UserName is varible for Current login user
IF FILE(lUserFile)
ERASE '&lUserFile' &&& Erase old file if found any if the user crashed the software last time the file will be there
ELSE
strtofile(lcUserName,luserFile) && Make Fresh File is there is no file.
ENDIF
IF Not PEMSTATUS(_SCREEN,"LoginFileHandle",5)
_screen.AddProperty("LoginFileHandle", 0)
ENDIF
_SCREEN.LoginFileHandle = FOPEN(lcUserFile,12)
IF _screen.LoginFileHandle < 1
=MESSAGEBOX("User Already login",0+16,"Stop")
ELSE
****** You can enter in Software
ENDIF
*** Dont Forget to Close that file when u shutdown the software the syntax is
=FCLOSE(_SCREEN.LoginFileHandle)
lcUserName='abc'
lUserFile = ALLTRIM(lcUserName)+".PAS" &&& UserName is varible for Current login user
ERASE '&lUserFile' && Erase the File
That is just a idea of mine as i told before too i have not used such in my application any suggestion are welcome :)
Anil
My Blog