At any given time, you can add a field with a certain name and type. Note that all fieldnames have to be unique (but comparing is case dependant, so "Name" is not the same as "name").
The possible value for the fieldtype are :
type code element size usage raw 1 1 byte graphics, fonts, ... char 2 1 byte text short 3 2 bytes small integer values selections, statusses, ... long 4 4 bytes large integer values dates, ... ieee 5 8 bytes ieee double any numerical value
Sbasic ADDfield #bufferid, name, type name : string type : short[2] Assembler ADDF bufferid string fieldname short fieldtype C long DDaddfield(long bufferid, char *fieldname, short type); *fieldname doesn't have to be at an even address errors, code, meaning itnf -7 invalid bufferid orng -4 fieldtype has to be in the 1-5 range inam -12 invalid fieldname (null name not accepted) fex -8 fieldname already exists drfl -11 too many fields already (max 256 fields)
This command can be used to clear a field in the current or in all records. A field is considered as cleared when it is not present in the record. An empty field is not considered as cleared, i.e. all non-existing fields are cleared, while a field is empty when it is in the record, but there is no data in it. If you try to read a value from an empty field, the engine gives an out of range error, but when you try to read from a cleared field, an not found error is returned. All fields in a record are cleared until somebody puts some data in it.
When you select all, and the requested field exists, then the record will be implemented first. It is impossible to know which record will be in the buffer after this command has finished. The given field will not be cleared in locked records (except the current record).
Sbasic fieldCLEAR #bufferid, field, all all : short (<>0 -> all, 0 -> current record only) Assembler FLDC bufferid field short all status C long DDfieldclear(long bufferid, short field, short all); errors, code, meaning itnf -7 invalid bufferid ... any error from IMPLement
This command can be used to remove a field from a file. It can only be called if the given buffer is the only buffer which has access to the file. You can't delete the memo field.
The record will be implemented first. It is impossible to know which record will be in the buffer after this command has finished.
Sbasic fieldDELETE #bufferid, field Assembler FLDD bufferid field C long DDfielddelete(long bufferid, short field); errors, code, meaning itnf -7 invalid bufferid fdiu -9 this is not the only buffer using this file ... any error from IMPLement
This command can be used to change the name of a field in the file. You can't rename the memo field.
Sbasic fieldRENAME #bufferid, field, newname Assembler FLDR bufferid field newname : string C long DDfieldrename(long bufferid, short field, char *newname); errors, code, meaning itnf -7 invalid bufferid ipar -15 field doesn't exist inam -12 invalid name (null name nor accepted) fex -8 fieldname already existsPROGS, Professional & Graphical Software