DevilUI Weird error (Maybe FileType)

Community Forums/Developer Stations/DevilUI Weird error (Maybe FileType)

_PJ_(Posted 2009) [#1]
I have encountered a strange bug when I am using DevilUI though it appears the error is mroe a Blitz bug with the FileType command.

here's the code snippet where the bug occurs:

				grpProfName = GUI_CreateGroupBox(tabpProfile, 10, 10, 256,64,"Profile Name:")
					cmbProfiles= GUI_CreateComboBox(grpProfName,8,16,96)
						;GUI_Message(cmbProfiles, "AddItem", -1, PROFILE_DEFAULT_PROFILE$,"")
						dir = ReadDir(FOLDER_PROFILES$)
						Repeat
							Stop
							f$ = NextFile(dir)
							If f$ = "" Then Exit
							If FileType(f$) = 2 And f$ <> "." And f$ <> ".."
								txt$ = f$
								GUI_Message(cmbProfiles, "AddItem", -1, txt$,"")
							EndIf
						Forever
						CloseDir dir


It is intended to add the names of valid folders/directories to the ComboBox, however after finding the first folder (After skipping the . and .. values) when it comes to the second, it fails to comply with the "If" line. Following the BlitzDebugger, it fails to recognise the second valid folder as a directory.

i.e. FileType(f$) <> 2

I have a couple of folders in the "FOLDER_PROFILES$" and definitely the filepaths are correct.

Oh, and I'm using Blitz v100 (The latest one)


_PJ_(Posted 2009) [#2]
Nevermind...

FileType$() Needed the Full path. So I changed the 'offending' line to:

If FileType(FOLDER_PROFILES$+f$) = 2 And f$ <> "." And f$ <> ".."


Works okay now :)