AutoHotkey Community

It is currently May 27th, 2012, 4:36 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 8 posts ] 
Author Message
PostPosted: March 5th, 2010, 12:17 am 
I checked the faq and the userguide, searched the forums, but couldn't figure this out. I basically would like to be able to add six or nine zeroes any time that I use a number, don't space and put an "m" or a "b" (for millions or billions) after the number, then trigger it with space, enter or tab. I appreciate any help you can offer!


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: March 5th, 2010, 12:30 am 
Offline

Joined: October 7th, 2006, 4:50 pm
Posts: 3157
Location: MN, USA
Sounds like a job for RegEx Powered Dynamic Hotstrings.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: March 5th, 2010, 3:56 am 
Offline

Joined: March 13th, 2009, 3:17 pm
Posts: 16
the most basic one would be
Code:
:?:m::
send,  000000
return

:?:b::
send, 000000000
return


personally I'd look at doing a ctrl + M or windows + M if someone doesn't put a way to detect previous char

Code:
#m:: ;<-- note the hash?
loop 2
{
Gosub tz
}
return

#b::
loop 3
{
Gosub tz
}
return

tz:
send, 000
return
;looping to save code as taught by my teachers :)


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: March 5th, 2010, 5:07 am 
Offline

Joined: March 10th, 2008, 12:55 am
Posts: 1907
Location: Minnesota, USA
Quote:
Code:
...
;looping to save code as taught by my teachers :)

you used 15 lines. (not counting blanks)
11 lines:
Code:
#m:: ;<-- note the hash?
loop 2
     Gosub tz
return

#b::
loop 3
     Gosub tz
return

tz:
     send, 000
return
6 lines:
Code:
#m:: ;<-- note the hash?
     send, 000000
return

#b::
     send, 000000000
return
2 lines:
Code:
#m:: send, 000000  ;<-- note the hash?
#b:: send, 000000000


ps: I would go with what jaco0646 said.

_________________
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: March 5th, 2010, 5:16 am 
Offline

Joined: November 28th, 2009, 4:45 am
Posts: 3089
I Had a lot of trouble getting this to work
I think this is the function you wanted
Code:
Top:
Input , New, L1 V,,1,2,3,4,5,6,7,8,9,0
Check:=Errorlevel
if (New="m") or (New="b")
  Goto CheckPrev
If (Check="Match")
  WasNum=1
Else 
  WasNum=0
Goto Top

CheckPrev:
If !WasNum
  Goto Top
If (New="m")
Send {Bs}000000
Else
Send {Bs}000000000
WasNum=0
Goto Top


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: March 5th, 2010, 5:48 am 
Offline

Joined: March 13th, 2009, 3:17 pm
Posts: 16
tidbit wrote:
Quote:
Code:
...
;looping to save code as taught by my teachers :)

you used 15 lines. (not counting blanks)
11 lines:
Code:
#m:: ;<-- note the hash?
loop 2
     Gosub tz
return

#b::
loop 3
     Gosub tz
return

tz:
     send, 000
return
6 lines:
Code:
#m:: ;<-- note the hash?
     send, 000000
return

#b::
     send, 000000000
return
2 lines:
Code:
#m:: send, 000000  ;<-- note the hash?
#b:: send, 000000000


ps: I would go with what jaco0646 said.



I know I did in this case, but when your making a big program it seriously helps!


Report this post
Top
 Profile  
Reply with quote  
 Post subject: Thanks
PostPosted: March 5th, 2010, 2:47 pm 
Just wanted to say thanks to everybody for their input on this, I really appreciate it. I am now going to experiment with all the suggestions and hopefully get it running. Thanks again.


Report this post
Top
  
Reply with quote  
 Post subject: You guys are good
PostPosted: March 5th, 2010, 2:58 pm 
That didn't take long, already got several of your solutions working, awesome time saver, thanks!!


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

All times are UTC [ DST ]


Who is online

Users browsing this forum: 0x150||ISO, rbrtryn and 66 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