Hallo,
PB 4.20 oder 4.30
ich hab ein problem ... und zwar ist die Combobox nicht sortiert gefüllt.
#CB_SORT funzt nicht ... wie kann man das schnell und einfach lösen??
;laufwerk D: hat sagen wa ma 100 Ordner des Bespielt types : xxxx_xxx
Directory.s = "D:\"
If ExamineDirectory(999, Directory.s, "????_???")
While NextDirectoryEntry(999)
;eintrag in combobox hinzufügen
AddGadgetItem(59, -1, DirectoryEntryName(999))
Wend
FinishDirectory(999)
EndIf
ExamineDirectory problem
-
Silencedoogle
- Beiträge: 4
- Registriert: 02.04.2009 11:41
ExamineDirectory problem
Lets Rock and Have fun
- ts-soft
- Beiträge: 22292
- Registriert: 08.09.2004 00:57
- Computerausstattung: Mainboard: MSI 970A-G43
CPU: AMD FX-6300 Six-Core Processor
GraKa: GeForce GTX 750 Ti, 2 GB
Memory: 16 GB DDR3-1600 - Dual Channel - Wohnort: Berlin
Code: Alles auswählen
OpenWindow(0, #PB_Ignore, #PB_Ignore, 220, 100, "void", #PB_Window_SystemMenu)
ComboBoxGadget(0, 10, 10, 200, 20)
NewList files.s()
NewList dirs.s()
If ExamineDirectory(0, "c:\", "")
While NextDirectoryEntry(0)
If DirectoryEntryType(0) = #PB_DirectoryEntry_File
AddElement(files())
files() = DirectoryEntryName(0)
Else
If DirectoryEntryName(0) <> "." And DirectoryEntryName(0) <> ".."
AddElement(dirs())
dirs() = DirectoryEntryName(0)
EndIf
EndIf
Wend
FinishDirectory(0)
SortList(dirs(), #PB_Sort_Ascending | #PB_Sort_NoCase)
SortList(files(), #PB_Sort_Ascending | #PB_Sort_NoCase)
ForEach dirs()
AddGadgetItem(0, -1, dirs())
Next
ForEach files()
AddGadgetItem(0, -1, files())
Next
SetGadgetState(0, 0)
EndIf
Repeat : Until WaitWindowEvent() = #PB_Event_CloseWindowPureBasic 5.73 LTS | SpiderBasic 2.30 | Windows 10 Pro (x64) | Linux Mint 20.1 (x64)
Nutella hat nur sehr wenig Vitamine. Deswegen muss man davon relativ viel essen.

Nutella hat nur sehr wenig Vitamine. Deswegen muss man davon relativ viel essen.

-
Silencedoogle
- Beiträge: 4
- Registriert: 02.04.2009 11:41
-
Little John
Re: ExamineDirectory problem
Silencedoogle hat geschrieben:#CB_SORT funzt nicht
Hast Du mal #CBS_SORT probiert?---------------------------
PureBasic
---------------------------
Zeile 1: Konstante nicht gefunden: #CB_SORT.
---------------------------
Das geht aber wohl nicht mit den nativen PB-Befehlen, sondern nur mit Windows API-Funktionen.
Gruß, Little John
PS: Code hier im Forum bitte immer in [ code ] und [ /code ] Tags einschließen, damit er besser lesbar ist (so wie bei ts-soft).
- Fluid Byte
- Beiträge: 3110
- Registriert: 27.09.2006 22:06
- Wohnort: Berlin, Mitte
#CBS_SORT funktioniert nur in Verbindung mit #CB_ADDSTRING:
Code: Alles auswählen
OpenWindow(0, 0,0,220,100,"void",#PB_Window_SystemMenu | 1)
ComboBoxGadget(0,10,10,200,20,#CBS_SORT)
ExamineDirectory(0,"C:\","*.*")
While NextDirectoryEntry(0)
If DirectoryEntryType(0) = #PB_DirectoryEntry_Directory
SendMessage_(GadgetID(0),#CB_ADDSTRING,0,DirectoryEntryName(0))
EndIf
Wend
FinishDirectory(0)
SetGadgetState(0,0)
While WaitWindowEvent() ! #PB_Event_CloseWindow : WendWindows 10 Pro, 64-Bit / Outtakes | Derek