AutoHotkey Community

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

All times are UTC [ DST ]




Post new topic Reply to topic  [ 5 posts ] 
Author Message
PostPosted: March 2nd, 2006, 6:52 pm 
Offline

Joined: January 31st, 2006, 1:27 pm
Posts: 197
Location: truro, cornwall
ok first heres my script im having trouble with...

FormatTime, TimeString, , ss
StringTrimLeft, End, TimeString,1
StringReplace,Endnew,End,0,Random Text two
StringReplace,Endnew,End,1,Random Text one
StringReplace,Endnew,End,2,Random Text two
StringReplace,Endnew,End,3,Random Text three
StringReplace,Endnew,End,4,Random Text four
StringReplace,Endnew,End,5,Random Text five
StringReplace,Endnew,End,6,Random Text six
StringReplace,Endnew,End,7,Random Text seven
StringReplace,Endnew,End,8,Random Text eight
StringReplace,Endnew,End,9,Random Text nine
msgbox %Endnew%
return

i thought this text should generate the time in seconds ie "35" then trim it to last digit ie "5" then should replace 5 with... "Random Text five"

but it doesnt.. does anyone know why? i have made this using help file so have looked there!

any help greaty appritiated!!

thanks. Ralph!


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: March 2nd, 2006, 7:10 pm 
Offline

Joined: January 30th, 2006, 6:53 pm
Posts: 8
you need to make the Input variable and output the same.... i think :roll:

Code:
FormatTime, TimeString, , ss
StringTrimLeft, End, TimeString,1
StringReplace,End,End,0,Random Text two
StringReplace,End,End,1,Random Text one
StringReplace,End,End,2,Random Text two
StringReplace,End,End,3,Random Text three
StringReplace,End,End,4,Random Text four
StringReplace,End,End,5,Random Text five
StringReplace,End,End,6,Random Text six
StringReplace,End,End,7,Random Text seven
StringReplace,End,End,8,Random Text eight
StringReplace,End,End,9,Random Text nine
msgbox %End%
return


Report this post
Top
 Profile  
Reply with quote  
 Post subject: yey!
PostPosted: March 2nd, 2006, 7:13 pm 
Offline

Joined: January 31st, 2006, 1:27 pm
Posts: 197
Location: truro, cornwall
yr well clever thanks, why do they put 2 fields if they have to be the same tho?mow well who cares it works!!

thanks again :)


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: March 2nd, 2006, 7:31 pm 
Offline

Joined: January 30th, 2006, 6:53 pm
Posts: 8
Quote:
why do they put 2 fields if they have to be the same tho


usually you would make 2 separate variables, but in your case, you have multiple stringreplace's. So after the first one,

StringReplace,Endnew,End,0,Random Text two,

Your new input variable for the next stringreplace should be the output of your previous stringreplace. Make sense?

So in other words, you could have done it like this:
Code:

StringReplace,Endnew,End,0,Random Text two
stringReplace, endnew2, ENDNEW, random text three
stringreplace, endnew3, ENDNEW2, random text four



Report this post
Top
 Profile  
Reply with quote  
 Post subject: fanx
PostPosted: March 2nd, 2006, 7:56 pm 
Offline

Joined: January 31st, 2006, 1:27 pm
Posts: 197
Location: truro, cornwall
yeah i think i get it... (i thought i was clever till i started using ahk)

thank an i got another question now just posing it!

:)


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

All times are UTC [ DST ]


Who is online

Users browsing this forum: BrandonHotkey, Yahoo [Bot] and 10 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