AutoHotkey Community

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

All times are UTC [ DST ]




Post new topic Reply to topic  [ 12 posts ] 
Author Message
 Post subject: A_WishList
PostPosted: February 10th, 2012, 9:44 am 
A_ScriptDrive
A_LoopFileNameNoExt
A_LoopFileDirName, just folder name and not folder path

Thanks anyway.


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: February 10th, 2012, 2:16 pm 
Offline
User avatar

Joined: August 11th, 2004, 1:47 am
Posts: 5347
Location: UK
You can get most of that information with SplitPath.

_________________
GitHubScriptsIronAHK Contact by email not private message.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: February 10th, 2012, 3:39 pm 
polyethene wrote:
You can get most of that information with SplitPath.


You sound like a funny guy :D
Do you see that I'm posting in Wish List?
Of course its possible to get that info using SplitPath, its just a wish to have them as built in.


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: February 10th, 2012, 4:41 pm 
Offline
User avatar

Joined: August 11th, 2004, 1:47 am
Posts: 5347
Location: UK
Yes I do realise that but I believe it is counter-productive to have multiple ways of achieving the same result.

_________________
GitHubScriptsIronAHK Contact by email not private message.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: February 10th, 2012, 8:39 pm 
Offline

Joined: January 29th, 2009, 9:50 pm
Posts: 483
Location: Belgium
polyethene wrote:
Yes I do realise that but I believe it is counter-productive to have multiple ways of achieving the same result.

it is counter productive to do this splitpath in every function you make, just to get A_ScriptDrive.

still it is better to have result without doing anything.

_________________
Stopwatch emdkplayer
the code i post falls under the: WTFYW-WTFPL license


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: February 10th, 2012, 8:46 pm 
Online
User avatar

Joined: May 5th, 2007, 7:24 pm
Posts: 1240
Location: Seville, Spain
Code:
global A_ScriptDrive
SplitPath, A_ScriptFullPath,,,,, A_ScriptDrive
myfunc()

myfunc()
{
    msgbox %A_ScriptDrive%
}

_________________
fincs
Highly recommended: AutoHotkey_L (see why) (all my code snippets require it)
Formal request to polyethene - I support the unity of the AutoHotkey community
Get SciTE4AutoHotkey v3.0.00 (Release Candidate)
[My project list]


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: February 10th, 2012, 8:51 pm 
Offline

Joined: January 29th, 2009, 9:50 pm
Posts: 483
Location: Belgium
fincs wrote:
global A_ScriptDrive

why didn't i know i could do that??
i see this works in ahk_L must have missed that one.
Thx fincs.

_________________
Stopwatch emdkplayer
the code i post falls under the: WTFYW-WTFPL license


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: February 10th, 2012, 9:09 pm 
Offline

Joined: March 10th, 2008, 12:55 am
Posts: 1907
Location: Minnesota, USA
other A_'s that'd be nice (yes I realize workarounds have been posted for some of them. but I (and several others) think they'd be nice)

A_ ...
  • ScriptPID (it's annoying trying to get the pid of yur script with no GUI. it's fairly FAQ too)
  • ScriptHWND# (# could be the Gui number, if a GUI exists)
  • GuiWidth/Height (one that works outside the GuiSize label)
  • GuiX/Y (one that works outside GuiContextMenu)
  • Maybe something like A_LineCount, gets the number of lines in a variable and/or file.
  • ???

Several of these have workarounds, usually just 1-2 lines. but they are pretty common and could make things easier, instead of memorizing a dllcall or constantly getting the values.

_________________
rawr. be very afraid
*poke*
Note: My name is all lowercase for a reason.
"I think Bigfoot is blurry, that's the problem. It's not the photographer's fault, Bigfoot is blurry. So there's a large, out-of-focus monster roaming the countryside."


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: February 10th, 2012, 10:01 pm 
Offline

Joined: October 7th, 2006, 4:50 pm
Posts: 3157
Location: MN, USA
jaco0646 wrote:
AHK has over 100 constants :!:
I suggest that from now on, every proposal for a new constant must also propose an existing constant to delete. :twisted:


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: February 10th, 2012, 10:07 pm 
Offline

Joined: March 10th, 2008, 12:55 am
Posts: 1907
Location: Minnesota, USA
that makes as much sense as deleting a new function/command for every new one created, because we have over 100 of those too.
nothing wrong with built-in simplifications. AHK isn't known for being the tidiest language. It's known to be easy. if we can add simple methods for common things, why not?

btw, doesn't autoit have 1000's? although, they have #includes iirc. why doesn't AHK do that? Wasn't chris planning on making a Standard Lib that would be included with AHK? then simply include #include GUIConstants or FileConstants, or whatever.

Edit: my suggestion for the deletes: delete all the A_<time and date> stuff. we got formattime for that. that opens a good dozen or 2 slots. or delete formattime, since that is code-bloat for the a_ variables.

_________________
rawr. be very afraid
*poke*
Note: My name is all lowercase for a reason.
"I think Bigfoot is blurry, that's the problem. It's not the photographer's fault, Bigfoot is blurry. So there's a large, out-of-focus monster roaming the countryside."


Last edited by tidbit on February 10th, 2012, 10:13 pm, edited 2 times in total.

Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: February 10th, 2012, 10:09 pm 
Offline

Joined: October 7th, 2006, 4:50 pm
Posts: 3157
Location: MN, USA
See polyethene's second post.

EDIT: +1 to tidbit's suggestion on #Including constants.

Regarding the comparison of constants to functions, here are the definitions I'm working with.
  • A language is a tool. It is useful for the things it can do.
  • A function is a behavior. It adds to what a language can do.
  • A language is not a database. It is not useful for the information it stores.
  • A constant is a piece of data. Insofar as a language can retrieve data, that data does not add to what a language can do.
That doesn't mean a language should never store data, but it explains why constants should be strictly limited while functions should not.
Note that #Includes respect these definitions by separating data from the language.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: February 10th, 2012, 11:12 pm 
just me started to collect them here
http://www.autohotkey.com/forum/topic75 ... =constants

Don't like it very much though, atm you only need ahk.exe + script
if you had to copy a bunch of includes every time just to take a
fairly simple script with you that would annoy me personally (which is not a good criteria of course). anyway, just wanted to high light just me's project.


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

All times are UTC [ DST ]


Who is online

Users browsing this forum: Google [Bot] and 4 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