I have a problem reading files.
I want to read a file called "textfile." which I created with Notepad and put into the 9200 documents folder. However, when I use the reading text files example in the OPL documentation, I get an Bad allignemnt error! There is nothing about this error in the documentation. Dont know why I get it. Is there a snipet that you may have that reads any text of a file and prints it on the screen like TYPE in DOS does? Thanx
Hi MaleBuffy!
I'm not very experienced with OPL, in particular with OPL on ER6, but I have two suggestions:
-Did yo store the file as Unicode? I used Wordpad for that instead of Notepad.
-I suppose you use an IOPEN command to read the text file. With OPL on ER6 you have to use 'an wider offset' with two instead of one byte as in ER5. There is an example in the 'Symbian OS v6.0 OPL Porting Guide' adressing this topic:
CONST KOplAligment%=1
pBuf&=ADDR(Buffer$)
Len%=IOREAD(Handle%, pBuf&+1+KOplAlignment%, MaxBytes%)
...
POKE pBuf&,Len%
HTH Martin
Thanx, forgot all about the porting guide stuff! 😃
Very nice, thanx again!
OK it worked. Instead of +1 I used +2 like in ER 6.0 even though I use 6.1. So in Series 60 its the same. However, I used wordpad to convert my file to Unicode and the results were perfect. "Hello World" 😃
But when I tried to read an sms message inside the system\mail folder I got this result! So is this file in another format? Not unicode? If it isnt how can I actually read it?