that approach will break if you change the field name, assuming the 
field name is hardcoded.

depending on your needs you can do this (code written in email so...):

this code can be run as needed, at process startup (use process vars), 
or it can be run at database startup (use Interprocess vars)
$Field_Count:=get last field number(->[table])

array text($Field_Names;$field_Count)
array pointer($Field_ptr;$Field_Count)
array longint($Field_Number;$Field_Count)

  if (is field number valid($table_number;$i))
    $Field_Names{$i}:=field name($Table_number;$i)
  end if
end for

Then where you need to get the pointer
$loc:=find in array($Field_Names;$Field_name_to_lookup)
end if

On Thu, 17 May 2018 12:19:11 -0400, Alan Tilson via 4D_Tech wrote:
> ​Hello out there,
> Is it possible to extract a pointer to a field from the table number or
> pointer and the field name?
> I'm loading a field using EXECUTE FORMULA and building the
> [tablename]fieldname into the formula, which serves my purposes but seems
> rather awkward!
> Thanks,
> Alan ​
> **********************************************************************
> 4D Internet Users Group (4D iNUG)
> FAQ:
> Archive:
> Options:
> Unsub:
> **********************************************************************
Gas is for washing parts
Alcohol is for drinkin'
Nitromethane is for racing 
4D Internet Users Group (4D iNUG)

Reply via email to