MoneyWorks Manual
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.
Field | Type | Size | Notes |
---|---|---|---|
LastModifiedTime | S | The date and time that this record was last changed. | |
DevKey | N | An unsigned integer greater than #FFFF (65,535)--lower valued keys are reserved for plug-ins and must be pre-allocated by Cognito. | |
Key | T | 28 | A unique key to identify the record. Use this in conjunction with a (pre-allocated) DevKey to ensure your own storage |
Int1 | N | A signed integer | |
Int2 | N | A signed integer | |
Float1 | N | A floating point number | |
Float2 | N | A floating point number | |
Date1 | D | A date | |
Date2 | D | A date | |
Text1 | T | 255 | Text |
Text2 | T | 255 | Text |
Text | T | 1020 | Text |
Int3 | N | A signed integer | |
Int4 | N | A signed integer | |
Float3 | N | A floating point number | |
Float4 | N | A floating point number | |
Date3 | D | A date | |
Date4 | D | A date | |
Text3 | T | 255 | Text |
Text4 | T | 255 | Text |
TaggedText | T | 255 | Storage 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).