Posted: Sun Jan 06, 2008 2:18 am Post subject: AVR-DOS - Read/Write Double variables
Hi,
over little debuging we found problem when you want try to read/write DOUBLE variables into text files, for example with this code:
Code:
Dim dbl_var asDouble
Open"test.txt"ForOutputAs #3 Write #3 , dbl_var
Close #3
Open"test.txt"ForInputAs #3 Input #3 , dbl_var
Close #3
You get compile errors about missing some labels [_dbl_bin2asc]. If you get this type of errors, workaround is simple:
- open avr-dos.lbx file
- search for:
[_FileWriteDecDouble]
$EXTERNAL _FileWrite_StrBuf
and replace with:
[_FileWriteDecDouble]
$EXTERNAL _FileWrite_StrBuf , _dbl_bin2asc
- next search for:
[_FileReadDecDouble]
$EXTERNAL _FileReadString
and replace with:
[_FileReadDecDouble]
$EXTERNAL _FileReadString, _Dbl_ASC2Bin
- save file
Now when you compile program it should compile without errors.
In some situation you can get also error about missing labe [_DIV16], solution for this is simple, just place in your main program this directive :
$external _div16 _________________ Best regards,
/Tomi
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You cannot download files in this forum