Strange error
Posted: Sun Jun 18, 2006 9:18 pm
I was working on a procedure set and made a typo, I put = instead of - and the compiler didn't raised an error (the assembler did). Here's the code:
Is this a bug in PB or it's just me? Shouldn't the compiler warn before calling FASM?
Code: Select all
Procedure GetDriveType(Parameter.s)
Select GetDriveType_(Parameter)
Case 2
Result = 2;"Floppy"
Case 3
Result = 3;"Drive Fixed"
Case 4
Result = 4;"Remote"
Case 5
Result = 5;"Removable"
Case 6
Result = 6;"Ram disk"
Default
Result = 7;"Unknown"
EndSelect
ProcedureReturn Result
EndProcedure
Procedure FindDrives()
*DriveBuffer = AllocateMemory(255)
For i = 0 To GetLogicalDriveStrings_(255, *DriveBuffer)
DriveL = PeekB(*DriveBuffer + i)
Drives.s = Drives.s + Chr(DriveL)
Next
Debug Drives.s
Slash = CountString(Drives,"\",1)
For Divide = 1 To Slash=1
DriveLetter.s = StringField(Drives,Divide,"\")+"\"
If DriveLetter <> ""
AddElement(Drives())
Drives() = DriveLetter
Debug DriveLetter
EndIf
Next Divide
ResetList(Drives())
ProcedureReturn
EndProcedure