MyLittleBase - The Real StandAlone Database - ANIROM Multimédia |
![]() HowTo API Download Register info@anirom.com |
MyLittleBase API Reference function AddField(field1: string): boolean; Adds a new field to the table. The new field's name is the string parameter field1. function AddRow: boolean; Adds a new record to the table (a row). Freeware Edition: returns TRUE only if the table rows are < to 500. Professional edition: returns allways TRUE. constructor Create; Initializes the object and the table. Must be used only for the object's creation. procedure Free; Frees the object. But the table (the file) is not destroyed if no use of SaveToFile. function GetData(field1:String): String; Returns the value for the field 'field1', of the current record (current row). function GetFloat(field1:String): Real; Returns the float value for the field 'field1', of the current record (current row). Use it only if you are sure this is a float field, otherwise major errors can occur. function GetInt(field1:String): Integer; Returns the integer value for the field 'field1', of the current record (current row). Use it only if you are sure this is an integer field, otherwise major errors can occur. function GetVersion: String; Returns the component's Version String for display purposes. function GetVersionNumber: Integer; Returns the component's Version Number for test purposes. for sample 100 means version 1.0 Freeware, 101 version 1.0 Professional. 110 will mean version 1.1 Freeware... function GoFirst: boolean; Moves the current cursor to the first record (row). Returns true if the table is not empty. function GoLast: boolean; Moves the current cursor to the last record (row). Returns true if the table is not empty. function GoNext: boolean; Moves the current cursor to the next record (row). Returns false if it is on the last record, true otherwise. function GoPrevious: boolean; Moves the current cursor to the previous record (row). Returns false if it is on the first record, true otherwise. procedure Init; Initializes the table, for example to set it to null before creating a new table. function LoadFromFile(tablename1: string): boolean; Loads a new table from a comma separated file created or not by MyLittleBase. function SaveToFile(tablename1: string): boolean; Saves or updates the table, to the file tablename1. function SeekData(field1, comparison1, value1:String): boolean; (Prof Ed. Only) This feature is not available in the freeware edition. It searches for a value 'value1' in the field 'field1', using the comparison string 'comparison1'. For sample SeekData('Name', '=', 'Kennedy'); will move the current cursor to the next record having Kennedy as Name. Be careful MyLittleBase is CASE SENSITIVE ! Using SeekData('Name', '=', 'Kennedy'); a second time without having used the Go functions, will find the next Kennedy in the database. function SeekNumber(field1, comparison1: String; value1:Real): boolean; (Prof Ed. Only) This feature is not available in the freeware edition. It searches for a Float or an Integer value 'value1' in the field 'field1', using the comparison string 'comparison1'. For sample SeekNumber('Price', '<', '3.95'); will move the current cursor to the next record having a price < to 3.95. Comparison strings are: '=', '<', '<=', '>', '>=', '<>' They are valid for string, float or integer matches. function SetValue(field1, value1: string): boolean; Sets a Value for the field 'field1' of the current record. Returns true if the value has been set. |