December 16, 200817 yr I use a script to create a backup file for test purposes. It inserts the words Test Copy at the beginning of the file name for easy identification. For example: Test Copy Clients.fp7. A startup script runs when the file opens. It tests the FileName and sets a global for display purposes: Set Variable[$filename; Value:Get (FileName)] If [LeftWords($filename;2)=”Test Copy”] SetField[issues::gTestCopyAlert; “TEST COPY”] Else SetField[issues::gTestCopyAlert;””] End if If the words Test Copy appear in FileName, gTestCopyAlert displays the words TEST COPY on the layout. The problem is that when I create the test file and open it for the first time gTestCopyAlert is not being set. It remains empty. I must close the file and re-open it for gTestCopyAlert is set properly. It then displays properly on subsequent opens. In other words, I have to run the startup script twice before it works Edited December 16, 200817 yr by Guest
December 16, 200817 yr Just a wild guess here but is it possible that the storage of the global field isn't actually set to global?
December 16, 200817 yr I just built a small file and tried your script and it works as expected. My guess is that you have done what I often do myself and just made a simple mistake. Double check the simple stuff and I bet you find the problem there.
December 16, 200817 yr Author Just a clarification. I notice if I run the startup script a second time, the script works!!! :
Create an account or sign in to comment