SET EXCLUSIVE OFF SET DELETED ON Select users.userno, users.username ; from "U:\Questpdm\Data\Users" ; ORDER BY users.username ; into array arrUsers if ( _Tally > 0 ) for ix = 1 to alen(arrUsers,1) If File("U:\QuestPDM\Profile\User"+ltrim(str(arrUsers[ix,1]))+"\insystem.dbf") lnFID = Fopen("U:\QuestPDM\Profile\User1\insystem.dbf", 12) If lnFID = -1 MessageBox("User "+trim(arrUsers[ix,2])+" is in system") Else Fclose(lnFID) MessageBox("User "+trim(arrUsers[ix,2])+" is not in system") ENDIF ENDIF ENDFOR endifI hope this help you!
>Name Number > >Paul 100 >Simon 120>In the profile directory you would see:
>U:\Profiles\User100 >U:\Profiles\User120>When a user logs into the system there is a file named insystem.dbf in the profile directory which is opened. Therefore what I would like to do is to scan the user table to grab the users. Then goto the equivalent PROFILE directory numbers and determine whether each of there insystem.dbf files are open. If they are open I would like to list the username in a list box. Here is my code to date. I cannot get this working for some reason I get a function, argument is invalid.
>SET EXCLUSIVE OFF >SET DELETED ON >Select users.userno, users.username ; > from "U:\Questpdm\Data\Users" ; > ORDER BY users.username ; > into array arrUsers >if ( _Tally > 0 ) >for ix = 1 to alen(arrUsers,1) > If File("U:\QuestPDM\Profile\User"+ltrim(str(arrUsers[ix,2]))+"\insystem.dbf") > lnFID = Fopen("U:\QuestPDM\Profile\User1\insystem.dbf", 12) > If lnFID = -1 > MessageBox("User "+trim(arrUsers[ix,1])+" is in system") > Else > Fclose(lnFID) > MessageBox("User "+trim(arrUsers[ix,1])+" is not in system") > ENDIF > ENDIF > ENDFOR >endif>Can anybody help me please?