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

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

×
×
  • Create New...

Important Information

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