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 Professional Discussion / file commands help (robot project)

Author
Message
sovr
16
Years of Service
User Offline
Joined: 2nd Jan 2010
Location: USA
Posted: 31st Oct 2010 18:47
I am tring to make a robot communicate to a computer (back and forth) to have the robot think and to have a virutal world to communicate to. Ok there can be hours of info told about this but what I need to know is, how can you write varibles to a .txt file? I tried the different write byte, write float, all of those they didn\'t work! I want it so when you open up the .txt file you see the number in that file. thank you in advance, if you have quaestions about the program please ask!

sov the game creator!
baxslash
Valued Member
Bronze Codemaster
19
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 31st Oct 2010 19:48
Write string is easiest. I always use it and convert the variable to whatever after reading it back in.

Example:


sovr
16
Years of Service
User Offline
Joined: 2nd Jan 2010
Location: USA
Posted: 31st Oct 2010 20:25
I did use that same code, and when I go to the .txt file it has nothing in it.

sov the game creator!
IanM
Retired Moderator
23
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 31st Oct 2010 20:26
Before opening the file to write to it, make sure you delete the file first.


Or you could use the file commands in my plug-ins which automatically clear a file when you open it to write to it.

Utility plug-ins (26-JUL-2010)
I'm applying terms of use that require you to wear a red nose and honk a horn whenever you use the Internet
baxslash
Valued Member
Bronze Codemaster
19
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 1st Nov 2010 14:52
Ah, yes I do use your commands IanM that's why I didn't think of it. Sorry!

Login to post a reply

Server time is: 2026-07-22 04:37:06
Your offset time is: 2026-07-22 04:37:06