john9210 Posted December 16, 2008 Posted December 16, 2008 (edited) 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, 2008 by Guest
Ted S Posted December 16, 2008 Posted December 16, 2008 Just a wild guess here but is it possible that the storage of the global field isn't actually set to global?
Ted S Posted December 16, 2008 Posted December 16, 2008 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.
john9210 Posted December 16, 2008 Author Posted December 16, 2008 Just a clarification. I notice if I run the startup script a second time, the script works!!! :
Recommended Posts
This topic is 5822 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now