jim shelton Posted November 29, 2012 Posted November 29, 2012 In a script I have a variable that holds a calc that build a table::field. The field comes from User input. I need to try to show a list of the field contents as the fields are all repeating with 10 repetions. I will be using a loop to locate the field from the 280 repeating fields on the record. Help. Not my creation. thanks, Jim
comment Posted November 29, 2012 Posted November 29, 2012 Could you try and provide a better description? I couldn't understand neither what do you have nor what do you want to do with it.
jim shelton Posted November 29, 2012 Author Posted November 29, 2012 Sure, we are trying to verify is a booth is booked. The user already selects a booth from a value list of customer values which is nothing but a list of all booths (276) of them. When a booth is booked a transaction number is placed in the 5th repetition of a field with the booth's name (example:001) I would like for script to alert the User than the booth is booked. To do this is would have to find the booth field and see if 5th rep is empty or not. The booths are not records only fields. So each event (over 90) has 276 booth fields on it. Confusing to me. Hope this helps. Jim
comment Posted November 30, 2012 Posted November 30, 2012 Well, that's slightly more clear - and quite horrible, as I suppose you know. Are you sure you wouldn't rather rewrite the thing, using proper relational structure? Anyway, if the user has selected a booth name, and there is a field with that name, you can use the GetField() function to retrieve a value from that field. For example = GetRepetition ( GetField ( $boothName ) ; 5 ) will retrieve the value from the 5th repetition of the field whose name is held in the $boothName variable. Hopefully you do not have fields with invalid names such as 001, because then you are really in trouble.
jim shelton Posted November 30, 2012 Author Posted November 30, 2012 fields are named s001, s002, etc. Perhaps that is why I am getting specified field name cannot be found with GetRepetition ( GetField ( Market::s008 ) ; 5 )
comment Posted November 30, 2012 Posted November 30, 2012 I am getting specified field name cannot be found with GetRepetition ( GetField ( Market::s008 ) ; 5 ) There is a subtle, but crucial difference here. Your formula looks inside the field Market::s008, then tries to find a field named same as the contents of that field. You would get a different result with = GetRepetition ( GetField ( "Market::s008" ) ; 5 ) but that wouldn't meet your requirement of getting the field dynamically, I think. I mean, if you do know the field name in advance, you could do simply = Market::s008[5] and be done with it.
Recommended Posts
This topic is 4434 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