I'm trying to restructure a table via a script but I keep getting errors that don't allow me to restructure the table. Any help would be great. The code's attached here. Thanks1
-Alex
var
tc tcursor
tbl Table
tcFlds TCursor
dynNewStru DynArray[] Anytype
endvar
tbl.attach( ":ORDER:ORDER.DB" )
tbl.enumFieldStruct( ":ORDER:field_struct.db" )
tcFlds.open(":ORDER:field_struct.db" )
tcFlds.edit()
tcFlds.end()
tcFlds.insertAfterRecord()
tcFlds."Field Name" = "Data Entry Error" ;field name
tcFlds."Type" = "ALPHA" ;field type
tcFlds."Size" = 1
tcFlds."_Invariant Field Id" = restructureAdd
tcFlds.endEdit()
tcFlds.close()
dynNewStru["FIELDSTRUCT"] = ":ORDER:field_struct.db"
if tbl.restructure( dynNewStru ) then
msginfo("Success", "ORDER.DB update complete."
delete(":ORDER:field_struct.db"
else
msgstop("Error", "Son of a gun."
return
endif
-Alex
var
tc tcursor
tbl Table
tcFlds TCursor
dynNewStru DynArray[] Anytype
endvar
tbl.attach( ":ORDER:ORDER.DB" )
tbl.enumFieldStruct( ":ORDER:field_struct.db" )
tcFlds.open(":ORDER:field_struct.db" )
tcFlds.edit()
tcFlds.end()
tcFlds.insertAfterRecord()
tcFlds."Field Name" = "Data Entry Error" ;field name
tcFlds."Type" = "ALPHA" ;field type
tcFlds."Size" = 1
tcFlds."_Invariant Field Id" = restructureAdd
tcFlds.endEdit()
tcFlds.close()
dynNewStru["FIELDSTRUCT"] = ":ORDER:field_struct.db"
if tbl.restructure( dynNewStru ) then
msginfo("Success", "ORDER.DB update complete."
delete(":ORDER:field_struct.db"
else
msgstop("Error", "Son of a gun."
return
endif