How i can do it?
#1 (edited by dash 2019-01-06 06:31:11)
#2 (edited by cartertemm 2019-01-06 06:46:19)
Go to the start screen, find bgt, then help
Or if you prefer, open up
"C:\Program Files (x86)\BGT\bgt.chm"
Either way, references/foundation layer/object reference/file. Enter on the topic and f6 to read text. I'm purposely not providing code, as your first step on the programming journey will have to be figuring out the basics
There's an example of this in the file object chapter. It's very easy to do. I strongly recommend you go through the help section. Otherwise, here goes an example.
//I'll skip void main because putting braces seems to break things on the forum.
And as long as the file in quotes is valid, you now have a string containing the file contents of outfile.txt:
Also, you can eliminate a line by going.
But I'm overcomplicating ever slightly. I hope this helps!
Thanks for informations.
I was just curious if it was possible.
I mean I got bored enough to make a virtual notepad in bgt (without using audio form) and didn't get passed being able to view the file with your arrow keys because how massively useless the audio form object is, but that's a story and rant for another day.
And yeah, this right here is the basics of saving and loading data, passing the contents of a file to a string. Your supposed to serialise it using dictionaries but aaaaaaaaaaaaa dictionaries! Dictionaries and bgt aren't a combination I would recommend if your after a stable bgt script.
I actually created a note taking program in BGT many moons ago. Note to self, must port to python.
Managing Director of Nathan Tech
It's not disability
Heh, I just got bored and wanted to see if it could be done without using audio form. Spoiler alert, it can, but it's ever tricky and is likely to end up with massive massive glitches, somewhere. Where? No idea yet. Why? No idea either.
The way I'm doing it is using Arrays and for every true newline I skip empty lines is inserted a new element with the string data. yeah, it's an explanation as vague as trying to read braille sheet music for your first time but there you have it.