Jump to content

A Rolling Alphabet Into A Var


Recommended Posts

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

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

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

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

Link to comment
Share on other sites

$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

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
Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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)

Link to comment
Share on other sites

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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...