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

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

Recommended Posts

Posted

I have several tables tied to one database and for each of these table I have maintenance screens which contain function buttons (New button, Delete button, ect.). Is it better to create scripts that perform each function (new, delete, ect.) for all the tables in the database or is it better to have one script that performs all functions for a given table? This is probably a matter of opinion, but is there a programming standard that is used in the FMP world?

Posted

I have created a database with different layouts for each table, but the header section of each layout is the same. Each button (New, Delete, etc.) uses the New Record function. Since the New Record is only created for the table currently being viewed, I don't have to write a script for each table.

I will suggest that you double-check your relationships with such a setup, as you may not want to delete related records from a different table when you delete a record from the current table.

Posted (edited)

Is it better to create scripts that perform each function (new, delete, ect.) for all the tables in the database or is it better to have one script that performs all functions for a given table?

Are you asking whether it's best to write your script(s) in an abstract manner and then have script parameters passed to the script via the buttons to determine what the script does?

Edited by Guest
Posted

Yes, is it better to have all the functions listed in one large script and use script parameters to call a section that applies or is it better that a button just call a script that performs the task.

I guess I could have the separate scripts for each button and then call them by using a script parameter in a type of universal script too.

I just don't know. I'm pretty new to FMP and am just trying to figure out what the best way is to get the job done.

Posted

well it really would depend on what scripts.

In your case, I personally would have have seperate scripts for delete, new, etc, instead of one script that has all those functions in it.

However, in the case of having buttons for going to the first, previous, next, and last record, I would use one script with the passing of parameters to go to different parts of the one general script. I tend to use one general script for common things as well as stuff that is repetitive. But again this is my personal preference. It can be different for others. Does this make sense?

In the end its personal preference and vision for each case.

HTH.

Posted

Thanks John.

I think you're right. Being new to scripting and FMP it's probably less confusing separating it out then to keep track of where I am in one large script.

What does HTH stand for?

Posted

This reminds me of some Director Lingo Scripting a few years back . . .

We had a developer who’s scripts changed the sprites on the one screen and it looks very complicated, because it was. If we needed him to make a small change, it took him hours to find the code to change, and then something else un-related would be broken.

New developers came in, built the same file as separate screens for separate sections, and small changes took place quickly, and nothing un-related ended up broken.

Here's another acronym, KISS - Keep it Simple (Stupid) or Keep It Short & Simple or even Keep It Simple and Straightforward.

It’s not calling anyone stupid, have a look at http://en.wikipedia.org/wiki/KISS_Principle

Posted

Thanks John and Mav.

Mav that's exactly what I thought of that made me decide to just create a script for each function(button) I need to use and then calling those using script parameters in one script. Sort of a centralized place to run from, yet separate scripts for easy modification.

Thank you all for your help.

Sarah

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