Topic complex |
Table functions |
Function |
readmemo() |
Short |
Reads memos from a text file |
Syntax |
READMEMO(DB : INTEGER; Feld; Textdatei : STRING [; Mode : INTEGER [; Charset : INTEGER]]) : INTEGER |
Parameter |
DB : table handle from OPENDB
Field: field number or field identifier (as string)
Textfile : path of the text file
Mode : 0 text file is added to the memo (default)
1 text file replaces an existing memo
CharSet : 0 ANSI (default)
1 ASCII
|
Return |
0 : operation successfully
else error code |
See also: |
|
Description |
The text file that is to read can be an internal (Ramtext) or an external text.
Important: ReadMemo() only can be used with existing records, so the record pointer has to be a value > 0.
Executing ReadMemo() at first the text file is stored into the memo file. Then the reference (to the memo file) is transfered to the according data field and at least the record is rewritten to the table.
This transaction should never be used without file locking.
If you want to fill a memo field of a new record, it has to be written to the table before(!) calling ReadMemo()
Information: The content of the form's input field (HTML textarea) which name starts with "text:...", is made available as ramtext file with the name "ramtext:text:...". The charakter set of this ramtext is ASCII.
|
Example 1: ReadMemo
Create a new record and fill its memo field with cgi input
ReadRec(DB,0) // prepare new record
SetField(DB,'Name',CGIGetParam('Name'))
.. // fill other fields
WriteRec(DB,FileSize(DB)+1) // write record to table
ReadMemo(DB,'Notes','ramtext:text:notes',1,1) // read in memo
|
Fehler in der Hilfe |
User: Lars Hübner | Date: 03.11.2004 12:48 | #7 |
Der Befehl ReadMemo(DB,'ramtext:text:Bemerkung',1,1) stimmt nicht, wenn man diese komaplieren will, bekommt bekommt man einen Fehler.
Hier fehlt der Parameter Feld.
Richtig:
ReadMemo(DB,Feld,'ramtext:text:Bemerkung',1,1) |
Stimmt! |
User: Thomas Friebel | Date: 04.11.2004 10:22 | #8 |
Habe den Fehler (im Beispiel) behoben.
Vielen Dank |
Write a comment:
|