File Format fields order

Das Goravani goravanis at gmail.com
Tue Sep 28 15:00:06 UTC 2021


One reason to have Schemas and File Classes in the same field order is this:

You select a row using SQL and it’s in a list defined by the schema names, and although they match your file class names they will NOT read into them in the CRB… so how to get your data from a Schema defined list into your file class fields>?

Simply redefine the list using the matching File Class and IF your fields are in identical order then they are placed in the right File Class fields right then with just the redefine command.  This is priceless. 

Also, but not requiring same order between Schema and FC:

I use matching File Classes against Schemas in another way.. I do all my work in File Fields, then when it’s time to save or retrieve a record, a row, I do that with SQL, so then the row is in a Schema defined row, and to get them to File fields one could redefine the row, but since there is a bug in Omnis if you have a really long complex row where redefining causes corruption, so I move data from the row to the MOFF fields via a quick repeat loop.. same for moving from File fields to SQL row.. just the other direction.. this doesn’t take much time, for this they don’t have to be in the same order since they are addressed by name individually as the repeat loop spins the data into or out of the SQL list

There is no way to easily reorder File Class fields once they are in place.. except the following comes to mind:

Create a temporary File Class that is a copy of the one you want to reorder.. then put an X in front of each field name, then use Find and Replace to find each field one at a time, and change them to the X field instead.. all your code and everything will be re routed to the X field.. then reorder your File Class.. then do Find and Replace again on each and put them back from X field to real field. Thus all your code will be back on the right fields. This is assuming you do NOT have DF1 data linked to the File Classes.. only code. 

That method is part manual and thus troublesome unless you have a low amount of Fields and file classes you need to reorder. 

You all probably know all this. I’m sorry.




More information about the omnisdev-en mailing list