February 28, 200322 yr I've a script like this: Enter Find Mode[Restore,Pause] Set Field[ "USER"," "=="&USER " ] Set Field[ "Password"," "=="&Password " ] Perform Find[] Most of the times it works perfect: the user types his name/pass, for example: USER: steve jobs Password: 123 then the script changes the request for finding USER: ==steve jobs Password: ==123 If the users types exactly his name/pass then one record is found and the user is authenticated. BUT SOMETIMES.... the script, after finding one record, applies the two "Set Field" to the record in browse mode(instead of applying it only to the find request). Taking the example, sometime Steve Jobs logs in and his username and password are changed into USER: ==steve jobs Password: ==123 I was not able to isolate the problem, it happens with a ratio of approx. 1:15 It happens completely random! It seem a FM bug. The file is served with FM Server on MacOs9. It's opened with FM Pro 5.5 on MacOs9. Any help would be gratly appreciated! Thanks
February 28, 200322 yr You should change the log in script to something like Script Start log in Set error Capture [on] Allow User Abort [off] Go To layout [login layout] Set Field [gUser, ""] Set Field [gPassword,""] Freeze Window loop PauseResume Script [] // for ever end loop Script Login Set error Capture [on] Allow User Abort [off] Freeze Window If [ not (IsEmpty(gUser) or IsEmpty(gPassword))] Enter Find Mode [] // no restore no pause Set Field [uSER, "=="&gUser] Set Field [Password, "=="&gPassword] Perform Find [] If[status(CurrentFoundCount)=1) //OK, do whatever you need after end if else //user failed to log in,take appropriate steps //like re-calling script Start log in, for ex or close app end if the second script should be attached to the button with option Exit Current Script selected. And of course gUser and gPassword are global text fields Dj
March 3, 200322 yr Author I was trying to have my login procedure activated at the time the user types "Enter" (just like the real log-in interfaces) The only way to do that is entering find mode before the user types username and password. I haven't tried your script yet, but it's clear that the user types his credentials in the global fields in browse mode. Pressing enter causes a new line to be added in the field the user is typing in. A lot of users get messed up with it.
March 3, 200322 yr Many users consider the "Enter" and "Return" keys interchangeable -- and for the most part programs treat them so. However technically they are not interchangeable and FileMaker Pro is one application that handles them correctly. Return is on the main key group, while Enter is on the numeric keypad. The Enter key is the equivilent of clicking the mouse on the default button. I'll bet they are pressing Return.
March 4, 200322 yr Return inserts carriage returns if the user is in a field. The Enter key on the numeric keypad exits the field and clicks the default button.
Create an account or sign in to comment