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

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

Recommended Posts

Posted

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

Posted

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?

Posted

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?

Posted

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 ?

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