EddyB Posted May 20, 2003 Posted May 20, 2003 Hi all, I doubt very much that the following is possible - but you never know, and if it is it would save me several hours of work so I would be very grateful! I am creating a database with thousands of fields, now these fields are have very repetitive descritions and each one is a calculation containing the same calculation with a couple of didgits changed. I will give an example: Field 1: Name: S1A1Mark This stands for Section 1 Answer 1 Mark Calculation: Case( S1A1 = "", "", S1A1 = S1CA1, "1", "0") If Section 1 Answer 1 is blank then the score is blank If Section 1 Answer 1 = Section 1 Correct Answer 1 then the score is 1 Else the score is 0 Field 2: Name: S1A2Mark This stands for Section 1 Answer 2 Mark Calculation: Case( S1A2 = "", "", S1A2 = S1CA2, "1", "0") If Section 1 Answer 2 is blank then the score is blank If Section 1 Answer 2 = Section 1 Correct Answer 2 then the score is 1 Else the score is 0 Get it? OK, I have 18 sections each with 30 questions So just for the mark fields I need 540 Calculation Fields Going from S1A1Mark up to S18A30Mark Section 1 Answer 1 Mark to Section 18 Answer 30 Mark This is just 1 part of it to get the mark I have loads of other fields to do. Now to the question - is it possible to write a script which will create these kind of fields for me. It is very very tedious having to do these calculations over and over and I'm running out of time for production of my database! Please please tell me this is possible! Many thanks Edwin
EddyB Posted May 20, 2003 Author Posted May 20, 2003 I am almost definite that this is not possible now If I create a script which opens menu item "Define Fields" the script pauses until I click done on the define fields window, so it looks like the define fields window is not scriptable. Ed.
Ugo DI LUCA Posted May 21, 2003 Posted May 21, 2003 Hi Eddy, AFAIK No, Well what you could do is script several Set Field (text fields, calculation syntax) and field name involving globals, and multiple substitute and go to field script steps. Though you still need to create your 540 field first (naming 1 to 540) then using a manual cut and paste, 1. cut the content of the field 2. Turn the text field to calc field 3. Paste into it the result from the Set Field 4. Cut from the Set Field the "field Name" 5. Close the calc window 6. Select the field name and paste the new field na
EddyB Posted May 21, 2003 Author Posted May 21, 2003 Hi Ugo, Thanks for your reply. I did not think it was possible but it was worth asking! Thanks for your idea, I will use that, it will speed the process up slightly and will stop any errors in my calculations - there has got to be one error entering that many calculations manually! Not meaning to start any arguments about PC's versus Macs, but this is one time where I wish I was still on a Mac, I could write a quickeys sequence along with scriptmaker to create all my fields! Thanks again Ed.
BobWeaver Posted May 21, 2003 Posted May 21, 2003 As soon as you say that you are creating 1000's of fields all the warning lights go on and the sirens sound. Are you sure you need to do this? Maybe you should be looking at creating a related file with all your field instances set up as multiple related records. You can then create an ID field in the related file to identify your records as S1A1, S1A2, etc., and then use a script or summary function to do whatever summarizing you need to do.
CobaltSky Posted May 21, 2003 Posted May 21, 2003 ...but this is one time where I wish I was still on a Mac, I could write a quickeys sequence... Notwithstanding Bob's advice, if you *really* need to do this, it might be time to download a copy of QuicKeys for Windows?!
cjaeger Posted May 21, 2003 Posted May 21, 2003 Well, why would you need to rename the fields? Create a database with 2000 fields named f1, g_f1_label, f2,g_f2_label ... then set the label value in global fields g_f*_label according to your calculation ... or simply use the fieldstuff plugin (win only). [google search fieldstuff plugin filemaker] But I'd rather think it over - a relational approach does make more sense to me ...
CobaltSky Posted May 21, 2003 Posted May 21, 2003 For what it is worth, here is the URL for QuicKeys for Windows: http://www.cesoft.com/products/qkwin.html You can download a demo version direct from that location.
cjaeger Posted May 21, 2003 Posted May 21, 2003 btw, creating a database with 1000s of fields is easy - simply open a text file with nothing but 1000 tabs in it as tab text in FM.
RodinBangkok Posted May 21, 2003 Posted May 21, 2003 I think Bob Weaver has it right, any time your talking about K's of fields, you should be taking a step back and looking at the structure and logic of your solution. Would highly suggest you do so.
EddyB Posted May 21, 2003 Author Posted May 21, 2003 Thanks everyone for your posts. Ray - I didn't know Quickeys exisited for Windows so thanks for that! I have been thinking a lot about it because I was worried too about the amount of fields and was sure there would be a way to reduce this using global fields etc The only problem I have is this - eventually - will be accessed over the Web, therefore have been trying to avoid the use of scripts. I thought about Global fields - the current section they were working on would use the global fields, then once it is complete and all calculations were done etc it would transfer the information into a related file, just as text fields for reference later on, the next section would then use the global fields and so on. Therefore would only need one set of calculation fields, and a file full of text fields. But I have been trying to think how I could do this without scripts (due to the Web issue) I even thought of running a script overnight which would transfer any completed sections to the reference file, but this would not work either. When a user finishes one section, they need to be able to move straight on to the next section, without having to wait for the next day. I've got to admit I'm stumped on this one! Don't know which route to take! Ed.
CobaltSky Posted May 21, 2003 Posted May 21, 2003 Ed, How about having each section as a separate record in a related file. Then have a global in the main file where the user selects the section (eg from a value list), which sets up the relationship to the next record - eg via a concatenating calc field that appends Section to UserID.
Ugo DI LUCA Posted May 21, 2003 Posted May 21, 2003 Well, keeping the relationship issue and Ray's advice of a concanated calculation, why not use a concanate Multikey calculation in order to reference a whole session or a group of sessions. For instance, Multikey = Session 1 Session 2 Session 3 Sesion 1 & Session 2 Session 2 & Session 3 Session 1 & Session 3 Session 1 & Session 2 & Session 3 where each session as its own field and Id. Of course, is section 2 desn't exist, the Session 2 will not appear in the calculation, so no relationship would be established... Just some thoughts.
EddyB Posted May 21, 2003 Author Posted May 21, 2003 Hi Ray, That's a very interesting idea. I'll have a think about this while I get my head round it and make another post later as I'm sure I'll have a few more questions about this! Many Thanks Ed
Recommended Posts
This topic is 7861 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 accountSign in
Already have an account? Sign in here.
Sign In Now