What command to extract field position if field name is known? (AREV Specific)
At 23 APR 2004 02:55:03PM Jim Dierking wrote:
As I understand it the WRITEV command requires the field number.
I am obtaining the field name by using the CALCULATE function.
After obtaining the field name using CALCULATE, is there a command that returns the field position number?
TIA,
Jim Dierking
At 23 APR 2004 02:58PM Matt Sorrell wrote:
Jim,
If you look in the %FIELDS% record of the dictionary for the table, there are several associated AMVs. One of these is the list of field names, the other is the list of FMCs. There is also one for the field data (data, symbolic, group). Once you have the field name, you can do a locate from the field in the %FIELDS% record and then extract the FMC from the other field.
I don't remember the specific layout off the top of my head, but can look it up if necessary.
msorrel@greyhound.com
At 23 APR 2004 03:10PM Jim Dierking wrote:
I edited the %field% and see what you are saying. Can you give me an example of the code you would use to extract the fieldnumber?
Thanks again, Jim
At 23 APR 2004 03:18PM Matt Sorrell wrote:
Jim,
Here you go.
Open "DICT","FILE" To DictFile Else Stop DictRec=" Read DictRec From DictFile, "%FIELDS%" Else DictRec=" Locate FieldName in DictRec Using @VM Setting FieldPos Then FieldType=DictRec *Check to see if it is a data or symbolic field If FieldType=F' Then FieldNo=DictRec End EndHope that helps.
msorrel@greyhound.com
At 23 APR 2004 04:58PM The Sprezzatura Group wrote:
or Xlate("DICT.FILE", "FIELDNAME", 2, "X")
![]()
The Sprezzatura Group
World Leaders in all things RevSoft
At 23 APR 2004 05:09PM Matt Sorrell wrote:
Oh, sure, do it the easy way, why doncha?
My way's more "fun", for some definition of fun :)
msorrel@greyhound.com
At 23 APR 2004 05:59PM The Sprezzatura Group wrote:
if you want to do more than one then your way IS of course quicker
![]()
The Sprezzatura Group
World Leaders in all things RevSoft
At 26 APR 2004 10:24AM Jim Dierking wrote:
Thanks for the help and of course the fun…