AutoHotkey Community

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

All times are UTC [ DST ]




Post new topic Reply to topic  [ 4 posts ] 
Author Message
PostPosted: November 2nd, 2005, 5:03 pm 
Offline

Joined: September 24th, 2004, 3:00 pm
Posts: 814
Location: Germany
Hi,

is it by design, that the following lines give the same result?

Code:
StringLeft, qn_LoopRegname, A_LoopRegname, % qn_tempPos-1

Code:
StringLeft, qn_LoopRegname, A_LoopRegname, qn_tempPos-1


I thought expressions have always to use % if not only variables are allowed.

_________________
Tekl


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: November 2nd, 2005, 6:42 pm 
Offline
User avatar

Joined: August 11th, 2004, 1:47 am
Posts: 5347
Location: UK
They will not give the same results. This is because the first one which starts with a % is an expression so it's like using a variable.
The second one will give you an error because Count in StringLeft needs to be a number, variable or expression (or else it becomes 0).


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: November 2nd, 2005, 8:27 pm 
Offline

Joined: March 2nd, 2004, 3:36 pm
Posts: 10720
In StringLeft's count parameter, the help says, "The number of characters to extract, which can be an expression." Any parameter that is documented to be expression-capable doesn't need the percent+space prefix (however, you may include it if you wish).


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: November 3rd, 2005, 8:39 am 
Offline

Joined: September 24th, 2004, 3:00 pm
Posts: 814
Location: Germany
Thanks for clarifying. I thought "... can be an expression" only tells, that expressions are *accepted* at this parameter. Maybe my bad english let me think this. ;-)

_________________
Tekl


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

All times are UTC [ DST ]


Who is online

Users browsing this forum: No registered users and 20 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