| View previous topic :: View next topic |
| Author |
Message |
rousni
Joined: 23 Mar 2006 Posts: 41
|
Posted: Mon Oct 15, 2007 8:21 pm Post subject: POS := InStr(Haystack, Needle) : a contradictory result |
|
|
| Code: | SetFormat, integer, h
VAR = 123456
POS := InStr(VAR, "789")
MsgBox, POS = %POS% `n ErrorLevel = %ErrorLevel%
;Result: POS = 0x0 and ErrorLevel = 0, which is contradictory |
|
|
| Back to top |
|
 |
Superfraggle
Joined: 02 Nov 2004 Posts: 846 Location: London, UK
|
Posted: Mon Oct 15, 2007 10:31 pm Post subject: |
|
|
Instr doesnt set errorlevel.
If it is not found then the result is zero. _________________ Steve F AKA Superfraggle
http://r.yuwie.com/superfraggle |
|
| Back to top |
|
 |
engunneer
Joined: 30 Aug 2005 Posts: 6772 Location: Pacific Northwest, US
|
Posted: Mon Oct 15, 2007 11:53 pm Post subject: |
|
|
also, 0x0 is the same as 0, so this is an expected result. _________________
Unless otherwise noted, all code is untested.
Common Answers: 1.(Loops, Viruses, etc.) 2. Search 3.RTFM |
|
| Back to top |
|
 |
|