Jump to content
Sign in to follow this  
yafreax

Possible FAQ for someone to post about

Recommended Posts

Okay, i know this is a pretty simple question, (it has to be if i understand it!!!) but it seems to me that a lot of posters sometimes have problems with getting there scripts to end in the right database. Maybe one of you guys should right a FAQ about the different reasons it may be. . .

just a thought

yafreax

Share this post


Link to post
Share on other sites

I'll start thinking about it.

Yafreax, can you describe and example of the problem?

It sounds like it's a "running external scripts" problem.

Share this post


Link to post
Share on other sites

yeah, you haven't noticed all the people that ask why their scripts won't end in the right database?!?!?! I see it all the time, sometimes as just a side question off the main problem.

but yeah, basically when they're running external scripts they end up having the last script step in the wrong database.

The only reason i know is the that FM will end in the database that has the last performed script step in it. So the solution is to put a halt/exit/resume script step in whichever database you want to end in. But it gets a little more complicated if you want to do one thing then switch DB's then switch again, and again, etc.

This used to be a closed, read only forum, that's why i asked about one of you guys doing it and putting it in a seperate post. Plus you could probably explain it a little more clearly and go a little deeper than i can (if need be)

jeremy

Share this post


Link to post
Share on other sites

Very briefly, here is how I do it...

Suppose we're currently in dbA and want to end up in dbB. Create a script in dbB that (in this order) changes to the desired layout, then uses the "Refresh Window [bring to front]" script step.

In db A, create a script that (in this order) performs the dbB script externally, then uses the "Toggle Windows [Hide]" command.

The result is that the second database is opened and brought forward, and the first is hidden from view.

I also put in script steps to zoom, maximise and control the ststus bar, but these are optional.

Share this post


Link to post
Share on other sites

The way I handle external scripts is I use the "Exit Script" and "Halt Script" steps.

Remember that "Exit Script" just exits the current script that's running. If the script was called from another script, the original script continues to the next step. "Halt Script" stops ALL scripts that are running.

With that in mind, I use the "Exit Script" step in external scripts - unless at that point in the script I want to end up in that file, then I use "Halt Script". In the Main Script I always place a "Halt Script" at the very end of the script - that way the original file ends up being the active file.

I have also used an "OnTop" script that has just two steps: "Refresh Window - Bring to Front" and "Halt Script". Put this script in each file - then if you want to end up in that file, just call that external script in the file as the last script step.

Share this post


Link to post
Share on other sites

Assuming you want to wind up in the same database from which you triggered the script, put a Go to Field step as the last step, and leave the specify field blank.

------------------

Moon Mullins

Full Moon Consultants

Share this post


Link to post
Share on other sites

The problem with Halt Script steps is that there might be a need to have another script running "in the background" to peform some task -- halt will kill it.

I try to avoid (or at least minimise the use of) scripts that rely on Halt or copy/paste steps.

Share this post


Link to post
Share on other sites

I'm slightly partial to the "Go to field ()" step myself as it does nothing else except force a return to the calling script (with the possible good side effect of releasing the record!). -bd

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.