Re: $10,000 Question ~ "The foo variable"
Understood.....
Let me rephrase my question: In Alpha, when using the FOR EACH to cycle through a collection, any variable name could conceivably work as the placeholder. In the v9 help file example, (after reviewing the FOR EACH operator)..... I noticed that Alpha ironically just happened to chose the variable foo in their example!
My point (or question actually) was, they could have just as well used the variable foobar or widget in this example, (even though it's a bad idea) right?
Consequently, I could conceivably construct X-basic code as follows to extract field names from a table:
(using any good name for the placeholder)
Originally posted by csda1
View Post
Let me rephrase my question: In Alpha, when using the FOR EACH to cycle through a collection, any variable name could conceivably work as the placeholder. In the v9 help file example, (after reviewing the FOR EACH operator)..... I noticed that Alpha ironically just happened to chose the variable foo in their example!
My point (or question actually) was, they could have just as well used the variable foobar or widget in this example, (even though it's a bad idea) right?
Code:
[INDENT][COLOR="#0000CD"] for each foo in list if foo = "c" continue end if ui_msg_box("", foo.value) next[/COLOR][/INDENT]
(using any good name for the placeholder)
Code:
'***LOOP THROUGH TABLE FIELDS AND OUTPUT NAMES IN STRING [COLOR="#0000CD"][COLOR="#696969"]FieldName as P[/COLOR] vp_Table as P vc_AllFieldNames as C vp_Table=Table.current() 'vp_TableName.fetch_first() FOR EACH [COLOR="#696969"]FieldName[/COLOR] in vp_Table vc_AllFieldNames = vc_AllFieldNames + chr(32) + this.Field_Name_Get() NEXT showvar(alltrim(vc_AllFieldnames)) 'NOTE: vp_FieldName is [B]possibly dimmed incorrectly[/B], but regardless I could have technically used any variable ' name in it's place, providing it's not used elsewhere / violates scope[B]?????[/B][/COLOR]
Comment