Jump to content

Recommended Posts

Posted

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.

Posted

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
Posted

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

Posted

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
Posted (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 by scriptkitty

AutoIt3, the MACGYVER Pocket Knife for computers.

Posted

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.

Posted

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 :D

Posted

$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?

Posted (edited)

smallest codification! (yet)

For $a = Asc("a") to Asc("z")
     $Letter = Chr($a)
Next

:D

Edit: Argh... How stupid... I didn't see the scriptkitty code :huh2:

Still... The shortest anyway.

Edited by ezzetabi
Posted

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) :D

AutoIt3, the MACGYVER Pocket Knife for computers.

Posted

This is about my smallest version, of course no display.

For $i=65 To 90; use chr($i) for your letter.
Next
The 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 :D

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)

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...