I have the following script

Go to Layout [ "ConvertUVMC" (ConvertUVMC) ]

Set Variable [ $$vcntr; Value:1 ]

Go to Record/Request/Page

[ First ]

Go to Field [ ConvertUVMC::HouseholdID ]

Loop

Set Variable [ $$vhhid; Value:ConvertUVMC::HouseholdID ]

Set Variable [ $$vfieldno; Value:$$vcntr ]

Set Variable [ $$vfieldname; Value:Get(ActiveFieldName) ]

Set Variable [ $$vfieldtype; Value:FieldType(Get(FileName);$$vfieldname) ]

If [ Left ($$vfieldname;4 ) _ "1990" or Left ($$vfieldname;4 ) _ "2009" ]

Set Variable [ $$vyear; Value:Left ($$vfieldname;4 ) ]

Set Variable [ $$vfieldnameremainder; Value:Middle ($$vfieldname;5 ;99 ) ]

Else

Set Variable [ $$vfieldnameremainder; Value:$$vfieldnname ]

End If

Perform Script [ "WriteMetaData" ]

Go to Layout [ "ConvertUVMC" (ConvertUVMC) ]

Set Variable [ $$vcntr; Value:$$vcntr + 1 ]

Exit Loop If [ $$vcntr > 600 ]

Go to Next Field

End Loop

 

The purpose is, possibly wishful thinking, to go thru the fm table (600 +
fields) and extract certain fields, by number based on the table created
here, to another table.

I am actually trying to build a relational database out of a monolithic FM
table.

 

Go To NextField does not work: I am getting the same field over and over.

Can somebody tell me why?

 

(I know I need to do work on the FieldType statement: just haven't gotten
there yet.)

 

WriteMetaData

Go to Layout [ "FieldExtracted" (FieldExtracted) ]

New Record/Request

Set Field [ FieldExtracted::HHID; $$vhhid ]

Set Field [ FieldExtracted::FieldNo; $$vcntr ]

Set Field [ FieldExtracted::FieldName; $$vfieldname ]

Set Field [ FieldExtracted::NoRepeats; $$vnorepeats ]

Set Field [ FieldExtracted::FieldYear; $$vyear ]

Set Field [ FieldExtracted::FieldNameRemainder; $$vfieldnameremainder ]

Set Field [ FieldExtracted::FieldType; $$vfieldtype ]

 

Thanks!

Ron Carr

Reply via email to