Jdurant Posted May 14, 2004 Share Posted May 14, 2004 What I'm trying to do here is to get a function to input into a var each letter of the alphabet ie: Send, %varalphy% where varalphy = A at first and then B the next time and then C the time after that and so on. Link to comment Share on other sites More sharing options...
bshoenhair Posted May 14, 2004 Share Posted May 14, 2004 Not quite sure exactly what you are trying to do but you could use a loop with the StringMid function if you want to enter each letter seperately. Link to comment Share on other sites More sharing options...
ghettochild Posted May 14, 2004 Share Posted May 14, 2004 try checking out the count examples Link to comment Share on other sites More sharing options...
brett Posted May 14, 2004 Share Posted May 14, 2004 Not quite sure exactly what you are trying to do but you could use a loop with the StringMid function if you want to enter each letter seperately. Does this help? $ABC = "ABCDEFGHIJKLMNOPQRSTUVWXYZ" $Num = 0 While $Num <= 26 $Letter = StringMid( $ABC, $Num, 1) MsgBox(0, "Next Letter is: ", $Letter) $Num = $Num + 1 WEnd -Brett Link to comment Share on other sites More sharing options...
Jdurant Posted May 14, 2004 Author Share Posted May 14, 2004 well, that has the general idea of what I was going for. basiclly repeat, 26 send, %var% endrepeat which would output: var = A the first time var = B the 2nd time var = C the 3rd time Link to comment Share on other sites More sharing options...
brett Posted May 14, 2004 Share Posted May 14, 2004 u could just change the msgbox to Send $ABC = "ABCDEFGHIJKLMNOPQRSTUVWXYZ" $Num = 0 While $Num <= 26 $Letter = StringMid( $ABC, $Num, 1) Send ($Letter) $Num = $Num + 1 WEnd -Brett Link to comment Share on other sites More sharing options...
scriptkitty Posted May 14, 2004 Share Posted May 14, 2004 (edited) MsgBox(1,"Hello Everyone","I will now count from A to Z") $x="" For $i=1 To 26 tooltip(chr($i+64)) sleep(500) Next Edited May 14, 2004 by scriptkitty AutoIt3, the MACGYVER Pocket Knife for computers. Link to comment Share on other sites More sharing options...
scriptkitty Posted May 14, 2004 Share Posted May 14, 2004 or $alpha=StringSplit("A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z",",") For $i=1 To $alpha[0] MsgBox(1,"Letter "& $i,$alpha[$i],1) Next ;or $alpha="ABCDEFGHIJKLMNOPQRSTUVWXYZ" While $alpha<>"" MsgBox(1,"Alternate Method",StringLeft($alpha,1),1) $alpha=StringTrimLeft($alpha,1) Wend AutoIt3, the MACGYVER Pocket Knife for computers. Link to comment Share on other sites More sharing options...
Jdurant Posted May 14, 2004 Author Share Posted May 14, 2004 Thanks guys, I'll give these a try and see which one works out best. Again thanks!! Link to comment Share on other sites More sharing options...
trids Posted May 17, 2004 Share Posted May 17, 2004 I would instinctively go with ScriptKitty's Chr() option .. but I see StringSplit has a cool feature that allows you to split undelimited strings..$asLetter = StringSplit("ABCDEFGHIJKLMNOPQRSTUVWXYZ","")Cool hey Link to comment Share on other sites More sharing options...
sykes Posted May 17, 2004 Share Posted May 17, 2004 $alpha = StringSplit("a|b|c|d|e|f|g|h|i|j|k|l|m|n|o|p|q|r|s|t|u|v|w|x|y|z", "|") $count = 0 While 1 $count = $count + 1 If $count > 26 then exitloop MsgBox(4096, "Results", $alpha[$count]) Wend We have enough youth. How about a fountain of SMART? Link to comment Share on other sites More sharing options...
ezzetabi Posted May 17, 2004 Share Posted May 17, 2004 (edited) smallest codification! (yet) For $a = Asc("a") to Asc("z") $Letter = Chr($a) Next Edit: Argh... How stupid... I didn't see the scriptkitty code Still... The shortest anyway. Edited May 17, 2004 by ezzetabi Link to comment Share on other sites More sharing options...
scriptkitty Posted May 17, 2004 Share Posted May 17, 2004 only because I put in a sleep. For $i=1 To 26 tooltip(chr($i+64)) sleep(500) Next tooltip display goes too fast without it, This is about my smallest version, of course no display. For $i=65 To 90; use chr($i) for your letter. Next smallest codification! (yet) AutoIt3, the MACGYVER Pocket Knife for computers. Link to comment Share on other sites More sharing options...
ezzetabi Posted May 18, 2004 Share Posted May 18, 2004 This is about my smallest version, of course no display. For $i=65 To 90; use chr($i) for your letter. NextThe objective was "Rolling Alphabet into a var" so you script is not valid! Without telling that you're code isnt the shortest (yet) I'll change it to make it valid For $i=65 To 90 $l=chr($i) Next Now it is ok... Al the alphabet rolling in a var in only 31 bytes... ok... 33 if you are using @crlf(s) Link to comment Share on other sites More sharing options...
scriptkitty Posted May 18, 2004 Share Posted May 18, 2004 ok, got me on that one. Dang technicalities. Think I read the questions? AutoIt3, the MACGYVER Pocket Knife for computers. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now