c.haslam Posted September 15, 2008 Posted September 15, 2008 I think I have found a bug in AutoIt 3.2.10.0: I coded an error in a function: it returns "" in one place and True in another: CODEFunc ChooseaPic($nrow) Local $filspc,$t,$fnam,$nrb $filspc = FileOpenDialog("Load a Picture",$gDirSpec & "\","Images (*.jpg)",1) ; file must exist If $filspc="" Then Return "" $nrb = $ixbase + $nrow $t = GUICtrlRead($lblPicFsAr[$nrow]) if $t<>"" Then if MsgBox(4096+$MB_YESNO+$MB_ICONQUESTION,$scriptName,"Replace " & $t & " ?")<>$IDYES Then Return False GUICtrlDelete($rowsAr[$nrb][$kID]) $rowsAr[$nrb][$kID] = 0 EndIf $fnam = GetFnamFromFilspc($filspc) $rowsAr[$nrb][$kFnam] = $fnam Return True EndFunc FreeImage_Save() was not saving a DIB to a .bmp file. When I changed Return "" to Return False, FeeImage_Save() worked. Script code, some 600 lines of it, available on request. ...chris Spoiler CDebug Dumps values of variables including arrays and DLL structs, to a GUI, to the Console, and to the Clipboard
zfisherdrums Posted September 15, 2008 Posted September 15, 2008 What is "FreeImage_Save"? What is the rationale behind returning an empty string over returning just false? What does "inoperative" mean in this context? Identify .NET controls by their design time namesLazyReader© could have read all this for you. Unit Testing for AutoItFolder WatcherWord Doc ComparisonThis here blog...
c.haslam Posted September 15, 2008 Author Posted September 15, 2008 What is "FreeImage_Save"? What is the rationale behind returning an empty string over returning just false? What does "inoperative" mean in this context? Global Const $FreeImage_Save = "_FreeImage_Save@16" There is no rationale behind returning an empty string over returning False. As I wrote, this was a coding error. An earlier version returned either $filspc or "". I changed one but not the other. In this context, "inoperative" means that the .bmp file was not created. The calling code: if ChooseaPic($nrow) Then LoadaPic($nrow) EndIf It took me a couple of hours to find the bug. @error was 0 in all cases. ...chris Spoiler CDebug Dumps values of variables including arrays and DLL structs, to a GUI, to the Console, and to the Clipboard
PsaltyDS Posted September 15, 2008 Posted September 15, 2008 So... you're talking about a bug in your own code... that you already found... and you already fixed it? >_< What was the point of this topic again? Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now