Jump to content

Entertaining a looping script, part 2.


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

Recommended Posts

For those newbies who are trying to figure out about html/cdml, you might try all of this as I make it really easy for you to create and explore an example of the use of these tags. You might learn quite a bit doing this. You will come to know at least one of the problems of Custom Publishing.

To those of you who have tried constructing and running the earlier example, I'm sure you have found it interesting so far. Today's postings will cover alterations to be made to loop.fp5 and a Save A Copy As... of loop.fp5. The alterations today will take about an hour to accomplish.

So you will have an idea of what this is to accomplish, you will be creating a bunch of fields and some scripts. You will also be creating a copy of the database between the creation of the fields and the creation of the scripts (less to delete that way, simplifies construction). Eventually we will visit the database copy which is made and alter it. The entire purpose is to create a script and subscripts which, when run, will take about one second to run. This makes it easy for you, the developer, to test in multiple browser windows.

New Fields: You will create 26 fields as calculations. The results are "text". The storage is Unstored. The fields' names are the alphabet and their calculated values are their respective names; thus, your define fields window will look something like:

a calculation Unstored, ="a"

b calculation Unstored, ="b"

c calculation Unstored, ="c"

...

z calculation Unstored, ="z".

If you are doing this in FMPro 4.0, please add a field no2, type/number. Not necessary in FMPro 5.0.

Now, before you do anything about scripts, go to File / Save A Copy As ... and save as long.fp5 (or fp3) and save it in the database folder you created earlier. I will try to post something about what to do with long.fp5 on Thurs. or Fri.

Before we construct any new scripts, go into the script "Runloop" and change the line to read: "Exit Loop If ["no0 >= 1000"]. This significantly shortens the run time - which is important to save you time.

New Scripts: You will create 26 new scripts (27 if you are using FMPro 4). Please understand that this approach is not done as good design. These scripts could be done much more efficiently. They are designed to run for about a second to make it easier on you, the developer, to perform the multi-call requests.

For FMPro 4.0 developers only, create a script "copyno2" which reads:

Go To Field ["no2"]

Copy [select, "no2"]

For all developers, create 26 scripts (these actually are subscripts). Notice that I do not put spaces in the names of the scripts. The machine is what reads these names. Make it convenient for the machine to do so. You will have 26 scripts which (including the script name) will look something like:

copya:

Go To Field ["a"]

Copy [select, "a"]

copyb:

Go To Field ["b"]

Copy [select, "b"]

...

copyz:

Go To Field ["z"]

Copy [select, "z"]

The next steps will follow soon. The next will be instructions on the database long.fp5 (or fp3). There are a couple of new format files and alterations to files which will come later.

I know this all takes time, but I'm making it as easy for you as I can. Not much of this comes easy. If it did, your boss would be the developer. And when you are done, you can save this example. You may find a time when you want to run a one second script for testing a development and you can use these files as copies slightly altered to incorporate temporarily into your development. Saves time later. Why reinvent every wheel?

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.