Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

This topic is 5822 days old. Please don't post here. Open a new topic instead.

Recommended Posts

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

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

Posted

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.

Posted

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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

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