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.

Newcomers DBPro Corner / Make File ???

Author
Message
Da Riddler 79
16
Years of Service
User Offline
Joined: 7th May 2008
Location: USA
Posted: 9th Jun 2010 23:38
Hello everyone,

I can\'t figure it out for the love of god, the \"MAKE FILE\" command ? I mean what exactly is it used for and how do you use it ?

I played with this command at one time and was able to create all kinds of files, e.g. .txt / .dll / .exe / ect. However those files don\'t really work or do they ? Am I suppose to write data into them and if so how can I do that ?

The only reason I\'m asking because it doesn\'t really explain in detail how to use this command in the \"Command Menu\" it just quotes \"The filename must not exist or the command will fail\"

Thanx to anyone who can answer my Question
Yitzu
15
Years of Service
User Offline
Joined: 14th Feb 2009
Location:
Posted: 10th Jun 2010 03:59
Yes, i have this doubt too, how the hell does it works? XD
tomaszavenger
15
Years of Service
User Offline
Joined: 24th Jun 2009
Location:
Posted: 10th Jun 2010 11:32
Okay, all files are binary, and that's it. An extension is usually used to identify meaning, but unless the file is in the right binary format, it's useless.

Make file creates an empty file with a name, and it's used to initialise a save file.

For example, if you wanted to write a program that saved a message to a file called "msg.txt", it would work like this:



And that's all there is to it.

If you're wondering what GET DIR$() is, it's a function that returns the current directory your application is running in. Make sure if you test this code, you save it first.
DVader
20
Years of Service
User Offline
Joined: 28th Jan 2004
Location:
Posted: 10th Jun 2010 20:44 Edited at: 10th Jun 2010 20:50
Yes, all the make file command does is make a blank file ready for you to use. You need to open the file to read or write to use it and use write string etc to append it. If you find them tricky you might want to use save array instead. I find arrays easier to work with in general.
For instance, when first learning DB I made a high score table using the open write file commands. It worked but was fairly large. On my next project I used a couple of arrays. The arrays were easier and more efficient.

http://s6.bitefight.org/c.php?uid=103081

Login to post a reply

Server time is: 2024-11-24 15:37:46
Your offset time is: 2024-11-24 15:37:46