Kivin Posted May 6, 2007 Share Posted May 6, 2007 Hi everyone! I just thinking, How can I spleet variable on parts? For example: $Variable = "123456789" ;Spleet $Var1 = "1" $Var2 = "23" $Var3 = "3456" $Var4 = "7" $Var5 = "89" Thanks for any idea. Link to comment Share on other sites More sharing options...
Valuater Posted May 6, 2007 Share Posted May 6, 2007 Maybe.. $Variable = "123456789" $Split = StringSplit($Variable, "") $Var1 = $Split[1] $Var2 = $Split[2] & $Split[3] $Var2 = $Split[3] & $Split[4] & $Split[5] & $Split[6] $Var2 = $Split[7] $Var2 = $Split[8] & $Split[9] ;Split the same as below $Var1 = "1" $Var2 = "23" $Var3 = "3456" $Var4 = "7" $Var5 = "89" 8) Link to comment Share on other sites More sharing options...
xcal Posted May 6, 2007 Share Posted May 6, 2007 Or another way... $Variable = "123456789" $Var1 = StringMid($Variable, 1, 1) $Var2 = StringMid($Variable, 2, 2) $Var3 = StringMid($Variable, 3, 4) $Var4 = StringMid($Variable, 7, 1) $Var5 = StringMid($Variable, 8, 2) ; just for display For $i = 1 To 5 MsgBox(0, '', Eval('Var' & $i)) Next How To Ask Questions The Smart Way Link to comment Share on other sites More sharing options...
herewasplato Posted May 6, 2007 Share Posted May 6, 2007 ...illustrates that there is more than one way to skin a cat, although I have little use for a skinned cat. [size="1"][font="Arial"].[u].[/u][/font][/size] Link to comment Share on other sites More sharing options...
xcal Posted May 6, 2007 Share Posted May 6, 2007 But if the skinned cat could code... How To Ask Questions The Smart Way Link to comment Share on other sites More sharing options...
herewasplato Posted May 7, 2007 Share Posted May 7, 2007 But if the skinned cat could code......that would be great, but it might be a copy cat: http://www.autoitscript.com/forum/index.ph...st&p=339164 [size="1"][font="Arial"].[u].[/u][/font][/size] 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