November 17, 200421 yr Using the re-login step seems not to return the correct error messages. When I test the below script if I cancel the script it sets last error to 1 and the script works as expected, however if I type a non valid account name, without password the last error is set to 0. I would have expected an error 213, which would have looped back to the re-login till the max login attempts were reached or a successful login was completed. As I see it with error capture on relogin does not set the proper error number. Am I not understanding something here or is the another bug? Script Example: Adjust Window [ Hide ] Set Error Capture [ On ] Loop Re-Login [ ] If [ Get ( LastError ) = 1 or Get ( LastError ) = 214 ] Exit Application End If Exit Loop If [ Get ( LastError ) = 0 ] End Loop Set Error Capture [ Off ] Perform Script [ "Startup" ] Background: I want the application to log out the current user and perform the startup script upon sucessfull re login. If I do: Re-Login [ ] Perform Script [ "Startup" ] and the user cancels the login, the current user and associated priveleges are still active so it re-starts with the last users info. So they were not logged out. So thats when I tried the capture script. Bottom line I want to be able to log out the current user without quitting the application. Rod
November 17, 200421 yr Try this: Put up a custom dialog to mimic the login one, then pass the entered data to the relogin script. It could be that the relogin script only properly returns an error if credentials are supplied trough a script, not if the user types them in.
November 17, 200421 yr Author Wim, no luck, acts the same using re-login without the dialog, looks like there is a problem with relogin. Rod
November 17, 200421 yr Put the last error into a global right after the Re-Login, then use that global in tests for branching.
November 18, 200421 yr Author Ender, no good, same as my testing the last error with If it returns a 0 to last error, this must be a bug, can anyone confirm my findings or definitly say it works ok for them I'm on V3. Rod
November 18, 200421 yr It works fine for me, but only if I use the global: ... Re-Login [ ] Set Field [ gError ; Get ( LastError ) ] If [ gError = 1 or gError = 214 ] Exit Application End If Exit Loop If [ gError = 0 ] End Loop ...
November 18, 200421 yr A quick test on my end gives an error # 212 when I input a non-valid account and blank password. I think you may be generating your LastError = 0 from successful completion of the If statement, which would also be why Ender's use of a Global fixes it. -Terence
November 22, 200421 yr Author Ender, Murphy, sorry for late response, I was away. The trap with global was in fact working when I first tried it, I was checking the wrong field (in my haste to get this done). Thanks for confirming for me. Rod
Create an account or sign in to comment