Jump to content

scripting from one db to another and back again


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

Recommended Posts

  • Newbies

Here's the deal:

Database Main has a script (actually many) that will ask a user to input a date. This is accomplished by the script launching an external db's script that brings up a small visual calendar. The user then clicks on a date in the window, the click triggers a script that compiles the correct date based on his choice then pastes it to the clipboard (or sets a global variable in the main database, as in my case).

So far so good. The the script in the calendar database continues and hides its db.

Now the problem.

I can complete the loop by having the calendar script call an external script in the Main DB to continue.

That works, but what if I have multiple scripts in the main DB that need the calendar visual db to get dates? How does the one script in the calendar db (that returns the chosen date) know which script was the orriginal script to make the call?

In a single DB, you can have scripts that call other scripts and when the subscript is finished, the parent script will continue on the next line. It seems that when you call an external script, the parent script does not seem to want to wait untilt he external scripts are done before continuing... it just keeps right on going and going and going....

Any ideas????

[ November 17, 2001: Message edited by: ravedog ]

Link to comment
Share on other sites

A couple of things. First how control is passed from script to script. If you call an external script from a script in your main file AND return using another script in the external file, you do have two scripts running. To avoid this, make the initial "Perform Script (external)" the last step in your main file script. FM will always try to return to the next script step in the calling script. Unless there is a Pause in the external script, FM will continue back to the calling script. You can also use a Halt step in a script to stop execution of ALL script immediately. FM will only wait unitl the external script called is complete, not until scripts performed in calendar by clicking a button are complete (how does FM know that you INTEND to push a button?).

Your options on multiple use of scripts in the calendar file are to either create multiple scripts or create some way of keeping track of which script called the external script (set a global) and select from multiple return script based upon this status.

-bd

Link to comment
Share on other sites

I had the same issue with a popup calendar from another file and solved it as follows:

Field 'Sale Date' calls script 'Get Sale Date' which saves the field name 'Sale Date' in the field '_Which Button' and then calls External Script to popup calendar. After the calendar gets a date, it runs one script (for all my dates) 'Returns Calendar Date' in the calling file that has a bunch of IF ELSEIF tests that check what fieldname is stored in '_Which Button' and Setfields the date value.

It's not very elegant, but until FM gets off its butt and gives us a status function Status(CurrentButtonName), it's this or a calendar plugin. I have used a nice popup calendar from Productive Computing which eliminates all the scripting, but it's very expensive if you want a developer version.

Link to comment
Share on other sites

This topic is 7277 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
 Share

×
×
  • Create New...

Important Information

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