Edit

User2 File

This file (internal name User2) is, like the User file, available for scripts to store persistent user data. It has the advantage that it has a much longer key, dates and numbers can be stored (and hence searched) in native format, and data can be segmented by the use of the devkey field, reducing the likelihood of key clashes by different scripts and plug-ins.

FieldTypeSizeNotes
LastModifiedTimeSThe date and time that this record was last changed.
DevKeyNAn unsigned integer greater than #FFFF (65,535)--lower valued keys are reserved for plug-ins and must be pre-allocated by Cognito.
KeyT28A unique key to identify the record. Use this in conjunction with a (pre-allocated) DevKey to ensure your own storage
Int1NA signed integer
Int2NA signed integer
Float1NA floating point number
Float2NA floating point number
Date1DA date
Date2DA date
Text1T255Text
Text2T255Text
TextT1020Text
Int3NA signed integer
Int4NA signed integer
Float3NA floating point number
Float4NA floating point number
Date3DA date
Date4DA date
Text3T255Text
Text4T255Text
TaggedTextT255Storage for tagged text

Records can be inserted into the table by importing them, with the pseudo-map ":/User2" or as xml, or using the SetPersistent function. For the psuedo-map, the data is tab-delimited, with devkey and key being the first two fields and the subsequent fields listed in the order above. Apart from the two key fields, the other fields are optional, and any fields not present will be treated as empty and set to zero or equivalent. If the record exists, it is entirely rewritten, meaning you cannot update individual fields. If only the DevKey and the Key are present, and all other fields are missing, the existing record (if any) is deleted (if it doesn't exist it is created).