Posts: 4
Threads: 1
Joined: Jan 2004
Hello Zack, Neo, Agamemnus,
I understood that I should ignore the answers of Zack and Neo.
I had a look on the filesite, what agamemnus told. Not so easy will it be.!!
I tried the next things;
There are 4 *.txt files;
dortron.txt
aanvraag.txt
Top920_1234567654321.txt
Top123.txt which is a copy of the above.
print dir$("directory\*.txt")
print dir$
print dir$
gives only "dortron.txt" and "aanvraag.txt"
and the last dir$ gives " illegal function call " , of course.
All this above happens from QBX /PDS 7.1.
When we do it from the dosprompt, then the 4 files appears!!
Very strange isnot it?
Timo Gruijters
Posts: 6,419
Threads: 74
Joined: Mar 2002
Not strange at all. As I told you, the problem is with long filenames. MSDOS only allowed 8 chars in the filename and 3 chars in the extension. QB is a MSDOS program, so join the dots...
Posts: 3,368
Threads: 195
Joined: Jan 2003
It's simple.
Just do:
PRINT short.filename$("C:\long directory\long name.txt")
For full functionality you'll need qb.bi, and these things:
'$INCLUDE: 'qb.bi'
'$DYNAMIC '(for load.filelist and load.filelist2)'for load.filelist and load.filelist2:
DIM SHARED option.amount AS INTEGER, option.list$(0)
'for load.filelist2:
DIM SHARED filetype.max AS INTEGER: filetype.max% = 10
DIM SHARED filetype.ext$(1 TO filetype.max%), option.amount2%(1 TO filetype.max%)
For just using the function short.filename$(), you only need one extra sub: exit.error().
Just copy it..
Peace cannot be obtained without war. Why? If there is already peace, it is unnecessary for war. If there is no peace, there is already war."
Visit www.neobasic.net to see rubbish in all its finest.
Posts: 3,616
Threads: 287
Joined: Jan 2003
Oh, that's friendly...ignore our posts.
f only life let you press CTRL-Z.
--------------------------------------
Freebasic is like QB, except it doesn't suck.
Posts: 3,368
Threads: 195
Joined: Jan 2003
Well you did say
Quote:Oh, *absolutely*! I forgot about how useful that is...sorry, gruijters, you can discard my suggestion, it's worthless!
:|
Peace cannot be obtained without war. Why? If there is already peace, it is unnecessary for war. If there is no peace, there is already war."
Visit www.neobasic.net to see rubbish in all its finest.
Posts: 3,616
Threads: 287
Joined: Jan 2003
Er...Joke.
f only life let you press CTRL-Z.
--------------------------------------
Freebasic is like QB, except it doesn't suck.
Posts: 4
Threads: 1
Joined: Jan 2004
Hoi Agamemnus,
I tried the prog but of course, there is something..
I got error 9 in line;
File$=getfile$(path$+filetype.1)ext$(1),&H27)in the sub;
Load.file.list2
May be because I use xbx.bi in stead of qb.b1??
Qbx.bi ;
Type RegTyp
ax
bx
cx
dx all as integer
bp
si
di
flags
ds
end type
Have you an idea of the cause of the problem?
Timo
Posts: 3,368
Threads: 195
Joined: Jan 2003
Is the error "subscript out of range"?
Possibly because filetype.ext() isn't DIMmed? Also could be that it isn't DIMmed as SHARED?
Peace cannot be obtained without war. Why? If there is already peace, it is unnecessary for war. If there is no peace, there is already war."
Visit www.neobasic.net to see rubbish in all its finest.
Posts: 4
Threads: 1
Joined: Jan 2004
Yes eror 9 is out of subscript.
I move the remarks from several dim statements and now there is no error but neither other output.
Only 1 out put is there; the errormessage about the stomach illness.
Do you have any other suggestions?
Timo