This displays files and folders in a tree gadget
Global dirlevel.b
Procedure ScanPath(Path.s)
Protected dir.l, name.s, files.l
Dirlevel = Dirlevel + 1
dir = ExamineDirectory(#PB_Any, Path, "")
If dir
While NextDirectoryEntry(dir)
name = DirectoryEntryName(dir)
If DirectoryEntryType(dir ...
Search found 3 matches
- Tue Aug 02, 2011 12:34 am
- Forum: Coding Questions
- Topic: Listing files in a directory
- Replies: 18
- Views: 8097
- Mon Aug 01, 2011 2:40 pm
- Forum: Coding Questions
- Topic: Listing files in a directory
- Replies: 18
- Views: 8097
Re: Listing files in a directory
; English forum: http://www.purebasic.fr/english/viewtopic.php?t=6064&highlight=
; Author: Fangbeast (updated for PB4.00 by blbltheworm)
; Date: 05. May 2003
; OS: Windows
; Demo: No
#Tree = 1
#List = 2
#Text = 3
#folder = 4
#drive = 5
#imail = 6
;
Global fver.s,fid0.s,fname.s,ftype.s ...
- Sat Jan 08, 2011 10:37 am
- Forum: Coding Questions
- Topic: i like to stop a loop by pressing the "s" key
- Replies: 42
- Views: 4313
Re: i like to stop a loop by pressing the "s" key
Do not use waiting loops, use timer events instead.
One Main loop which starts the measurement when a timer event occurs:
OpenWindow(0, 0, 0, 240, 70, "ShortcutGadget", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
AddKeyboardShortcut(0, #PB_Shortcut_S, 777)
AddWindowTimer(0, 1, 60000)
Repeat ...
One Main loop which starts the measurement when a timer event occurs:
OpenWindow(0, 0, 0, 240, 70, "ShortcutGadget", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
AddKeyboardShortcut(0, #PB_Shortcut_S, 777)
AddWindowTimer(0, 1, 60000)
Repeat ...