AutoHotkey Community

It is currently May 27th, 2012, 11:26 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 2 posts ] 
Author Message
PostPosted: August 1st, 2005, 3:22 pm 
Offline

Joined: March 16th, 2005, 10:33 pm
Posts: 969
Location: Frisia
I'm not sure whether this is really a bug, but, try this:

Code:
afile=pathtoafile.txt
;if afile contains txt ; works
if afile contains .txt ; works <--
;if (afile contains txt) ; works
;if (afile contains .txt) ; throws an error
;if (afile contains txt) and (if InStr(FileExist(afile),D) = 1) ; works
;if (afile contains .txt) and (if InStr(FileExist(afile),D) = 1) ; throws an error
   msgbox, 0, ok, the file seems to be a text file
else
   msgbox, 0, error, the file is not a text file


Why is the dot excepted only without the braces? And is it possible to do something like this?

Code:
if (afile contains .txt,:\) and (if InStr(FileExist(afile),D) = 1) ; a 'valid' path to a text file


I tried escaping, but that didn't make no difference. What characters can be used?

_________________
Image mirror 1mirror 2mirror 3ahk4.me • PM or Image


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: August 1st, 2005, 5:16 pm 
Offline

Joined: March 2nd, 2004, 3:36 pm
Posts: 10720
The operators "contains", "between", "in", and "is" are not yet supported in expressions. Something like them will probably be added eventually, at which time they'll be added to the operator table or the list of built-in functions.


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: No registered users and 2 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group