Jump to content

Entertaining a loop, The Final Free script lesson.


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

Recommended Posts

When the following changes, new format files and Web Security settings are made, you will be ready to see if a non-looping script will conflict with a looping script such that one does not run successfully. You will be performing your tests by using at least two browser windows. I prefer using NN. You can use whatever you want. NN seems to be sizeable to a size which is more compact than IE. Thus you can place the browser windows closer together so that the buttons are closer together. I would recommend that you run through both scripts from one browser window before you try challenging with a near-simultaneous call from two or more browser windows. After you have challenged the scripts with two browser windows, it is very easy to open and arrange 3 or 4 browser windows so you can simulate a really busy web site.

We are going to make no changes to default.htm. However, we are going to change home.htm.

Currently home.htm displays the number which is incremented from the looping script and a button. The following is for FMPro 5 to be added after the code already there.

<p>

[fmp-inlineaction: -db=long.fp5,-findall][fmp-record][fmp-field:no2][/fmp-record][/fmp-inlineaction]

<p>

<form action="fmpro" method="post">

<input type="hidden" name="-db" value="loop.fp5">

<input type="hidden" name="-script" value="runsub">

<input type="hidden" name="-format" value="blank1.htm">

<input type="hidden" name="-error" value="error.htm">

<input type="submit" name="-findall" value="Runsub">

</form>

For those using FMPro 4, place the following code on home.htm following the code which is already there.

<p>

[fmp-field:no2]

<p>

<form action="fmpro" method="post">

<input type="hidden" name="-db" value="loop.fp5">

<input type="hidden" name="-script" value="runsub">

<input type="hidden" name="-format" value="blank1.htm">

<input type="hidden" name="-error" value="error.htm">

<input type="submit" name="-findall" value="Runsub">

</form>

Create a new format file: blank1.htm (no spaces) Place the following code in the HEAD:

<meta http-equiv="refresh" content=0;url=fmpro?-db=loop.fp5&-format=success1.htm&-recid=[fmp-currentrecid]&-find">

</head>

Create a new format file: success1.htm. Place the following code (for FMPro 5) in the body:

<p>This is the success page for Runsub.</p>

<p>[fmp-inlineaction: -db=long.fp5,-findall][fmp-record][fmp-field:no2][/fmp-record][/fmp-inlineaction]

</p>

<p>

<form action="fmpro" method="post">

<input type="hidden" name="-db" value="loop.fp5">

<input type="hidden" name="-format" value="home.htm">

<input type="submit" name="-findall" value="Home">

</form></p>

OR, for FMPro 4 users, create a new format file: success1.htm. Place the following code (for FMPro 5) in the body:

<p>This is the success page for Runsub.</p>

<p>

[fmp-field: no2]

</p>

<p>

<form action="fmpro" method="post">

<input type="hidden" name="-db" value="loop.fp5">

<input type="hidden" name="-format" value="home.htm">

<input type="submit" name="-findall" value="Home">

</form></p>

Create a new record in Web Security .fp5 for long.fp5. Assign to all users browse and script privileges. Set Sharing.

Note to FMPro 4 users: Because you are not displaying any data from long.fp3 on your browser solution, it may be that you do not have to set Web Security.fp3. You should try running the script through your browser without setting Web Security for long.fp3. If there is a problem, you will be informed and can then set Web Security and Sharing.

Run each script through one browser to make sure everything is working correctly. Then open a second window. Resize both windows to their smallest. Click the Click button in the window showing default.htm. This begins the looping script which is now shortened. Then immediately double click the Runsub button. The first click activates that browser window and the second click activates the button. Notice the results. You may also want to examine the db files. You can next run the Runsub script first followed by the Click (looping script) button. You can also open a third and a fourth (if you are interested) browser window and run combinations of scripts against each other.

You will also probably notice a very interesting, though undesirable effect that the looping script seems to cause when you click the button Home.

Have fun with this part. If any of you do this and want to comment or have questions, please feel free to post here.

If you have been running scripts in your web solutions, this should make you re-think what you are doing. There is a workaround which works quite well, but it is not easy to achieve. If you have several weeks in which you are concentrating on nothing else, you can develop the workaround on your own. I speak from experience. As far as I know, I am the only person to have developed a workaround to the multi-request problems with a workaround which provides accurate information to the clients and no jammed db files / lost data from incompleted scripts.

Link to comment
Share on other sites

This topic is 8357 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.