Spécial ! |
Version mobile de l'aldweb Site m.aldweb.com Ni Français, ni Anglais ?Essayez donc l'un de ces drapeaux :
|
|
Météo / Spam / www |
Météo Lyon
aldweb contre le SPAM
|
|
|
|
|
|
|
- Forum - iziBasic
Warning: A non-numeric value encountered in /web5/aldweb/www/aldweb_com/www/thread.php on line 257
Sujet n° 1106 |
How to read a memo? |
le 16/02/2005 @ 15:00 par Montalvo
|
Hi all!
I need a quick example of how to read a specific memo from the MemoDB file. I think that this has to be using the megastring, but my two functional neurones can't figure how to do it. Any one can help?
Thanks in advance!
|
|
|
Warning: A non-numeric value encountered in /web5/aldweb/www/aldweb_com/www/thread.php on line 497
Réponse n° 1 -------- le 16/02/2005 @ 15:09 par Khertan
visiteur |
Look at the exemple of izibasic ... there are example on how to read a memo ...
it s just a MemoDB (or Memo-PDB on OS 5.4) that contain a x number of record ... and in this record it s just an string ...
it 's not difficult !
OPEN "MemoDB" FOR INPUT AS #1 REM For the 4th memo SEEK #1,4 INPUT$$ #1 CLOSE #1
it s basic ... now just read the documentation to use the megastring ... |
|
|
Warning: A non-numeric value encountered in /web5/aldweb/www/aldweb_com/www/thread.php on line 497
Réponse n° 2 -------- le 16/02/2005 @ 20:39 par Montalvo
visiteur |
Hi! Thanks for the example.
A few minutes later after posting the message, I remembered the SEEK command that I though that was only for RANDOM type files. But in the documentation I discovered that it works too for INPUT mode.
I try it, and it works as I want. Your example confirms that to me, too.
Thanks, again. |
|
|
Warning: A non-numeric value encountered in /web5/aldweb/www/aldweb_com/www/thread.php on line 497
Réponse n° 3 -------- le 04/11/2005 @ 04:05 par Angus
visiteur |
Hello, I am interested to know how I might manipulate a record in the MemoDB. For instance, if I want to change the text in a memo or ADD (or delete) text within that record. I see the examples on this website (and in the sample application) to READ a memo string, but what if I want to edit the string and write it back to the memo DB? Any tips to do that? Thanks. |
|
|
Warning: A non-numeric value encountered in /web5/aldweb/www/aldweb_com/www/thread.php on line 497
Réponse n° 4 -------- le 05/11/2005 @ 21:41 par aldweb
visiteur |
Hello Angus,
The best way to proceed is to read the memo record with the so called MegaString (up to 4 KB of characters, which is the size of a standard memo), not with a standard string variable (only 63 characters, this is fine to read the first line of a Memo like in the MemoTitles sample application). You may then change whatever you want in the MegaString. And, to write it back to the memo you want, just SEEK to the right index in the MemoDB and write back the MegaString there.
My advice: backup your MemoDB before proceeding as there are chances that you crash/corrupt it when trying your code!
Cheers,
@+ aldweb |
|
|
Warning: A non-numeric value encountered in /web5/aldweb/www/aldweb_com/www/thread.php on line 497
Réponse n° 5 -------- le 06/11/2005 @ 14:36 par Angus
visiteur |
Hello! Thanks for your reply.
Is there only one MemoDB? I also want to manipulate the ToDo/Task database but I read here from another user that now PalmSource has created TWO databases for Task (and maybe Contacts/Address also?) and in this case how should we manipulate those databases? Must we write changes to both databases, and also has there been a solution to the problem of no proper delimiter to the records (the CHR$(0) problem)?
Thanks again and great product! |
|
|
Warning: A non-numeric value encountered in /web5/aldweb/www/aldweb_com/www/thread.php on line 497
Réponse n° 6 -------- le 07/11/2005 @ 14:38 par aldweb
visiteur |
Hello Angus,
About the CHR$(0) limitation of previous versions, an enhancement is provided in the new version 6.0 using the MegaString. Now, it is possible to write a given number of characters, not stopping at the first CHR$(0) character (see the PRINT$$ statement's second parameter).
About your request for accessing the To Do DB, the Memo DB or any other database, there is no secret: you have to find the structure of a database to know how to access it. For doing so, there is no other choice but to dig in the Palm OS SDK or Palm's specific documentations. What I understood from previous readings on this topic is that there are 2 DBs for some Palm new devices to keep backward compatibility. According to your needs, accessing either only the first format or the first one + the second one will be required...
Cheers, aldweb |
|
|
sujet actif
sujet clos
Important!
Nouveau message -
Rectifier message
Clôturer sujet
Remonter
|
|
|
|
|
|