budgy Posted May 4, 2004 Share Posted May 4, 2004 Can anyone help with a script to generate 10 new records. The records in 2 fields are to be a sequential increase in value by 1 from the previous record but the record in a third field is to be the same for all the new records. Thanks Link to comment Share on other sites More sharing options...
fishma Posted June 7, 2004 Share Posted June 7, 2004 SetField(g_n_counter, 10) SetField(g_n_field1, 1) SetField(g_n_field2, 1) SetField(g_t_field1, ""data you want"") Loop NewRecordRequest SetField(field1, g_n_field1) SetField(field2, g_n_field2) SetField(field3, g_t_field1) SetField(g_n_field1, g_n_field1 + 1) SetField(g_n_field2, g_n_field2 + 1) SetField(g_n_counter, g_n_counter - 1) ExitLoopIf(g_n_fcounter = 0) EndLoop My shorthand is as follows g_n_... = global number g_t_... = global text Link to comment Share on other sites More sharing options...
Adam Runtime Posted June 8, 2004 Share Posted June 8, 2004 Thanks!! Just what I was looking for aswell.... Link to comment Share on other sites More sharing options...
Adam Runtime Posted June 8, 2004 Share Posted June 8, 2004 But how do you get the (g_n_field...) to work??? There is no option in the menu. I assume this is generate new/numeric field. Thanks in advance. Adam. Link to comment Share on other sites More sharing options...
fishma Posted June 8, 2004 Share Posted June 8, 2004 'g_n_' just the naming convention I use. The field should be defined as a Global Number field under your field definitions. You may name the fields whatever suits you best. Link to comment Share on other sites More sharing options...
bAttitude Posted June 9, 2004 Share Posted June 9, 2004 beginner question say you want to use the values stored somewhere else to start off your script. How does one "get" the value of a field in another table, and put it into the global variable to start? Link to comment Share on other sites More sharing options...
fishma Posted June 9, 2004 Share Posted June 9, 2004 Set up a a constant relationship. In the two files you want to relate together, create a constant key,... define a field as a calculation, = 1, defined as a number. Create the relationship in the file you want to push the information from. In the table where you have the stored data, set the stored value into the related global field. You now have the data at your disposal. Note that there are several ways to get this info, but this should suffice your needs and shows one way to utilize a constant relationship. Link to comment Share on other sites More sharing options...
-Queue- Posted June 9, 2004 Share Posted June 9, 2004 In versions < 7, an invalid relationship (e.g. global to global) can work much faster than a constant to constant one, especially if there are hundreds or thousands of records in the related file, since the constant relationship has to get the ids of all related records first. In version 7, global fields are accessible without a relationship. You simply Set Field [table::global, table1::field] or Set Field [table::global, value]. Link to comment Share on other sites More sharing options...
Recommended Posts
This topic is 7115 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