AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

POS := InStr(Haystack, Needle) : a contradictory result

 
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Ask for Help
View previous topic :: View next topic  
Author Message
rousni



Joined: 23 Mar 2006
Posts: 41

PostPosted: Mon Oct 15, 2007 8:21 pm    Post subject: POS := InStr(Haystack, Needle) : a contradictory result Reply with quote

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
View user's profile Send private message
Superfraggle



Joined: 02 Nov 2004
Posts: 846
Location: London, UK

PostPosted: Mon Oct 15, 2007 10:31 pm    Post subject: Reply with quote

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
View user's profile Send private message MSN Messenger
engunneer



Joined: 30 Aug 2005
Posts: 6772
Location: Pacific Northwest, US

PostPosted: Mon Oct 15, 2007 11:53 pm    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Ask for Help All times are GMT
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group