Newbies Big Bubba Posted March 7, 2014 Newbies Posted March 7, 2014 Hi. I have 12 fields with the names Phone1, Phone2, Phone3, .... I have go through each and do some work on it. Obviously, I don't want to recreate the same procedure 12 times. I like to use the field by the count I'm on. Here's the start of the code: set variable [$PHCount; Value: 0 ] Loop set variable [$PHCount; Value: $PHCount + 1 ] ##### here I'd to set a variable to field Phone and whatever $PHCount is on ##### so if $PHcount is equal to 1 the variable is equal to Phone1 End Loop TIA. Boyd
doughemi Posted March 7, 2014 Posted March 7, 2014 The Phone fields should be separate records in a related table. That table should contain the fields ID (auto entered serial number), MainID, and Phone. It should be related to your main table by MainTable::<yourIDfield> = Phones::MainID. Your script would then be: Freeze Window Go to Related Records[show only related records; From table::Phones;Using layout:Phones] Go to Record[first] Loop #perform your operation Go to Record[next; Exit after last] End Loop
Newbies Big Bubba Posted March 7, 2014 Author Newbies Posted March 7, 2014 Doug: Thanks for the tip. Not exactly what I did, though. I decided using a repetition field made a lot more sense. Thanks. Boyd
doughemi Posted March 7, 2014 Posted March 7, 2014 I decided using a repetition field made a lot more sense. You may change your mind if a) you ever have to create a report based on those phone numbers ("how many are in Area Code 212?") or b ) you have a record with a 13th phone number.
Newbies Big Bubba Posted March 7, 2014 Author Newbies Posted March 7, 2014 Doug: Deinitely. But, this was a case of where I ws importing a flat file with multiple phone numbers. In fact, it was a labeled phone numbers, but had phones and emails in it. I just needed to massage the data and export it right out. Thanks. Boyd
bruceR Posted March 7, 2014 Posted March 7, 2014 And if they had been separate records then you would have just performed a simple find operation to separate the email records from the phone records.
Fitch Posted March 7, 2014 Posted March 7, 2014 ##### here I'd to set a variable to field Phone and whatever $PHCount is on ##### so if $PHcount is equal to 1 the variable is equal to Phone1 GetField ( "Phone" & $PHCount )
Recommended Posts
This topic is 3913 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