| View previous topic :: View next topic |
| Author |
Message |
mpennington Guest
|
Posted: Thu Mar 04, 2010 11:17 pm Post subject: Insert 6 zeros or 9 zeros with an m or b after a number |
|
|
| 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! |
|
| Back to top |
|
 |
jaco0646
Joined: 07 Oct 2006 Posts: 3113 Location: MN, USA
|
|
| Back to top |
|
 |
Byroboy
Joined: 13 Mar 2009 Posts: 16
|
Posted: Fri Mar 05, 2010 2:56 am Post subject: |
|
|
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 :)
|
|
|
| Back to top |
|
 |
tidbit
Joined: 09 Mar 2008 Posts: 1807 Location: Minnesota, USA
|
Posted: Fri Mar 05, 2010 4:07 am Post subject: |
|
|
| 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.
Even monkeys fall from trees. - Japanese proverb |
|
| Back to top |
|
 |
None
Joined: 28 Nov 2009 Posts: 3086
|
Posted: Fri Mar 05, 2010 4:16 am Post subject: |
|
|
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 |
|
|
| Back to top |
|
 |
Byroboy
Joined: 13 Mar 2009 Posts: 16
|
Posted: Fri Mar 05, 2010 4:48 am Post subject: |
|
|
| 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! |
|
| Back to top |
|
 |
mpennington Guest
|
Posted: Fri Mar 05, 2010 1:47 pm Post subject: Thanks |
|
|
| 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. |
|
| Back to top |
|
 |
mpennington Guest
|
Posted: Fri Mar 05, 2010 1:58 pm Post subject: You guys are good |
|
|
| That didn't take long, already got several of your solutions working, awesome time saver, thanks!! |
|
| Back to top |
|
 |
|