Code: Select all
firstVariable := 34
nextVariable := 42
MsgBox % MySpecialFunction(firstVariable) ; returns "firstVariable : 34"
MsgBox % MySpecialFunction(nextVariable) ; returns "nextVariable: 42"
Update
------------------------------------------------
Lets say I am debugging MyTest()
Code: Select all
MyTest()
{
Loop, 10
{
score := getScore(a_index)
; MsgBox % "score " . score "; index " . a_index ; Method 1 - too many Messages
; acc := acc . "`r`ntest1 score: " . score . " index " . a_index ; Method 2
if (score > 80){
; MsgBox % "exiting test 1 - true`r`n" . acc ; Method 2 continued - it requires too much code too much writing required
return "Test 1 : " . score . " points after " . a_index . " steps"
}
}
Loop, 20
{
anotherScore := getAnotherScore(a_index)
; MsgBox % "anotherScore " . anotherScore "; index " . a_index ; Method 1 - too many Messages
; acc := acc . "`r`ntest1 score: " . score . " index " . a_index ; Method 2 ... we forgot to replace "score" with "anotherScore " .. missleading output
; MyDbg.append(anotherScore ) ; Method 3 - least clicks: just ^c^v "MyDbg.append()" then paste "anotherScore "
if (score > 60){
; MsgBox % "exiting test 1 - true`r`n" . acc ; Method 2 continued .. test 2 again
; MyDbg.Msg() ;; Method 3 desired method
return "Test 2 : " . anotherScore . " points after " . a_index . " steps"
}
}
; MsgBox % "exiting method" . acc ; Method 2
return "Low scores in tests 1 and 2"
}
loop1: (1,3), (2,38),..
loop2: (1,12121) ! found. Success!
I have two options :
Method 1: add two lines of MsgBox inside of the loop (fast but tones of boxes)
Method 2: use append - cleaner output, but too much typing, easy to make mistakes, leaves a lot of dead code
Method 3: fast, clean, reliable. But I can't get mapping
Code: Select all
MsgBox % MySpecialFunction(firstVariable) ; returns "firstVariable : 34"
MsgBox % MySpecialFunction(nextVariable) ; returns "nextVariable: 42"