Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
function dir$()
#11
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
Reply
#12
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...
SCUMM (the band) on Myspace!
ComputerEmuzone Games Studio
underBASIC, homegrown musicians
[img]http://www.ojodepez-fanzine.net/almacen/yoghourtslover.png[/i
Reply
#13
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.
Reply
#14
Oh, that's friendly...ignore our posts.
f only life let you press CTRL-Z.
--------------------------------------
Freebasic is like QB, except it doesn't suck.
Reply
#15
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.
Reply
#16
Er...Joke.
f only life let you press CTRL-Z.
--------------------------------------
Freebasic is like QB, except it doesn't suck.
Reply
#17
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
Reply
#18
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.
Reply
#19
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
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)