December 13, 200223 yr Hi folks, The question is: How can I code for DYNAMIC movement to some field if something is true. Example: Say I have 5 global fields, in which I want to insert a value based on some criteria. There’s also a loop involved. The fields are G_1, G_2, G_3, G_4, G_5 Enter Browse Mode Sort [ Restore sort order ] Go to Record/Request/Page[ First ] Set Field [ FamilyCount, C_Family ] Loop If [A= 1 ] Set Field [ G_1, Yearof EarliestScreening ] End If Go to Record/Request/Page [ Next, Exit after last ] If [ A=1 ] Set Field [ G_2, Yearof EarliestScreening ] Else Set Field [ g_Difference, Abs(G_1 -Yearof EarliestScreening) ] End If Go to Record/Request/Page [ Next, Exit after last ] If [ FamilyCount <> C_Family ] Go to Field [ FamilyCount ] Set Field [ FamilyCount, C_Family ] Else If [ A=1 ] Set Field [ G_3, Yearof EarliestScreening ] End If Exit Loop If [ Status( CurrentModifierKeys)=1 ] Exit Loop If [ Status( CurrentRecordNumber) = Status( CurrentFoundCount) ] End Loop Do you see my point? I dont want to hardcode G_1, G_2, etc. If I could specify the field name as number, I could set the counter=G_1 + 1, but this is impossible here. Just wondering if anyone had this issue before. Thanks
December 13, 200223 yr If I get what you mean, use the GetField(field) function. You can use its like GetField("G_"& X)
December 17, 200223 yr Author falkaholic, Thanks for your reply. GetField("G_"& X) might work if I need to get the value from the G_X field, but I need to first set it to a certain value. I need something like SetField("G_"& X), but I can't seem to imbed the GetField in the set field function. Something like SetField(GetField("G_"& X), whatever)). Is that doable?
December 17, 200223 yr Much simpler way, maybe? Why not just put G1 through G5 in a related table, each record has two values - Key value (1 - 5) and whatever the value is. Then, you would just makea dynamic field that relates to that key value, then just change the related record value once you set the dynamic link. Make sense?
December 17, 200223 yr Author do you mean like G's is a global number with 2 repititions fields in auxilary file, and there's some X field in the main file that's incremented as in X+1 ?
Create an account or sign in to comment