![]() |
Forum Index : Microcontroller and PC projects : Flash file system
Author | Message | ||||
palcal![]() Guru ![]() Joined: 12/10/2011 Location: AustraliaPosts: 1603 |
I am re writing my weather station code to use the flash file system instead of saving to the DS3231 flash I'm trying to open a directory and save some values, I have and I get Error : Entry is a dir I find it hard as I can't find any examples, what am I doing wrong? "It is better to be ignorant and ask a stupid question than to be plain Stupid and not ask at all" |
||||
thwill![]() Guru ![]() Joined: 16/09/2019 Location: United KingdomPosts: 2930 |
Hi @palcal, You don't "open a directory", you open a file in a directory. Assuming the directory "A:/weather/" exists (if not then use MKDIR first) then: open "A:/weather/my_file.txt" for output as #1 Best wishes, Tom CMM2 Welcome Tape, Creaky old text adventures |
||||
palcal![]() Guru ![]() Joined: 12/10/2011 Location: AustraliaPosts: 1603 |
Thanks I have never worked with directories so learning "It is better to be ignorant and ask a stupid question than to be plain Stupid and not ask at all" |
||||
palcal![]() Guru ![]() Joined: 12/10/2011 Location: AustraliaPosts: 1603 |
Thanks I have never worked with directories so learning "It is better to be ignorant and ask a stupid question than to be plain Stupid and not ask at all" |
||||
palcal![]() Guru ![]() Joined: 12/10/2011 Location: AustraliaPosts: 1603 |
OK got it working with.. open "A:/weather/data" for output as #1 print #1, rain print #1, rainyest print #1, rainyear close #1 open "A:/weather/data" for input as#1 input #1, rain input #1, rainyest input #1, rainyear close #1 print rain,rainyest,rainyear Is there a way to Input and Output without using 3 lines, I tried... print #1, rain, rainyest, rainyear input #1, rain, rainyest, rainyear but the second two entries returned zero "It is better to be ignorant and ask a stupid question than to be plain Stupid and not ask at all" |
||||
TassyJim![]() Guru ![]() Joined: 07/08/2011 Location: AustraliaPosts: 5119 |
' rain =25 raintest = 100.5 rainyear = 1040.8 OPEN "A:/weather/data" FOR output AS #1 PRINT #1, rain;","; rainyest;","; rainyear CLOSE #1 OPEN "A:/weather/data" FOR INPUT as#1 INPUT #1, rain, rainyest,rainyear CLOSE #1 PRINT rain,rainyest,rainyear You need to pout commas between the fields when printing to the file. Jim VK7JH MMedit MMBasic Help |
||||
palcal![]() Guru ![]() Joined: 12/10/2011 Location: AustraliaPosts: 1603 |
OK Jim thanks for that. "It is better to be ignorant and ask a stupid question than to be plain Stupid and not ask at all" |
||||
palcal![]() Guru ![]() Joined: 12/10/2011 Location: AustraliaPosts: 1603 |
With my new Win 11 machine none of the function keys work with Teraterm, GFXterm or MMEdit. the function key for screen brightness are OK. Edited 2023-01-24 13:15 by palcal "It is better to be ignorant and ask a stupid question than to be plain Stupid and not ask at all" |
||||
TassyJim![]() Guru ![]() Joined: 07/08/2011 Location: AustraliaPosts: 5119 |
On some keyboards the function keys are dual purpose and you may have to switch them to "function keys" This is very common on laptops and keyboards that are supplied by the big name manufacturers. VK7JH MMedit MMBasic Help |
||||
palcal![]() Guru ![]() Joined: 12/10/2011 Location: AustraliaPosts: 1603 |
Forget it. Edited 2023-01-24 15:02 by palcal "It is better to be ignorant and ask a stupid question than to be plain Stupid and not ask at all" |
||||
![]() |