|
Post by James :) (aka Madcow) on Nov 23, 2006 18:14:40 GMT -5
as you can guess it lets you delete files . like so deletefile("hi.txt"). but it still has bugs ! - If the file dose not exsits then basic4gl will exit as soon as you run
- If your program has not been saved at all then basic 4gl will exit as soon as you run.
these bugs are prety easy to avoid so if you know how you can avoid them. But i will work on fixing these bugs and also some other plugins. download here: pb4.wikispaces.com/space/showimage/Deletefile.dll
|
|
|
Post by Nicky Peter Hollyoake on Nov 23, 2006 18:31:54 GMT -5
nice, i like it and can come in handy abit.
hope you sort out the bugs in it cause some people do forget to save.
|
|
|
Post by davy on Nov 23, 2006 21:19:04 GMT -5
That is a pretty good idea. But Madcow, you may want to mention that it isn't restricted to the programs root folder, meaning it is able to delete any file on the computer. So you have to use a little more caution running programs with this dll attatched. But it is a cool idea, in fact...
You/someone could also assemble a small set of file in/out routines to go along with it too. Sure, basic4gl has file in/out, but this way they could read/write/delete files ANYWHERE, not just the program folder. That way people could write installers or open files from anywhere (for a text/model/image editor).
|
|
|
Post by James :) (aka Madcow) on Nov 24, 2006 3:03:19 GMT -5
yes it is un-retricted.
And in fact i was thinking of doing unretricted reading and writing myself. But it might take a while before i can get it to do other things than read line and writeline.
|
|
|
Post by davy on Nov 24, 2006 3:41:25 GMT -5
Cool. I think the line's/text(non-whitespace chunks)/int/float/char are all you would need to do for the in/out part. It would be a *tiny* bit more complex to handle the file labels. I dont know how most people would do it, I would probably use a vector (from the c++ vector template) and add an element for each file they open, then return that vector number to the label they used in basic4gl as a handle. This way you could use a basic4gl command like...
myFile = myOpenFileRead("test.txt")
and the myOpenFileRead() would return the vector number of the element it used to open the file, that way you could use the myFile variable in basic4gl as a handle...
x = myReadInt(myFile)
I hope this makes sense, if not, I hope you find a better method. However, this method will allow it to open a non-restricted number of files, you can also use a close file command to pop that element from the vector and close the file in c++.
Sounds like a pretty worthwhile project though, I've seen alot of people complain about the inability to read/write in other folders. Good luck!
|
|
|
Post by James :) (aka Madcow) on Nov 24, 2006 10:38:58 GMT -5
Why didn't i think of tha. thanks that will save me a fair bit of programming.
|
|