Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 08/12/2017 in all areas

  1. Hi. Because Sleep() returns with no error your func returns with no error. Therefor @error is set to 0. Conrad
    2 points
  2. Hello, I recently opened a bug report without reading the Helpfile... My bad . After @Melba23's gentle reminder, I was curious about why it was like that. It is about SetError's behaviour. This is the example from the bug report: Example() If @error Then ConsoleWrite("Error" & @CRLF) Else ConsoleWrite("No Error" & @CRLF) EndIf Func Example() SetError(1) Sleep(1000) EndFunc What I tried to do is set Example's (my user defined function's) @error value to 1... but the value set by SetError is cleared after calling a function, I wonder why? Why should calling to an external function effect my function's @error which is set when my function returns. Setting the error of a UDF in advance by using SetError makes sense... but I cannot find a reason why calling a function should clear it? Please note that I am not talking about @error, I am talking about the @error set by my function when it ends/returns! I hope someone can enlighten me, thanks for the answers in advance! P.S I tried to explain my best but my English is not very good and I didn't feel like I did a good job explaining today, so please pardon any mistakes that I have made
    1 point
  3. Gawd. Look at it this way. You have a bucket called @error and there is only one. You fill that bucket with water, that we will call 1. You put that bucket on you scooter and drive around to the Function at my place. On the way there, a person named Sleep empties your bucket. When you get to the Function at my place 1 has disappeared ... the @error bucket is empty. P.S. I forgot to say, that you were originally at the Function at my place, but left with your bucket, to collect some @error. You shouldn't have let Sleep tag along for the ride.
    1 point
  4. One and the same thing. The way I understand it, @error is a macro, and any error return is stored in that (one) macro. That's why any following function clears it or stores its own result in it, replacing any previous value. P.S. And if you look at the first Help file example for SetError, you will see that the error is stored in the Return. Your code doesn't do that.
    1 point
  5. AppSoftwareVld, Does this do what you want? #include <GUIConstantsEx.au3> ; Array to hold input contents Global $aContents[1] = [0] ; Set required string to match $sRequired = "blue" ; Create GUI $hGUI = GUICreate("Test", 500, 500) $cInput = GUICtrlCreateInput("", 10, 10, 200, 20) $cRead = GUICtrlCreateButton("Read", 10, 50, 80, 30) $cShow = GUICtrlCreateButton("Show", 100, 50, 80, 30) $cCombo = GUICtrlCreateCombo("", 10, 100, 200, 200) GUICtrlSetState($cCombo, $GUI_HIDE) GUISetState() While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE Exit Case $cRead ; Increase size of array $aContents[0] += 1 ReDim $aContents[$aContents[0] + 1] ; Check if there is something to add If GUICtrlRead($cInput) <> "" Then ; Add input contents to array $aContents[$aContents[0]] = GUICtrlRead($cInput) EndIf ; Clear input GUICtrlSetData($cInput, "") ; Reset focus to input GUICtrlSetState($cInput, $GUI_FOCUS) Case $cShow ; Create new combo data $sComboData = "" ;Loop through array For $i = 1 To $aContents[0] ; Check if required value is present If StringInStr($aContents[$i], $sRequired) Then ; And add to combo data $sComboData &= "|" & $aContents[$i] EndIf Next ; Add data to combo GUICtrlSetData($cCombo, $sComboData) ; Show combo GUICtrlSetState($cCombo, $GUI_SHOW) Case $cCombo GUICtrlSetState($cCombo, $GUI_HIDE) EndSwitch WEnd M23
    1 point
  6. Have you looked at _FFFrameEnter? http://english.documentation.ff-au3.thorsten-willert.de/ff_functions/_FFFrameEnter.php
    1 point
×
×
  • Create New...