Jump to content
Sign in to follow this  
john9210

startup script problem

Recommended Posts

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 by Guest

Share this post


Link to post
Share on other sites

Just a wild guess here but is it possible that the storage of the global field isn't actually set to global?

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

Just a clarification. I notice if I run the startup script a second time, the script works!!! :B :

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×

Important Information

By using this site, you agree to our Terms of Use.