March 27, 200421 yr Newbies Hey, I see Script steps that allow me to go to a layout or record by a number. But is there any way to reference a FIELD indirectly? Eg, to go to, copy from, paste into, or set a field without specifying a specific field-name, but rather specifying a global VARIABLE which POINTS to the desired field (by number or name), so that I could use a loop to change 40 fields without doing them 1 at a time. Thanks! Eliot Version: v5.x Platform: Mac OS 9
March 27, 200421 yr GetField() allows you to "indirectly" reference a field. If you named your fields in a pattern like "Field1", "Field2", you could construct a tight loop using GetField("Field" & NumToText(myCounter)). Of course, naming fields without meaningful names is a programming no-no...
March 27, 200421 yr Author Newbies Thanks Sam! I did get the GetField(field) function to work, but after your response, I was hoping to be able to write something like: Set Field ( GetField(CurCategory), RunningSum) ... but the Set Field ScriptStep seems to take only literal references (ie, a specific field name) for the first parameter. (I'm using FM5). So... 1) Is there a way to SET (or Paste, or whatever), as well as Get, with indirect reference? And 2) Can one use GetField and any indirect SetField to reference fields in RELATED records? Here are the work-arounds I am considering. Are there betters ways? Re 1: If there is no set function with indirect reference, perhaps the best thing is to create a layout and use "Go To Next Field" and then Paste into it. Re 2: If GetField doesn
Create an account or sign in to comment