Custom Query
Results (154 - 156 of 3866)
Ticket | Resolution | Summary | Owner | Reporter |
---|---|---|---|---|
#229 | Rejected | @error and @extended not returning appropriate values for BinaryToString if input binary string contains 00 | steve8tch | |
Description |
I have done some testing. BinaryToString will return the a value up to when it sees the first "00" in the Binary String. The problem is @error still shows 0 - so the return value may or may not contain any values depending on the position of any "00" entries in the Binary string. We have no way to easily test the output from BinaryToString for any "00" values in input Binary String ;binary to string test ;Binary message consisting of a "length component" followed by the string part $err = 99 $ext = 99 $bin_msg = "0x0000000548656C6C6F" ;To get hold of sting part of message I do this $bin_str = "0x" & StringTrimLeft($bin_msg,10) $rtn = BinaryToString($bin_str) $err = @error $ext = @extended msgbox(0,"This works OK","$rtn = " & $rtn & @CRLF & "$err = " & $err & @CRLF & "$ext = " & $ext) ;This suggests that BinaryToString function is returning @error and @extended ; but... $rtn = BinaryToString($bin_msg) $err = @error $ext = @extended ;This does not work - no error, no extended and actually causes Msgbox() to work incorrectly msgbox(0,"Where are the $err and $ext entries ?","$rtn = " & $rtn & @CRLF & "$err = " & $err & @CRLF & "$ext = " & $ext) |
|||
#876 | Rejected | @error passthrough on 'Return' statements | Ascendant | |
Description |
It would be nice to be able to use 'Return MyFunction()' to both return the values from that function *and* the @error/@extended codes. It looks ridiculous, and is probably wasteful to change the below code: Func _ReturnErr() Return SetError(1,0,1) EndFunc Func _ReturnReturnErr() Return _ReturnErr() EndFunc _ReturnReturnErr() If @error Then ConsoleWrite("Error returned correctly"&@CRLF) to this code: Func _ReturnErr() Return SetError(1,0,1) EndFunc Func _ReturnReturnErr() ; Wasteful temporary storage $tempVal=_ReturnErr() ; This looks ridiculous, setting @error to @error: If @error Then SetError(@error,@extended) Return $tempVal EndFunc _ReturnReturnErr() If @error Then ConsoleWrite("Error returned correctly"&@CRLF) I recognize that there is function 'localization', but I believe that 'Return FunctionName()' makes more sense to return the value AND the @error\@extended code information. It would save extra work and make more sense in the end. Actually, even better - I recommend a new keyword - something like 'ReturnWithSubError', which will take the last @error + @extended codes returned by a called function and return them as the @error/@extended values. This will prevent breaking old code, and make code clearer, easier, and more sensible. Code with SetError(@error) looks (and is) ridiculous, in my opinion. (Sorry, don't mean to offend) |
|||
#1536 | No Bug | @errorcode produces a run-time error | jer_826@… | |
Description |
@errorcode produces a run-time error "Error: Unknown macro" |