Forum - MCS Electronics

 

FAQFAQ SearchSearch RegisterRegister Log inLog in

AVR-DOS - Read/Write Double variables

 
Post new topic   Reply to topic    www.mcselec.com Forum Index -> AVR-DOS
View previous topic :: View next topic  
Author Message
tomi

Administrator



Joined: 22 Feb 2005
Posts: 155
Location: Universe

blank.gif
PostPosted: Sun Jan 06, 2008 2:18 am    Post subject: AVR-DOS - Read/Write Double variables Reply with quote

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 as Double

Open "test.txt" For Output As #3
   Write #3 , dbl_var
Close #3

Open "test.txt" For Input As #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
Back to top
View user's profile Visit poster's website
taroosheh

Bascom Member



Joined: 16 Mar 2007
Posts: 32
Location: Iran

iran.gif
PostPosted: Sun Sep 28, 2008 7:53 pm    Post subject: hi Reply with quote

in AVR-DOS the write command not work properly

you can use put and get commands that these are more general and work very well
try this path:
http://www.electrorc.blogfa.com
for en:
http://electrorc-en.blogspot.com
Back to top
View user's profile Yahoo Messenger
Display posts from previous:   
Post new topic   Reply to topic    www.mcselec.com Forum Index -> AVR-DOS All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
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