Tip: Tiny code to find a file on disk

Share your advanced PureBasic knowledge/code with the community.
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Tip: Tiny code to find a file on disk

Post by BackupUser »

Code updated For 5.20+

Restored from previous forum. Originally posted by PB.

Here's some short code to find a file on any disk or hard drive.

Code: Select all

path$=Space(255) : r=SearchTreeForFile_("c:\","FileToFind",path$)
If r=0
  MessageRequester("Error","File not found...",0)
Else
  MessageRequester("Location",path$,0)
EndIf

PB - Registered PureBasic Coder

Edited by - PB on 18 January 2002 00:51:52
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by Steve.

Short and sweet.
And Works as advertised.
Thanks

Steve - Reg. PB user
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by PB.
Short and sweet.
Yep, using the API is a wonderful way to code in PureBasic.
Of my apps, I'd say about 40% of their code are API routines and not
actually BASIC at all...


PB - Registered PureBasic Coder


Edited by - PB on 17 January 2002 03:34:07
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by Rings.
Of my apps, I'd say about 40% of their code are API routines and not
actually BASIC at all...
Oh yes API solve most of the problems.But there are new Problems if you want compile to Linux(If Not , forget my comment ).Thats wh i want most of the API's in Basic-Commands to port it between OS's .

Siggi
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by PB.
Oh yes API solve most of the problems.But there are new Problems if you want compile to Linux(If Not , forget my comment ).Thats wh i want most of the API's in Basic-Commands to port it between OS's .
I know what you mean, but like you said: I don't use Linux/Amiga so it's of no
concern to me. :)


PB - Registered PureBasic Coder
Post Reply