Page 1 of 1
Quick bit of Visual Basic Help?
Posted: Sun May 06, 2007 12:59 am
by Flipside
Ok, I'm working on something in Visual Basic that I'm trying to get to use Subdirectories for the Graphics, Sound etc. The problem is, I don't know if VB is capable of specifying a directory relative to the Root, it should be.
For example, I want to use something like
FileOpen(1, "\Texts\" & FileName & ".txt", OpenMode.Read)
It's not a problem when I'm working from the Root file to simply open Filename & ".txt", and I've tried forming the entire string before sending it to FileOpen but still no luck.
Any help?
Posted: Sun May 06, 2007 10:06 am
by aldo
.\ ?
Posted: Fri Jun 08, 2007 8:56 am
by BlackHole
I just couldn't help but mention that a directory located in the root is simply referred to as "text\text.txt"
Posted: Fri Jun 08, 2007 7:28 pm
by d3jake
I have experiance in C++ only but, couldn't you put the filename into an array, and then just point it to the array position with the filename in it?
Posted: Fri Jun 08, 2007 10:10 pm
by Flipside
I managed to sort it using the CurDir function, basically, I was generating filenames, which were in subdirectories, but simply referencing '/images/'+Name was producing an error, the fault was I had to use CurDir() + '/images/' + Name, not a biggie, but a pain if you don't know the keyword needed

Posted: Fri Jun 08, 2007 11:21 pm
by BlackHole
Yes, it was producing an error because you had that leading \ when you didn't need it. "images\" would have worked fine.
Posted: Sun Jun 10, 2007 6:07 am
by Flipside
Ahhh... Gotcha

I would say I'll remember it for next time, but I'm doing Java next term, so I doubt I'll be using VB again for a while.
By the way, VB is great on a Core2Duo, I swear I could probably write some Dark Basic Direct3D stuff on here and write a pretty passable game with it
