Forum - MCS Electronics

 

FAQFAQ SearchSearch RegisterRegister Log inLog in

Write or Put ?

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

Bascom Member



Joined: 22 Jun 2004
Posts: 1161
Location: France

france.gif
PostPosted: Thu Jul 05, 2018 4:08 pm    Post subject: Write or Put ? Reply with quote

Hi,*
I never use AVRdos to write somethng, only to read
ex :
Code:
    Chdir "lalong"
     Sentence = "lalong.txt"
     Ff = Freefile()
     Open Sentence For Input As #ff
     Do
          Lineinput #ff , Stdir       ' read a line  and result in stdir string
          Wait 1
     Loop Until Eof(ff) <> 0
     Close #ff
     Chdir "\"       'change to the root directory

The result was 491625N031317ELONGPONT without any "
so I would like replace the file from my ATMEGA2560
I use :
Code:

                   Chdir "lalong"
                    Print "kill lalong.txt"
                    Kill "lalong.txt" l
                    Waitms 100
                    Ff = Freefile()
                    Open "lalong.txt"for Output As #ff
                   Write #ff , Sentence
                    Close #ff
                    Waitms 100
                   
                    Ff = Freefile()
                    Open "lalong.txt" For Input As #ff
                    Do
                         Lineinput #ff , Stdir       ' read a line  and result in stdir string
                         Wait 1
                    Loop Until Eof(ff) <> 0
                    Close #ff
                    Chdir "\"       'change to the root directory

                    Print "stdir" ; Stdir
 

the result is
"484754N021849EBAGNEUX"
So my question : It is possible to write a string without " " as VBA for excel does ?

Thanks for your help Wink
Jp

_________________
pleasure to learn, to teach, to create
Back to top
View user's profile Visit poster's website
albertsm

Administrator



Joined: 09 Apr 2004
Posts: 5921
Location: Holland

blank.gif
PostPosted: Thu Jul 05, 2018 9:05 pm    Post subject: Reply with quote

Like the help suggests, WRITE uses double quotes just as in VB.
You need to use the good old PRINT when you do not want that.

_________________
Mark
Back to top
View user's profile Visit poster's website
Duval JP

Bascom Member



Joined: 22 Jun 2004
Posts: 1161
Location: France

france.gif
PostPosted: Fri Jul 06, 2018 10:02 am    Post subject: solved Reply with quote

Hi Mark
and thanks for your answers
During the night ....I add some line and now it's solved
Code:

     If Left(stdir , 1 ) = Chr(34) Then       'suppression du " si stdir vient du clavier
        Delchar Stdir , 1
     End If
     If Right(stdir , 1) = Chr(34) Then
        Lenst = Len(stdir)
        Delchar Stdir , Lenst
     End If
 

like that if the file is write with VBA it is good, and if it is write from the AVRDOS it is good also
JP Wink

_________________
pleasure to learn, to teach, to create
Back to top
View user's profile Visit poster's website
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