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 

mising "A_decade" and maybe "A_century"
Goto page Previous  1, 2, 3
 
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Wish List
View previous topic :: View next topic  
Author Message
Chris
Site Admin


Joined: 02 Mar 2004
Posts: 10467

PostPosted: Tue Nov 23, 2004 12:46 pm    Post subject: Reply with quote

jack wrote:
if you decide to implement something, please can you make it an installation-wide default that the include file is off? further, can you also add some option so that a script can say 'do not use any system include file'?

i can forsee problems when i give a script to somebody else who uses an automatically-included file that breaks something in my script.
That's another important disadvantage I didn't realize until now. Thanks. Overall, I'm leaning toward not adding this feature because the small benefits it delivers don't seem worth the costs in confusion and compatibility issues, and the fact that the registry or an INI file would have to be used to determine whether the feature is enabled or disabled.

BoBo wrote:
Thx for sharing that. Unfortunately the Errorlevel delivers only a single value ... That's why I've used two variables in my above sample.
I missed that, thanks for clarifying.

Stefan wrote:
but i donīt want to always insert
StringLeft, Century, A_YYYY, 2
That's a good example. You probably know that you could just remember to include something like the following at the top of every script:
#Include D.ahk
... which will set up the default constants you use regularly.
Back to top
View user's profile Send private message Send e-mail
BoBo
Guest





PostPosted: Tue Nov 23, 2004 1:18 pm    Post subject: Reply with quote

WhateverScript.ahk
Code:
!F9::
   {
   RunWait, AutoHotkey.exe /r /f /ErrorStdOut Default.ahk A_Century,,Hide
   A_Century = %Errorlevel%
   MsgBox, Current month:`t%A_Mon%`nCurrent century:`t%A_Century%
   Return
   }



Default.ahk
Code:
Goto, %1%

A_YWeek:
ExitApp, xxx

A_Century:
StringLeft, Century, A_Year, 2
Century ++
ExitApp, %Century%


Tested Very Happy
Uncommented Rolling Eyes
Still motivated Razz

@ Stefan
Geht doch Wink
Back to top
BoBo
Guest





PostPosted: Tue Nov 23, 2004 1:26 pm    Post subject: Reply with quote

I wrote:
Quote:
Unfortunately the Errorlevel delivers only a single value

Which won't stop you - if its an integer. To handover a bunch of vars (even alpha numeric ones) like this

abc|def|ghi
or
12|my sister|...

won't work. Crying or Very sad

In such a case you've to use EnvVars or the Clipboard to pass the outcome to the inital script. Embarassed
Back to top
BoBo
Guest





PostPosted: Tue Nov 23, 2004 6:24 pm    Post subject: Reply with quote

@ Stefan
Added "non Chris certificated" AHK variable: A_Decade Wink
to unofficial default.ahk Cool

WhateverScript.ahk

Quote:
!F9::
{
RunWait, AutoHotkey.exe /r /ErrorStdOut Default.ahk A_Century,,Hide
A_Century = %Errorlevel%
RunWait, AutoHotkey.exe /r /ErrorStdOut Default.ahk A_Decade,,Hide
A_Decade = %Errorlevel%
MsgBox, Current month:`t%A_Mon%`nCurrent century:`t%A_Century%`nCurrent decade:`t%A_Decade%
Return
}


Default.ahk

Quote:
Goto, %1%

A_Decade:
StringMid, A_Decade, A_Year, 3, 2
A_Decade += 10
A_Decade /= 10
ExitApp, %A_Decade%


A_Century:
StringLeft, A_Century, A_Year, 2
A_Century ++
ExitApp, %A_Century%


Still uncommented Exclamation Confused Sad Crying or Very sad
Back to top
williamsharkey



Joined: 06 Oct 2007
Posts: 52
Location: Philadelphia

PostPosted: Mon Dec 17, 2007 10:12 pm    Post subject: Reply with quote

One way to do a "default" include is to change your template to have an include in it.
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 -> Wish List All times are GMT
Goto page Previous  1, 2, 3
Page 3 of 3

 
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