Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Discussion / SAVE STRING TO FILE

Author
Message
DB191919
20
Years of Service
User Offline
Joined: 30th Jan 2005
Location:
Posted: 30th Jan 2005 18:52
Hi. I would like to know how to save a string to a file then call it at another time. How do i go about this?
Jess T
Retired Moderator
21
Years of Service
User Offline
Joined: 20th Sep 2003
Location: Over There... Kablam!
Posted: 30th Jan 2005 22:08
Yo, DB19,

First, you may want to have a look in the Help files at all the commands pretaining to Files and how to write/read to/from them.

To get there, open up the Help files, then go to the Commands Section, then "INPUT". Scroll down to "FILE SYSTEM COMMANDS" and there are all the ones you want.

The main commands you'll be interested in though, are Open To Read, Open To Write, Close File, Write String and finally, Read String

Jess.


Team EOD :: Programmer/All-Round Nice Guy
Aust. Convention!
DB191919
20
Years of Service
User Offline
Joined: 30th Jan 2005
Location:
Posted: 30th Jan 2005 22:21
Thanks for the reply. I was also wondering how to store results of a 'perform checklist' action. For example, I wanted to perform a checklist for graphics cards then store the results into a text file.
DB191919
20
Years of Service
User Offline
Joined: 30th Jan 2005
Location:
Posted: 30th Jan 2005 23:13
Anyone?
blanky
20
Years of Service
User Offline
Joined: 3rd Aug 2004
Location: ./
Posted: 31st Jan 2005 02:18 Edited at: 31st Jan 2005 02:22
Open the file to write, and for each checklist item write it as a string, followed by close file.

This code will *PROBABLY* work:
(It should put the results into a text file called graphics_card_list.txt).

(For the people who don't know, ` is the same as REM is the same as DBC, ignore this line, it's to make the code more readable by humorous beans.)


Oh yeah, and, yes, it has been one of those days..

(Note: To understand some of the words, (i.e. 'buhleet'), you may need to say them out loud a couple of times..)

Avatar - white cat in a snowstorm. Look closely.
DeHonCha
20
Years of Service
User Offline
Joined: 2nd Dec 2004
Location: A world of my own...
Posted: 8th Feb 2005 05:29
i would take the data in to a string array and then save the array - much easier when retreiving data

For when they said I couldn't, I did...

Login to post a reply

Server time is: 2025-05-25 01:40:04
Your offset time is: 2025-05-25 01:40:04