November 25, 200619 yr I have just discovered that with FM 8.5, if you are running a script in a window and you click on a different FM window the script starts running in the other window. Can some one help me to solve this behaviour? Edited November 25, 200619 yr by Guest
November 27, 200619 yr Author Any script that lasts some time to finish. Imagine any loop stablishing a field in a table with 2000 records. If you have two windows open, if you are running the script in the first window and accidentally do a click in the second window, the script will start running in the second window. Freze window loop set field X go to next record end loop Refresh window.
December 12, 200619 yr Author Hi again, did someone find any reason for this behaviour?? or how to solve it??
December 12, 200619 yr Set Variable[ $window ; Get ( WindowName ) ] Freeze window loop set field X go to next record; exit after last If[ Get(WindowName) <> $window ] Select Window[ Name: $window ; CurrentFile] If[ Get(LastError) <> 0 ] Show Custom Dialog[ Error ; Window Closed ] Exit Script[Window closed]' End If End If End If end loop Refresh window.
December 13, 200619 yr Author Thaks for your answer Genks! That will help but wont ensure you do things in the proper window. You can have two windows with the same name and same fileds, so you wont get any error as far as know. This wont happen with FM 7 and you dont need to control that error. In my opinion this behaviour is useless and or badly implemented (¿a bug?) ¡How can cause an error just a user clicking in the wrong window?!! I am a little bit depressed with this issue as I wont be able to move my solution to fm8.5 until I add this error check to every process. Can someone show me any practical use for this behaviour or something to forbid the user to go to another window while a script is running?
December 13, 200619 yr Fortes: A bit tricky; FreezeWindow[] doesn't seem to work as well as it used to in the .fp5 days. Best bet would be to implement the kind of check Genx suggested, along with a strict policy of window naming - or even NOT window naming, as FileMaker will append a number when a duplicate window is opened, unless you've specified a name. You could also (when running a long loop like that) hide other windows and move to a layout showing a message like "Operation in Progress, Do Not Disturb" for the duration of the loop. Once the loop is done, you could return the hidden windows to the user. Other than that, I'm not sure what can be done. -Stanley
December 17, 200619 yr Author Thanks for your suggestions. I really appreciate your ideas. Anyway, it looks that this will cost me a lot of hours reviewing my code. This effort would be worthy just if I could see any benefit on this new behaviour. Is there any chance that this can be fixed in any new update???
Create an account or sign in to comment