Jump to content

Divide contents of a variable into 3 new variables?


Gabs
 Share

Recommended Posts

try somethin like this

$var = 'AA,BB,CC'
$split = stringsplit($var,",")
$a = $split[1]
$b = $split[2]
$c = $split[3]

--hope this helps

*****edit*****

or maybe

$var = 'AABBCC'
$a = StringLeft($var,2)
$b = StringMid($var,3,2)
$c = StringRight($var,2)
Edited by cdkid
AutoIt Console written in C#. Write au3 code right at the console :D_FileWriteToLineWrite to a specific line in a file.My UDF Libraries: MySQL UDF Library version 1.6 MySQL Database UDF's for AutoItI have stopped updating the MySQL thread above, all future updates will be on my SVN. The svn location is:kan2.sytes.net/publicsvn/mysqlnote: This will still be available, but due to my new job, and school hours, am no longer developing this udf.My business: www.hirethebrain.com Hire The Brain HireTheBrain.com Computer Consulting, Design, Assembly and RepairOh no! I've commited Scriptocide!
Link to comment
Share on other sites

try somethin like this

$var = AA,BB,CC
$split = stringsplit($var,",")
$a = $split[1]
$b = $split[2]
$c = $split[3]

--hope this helps

Hmm, but that requires me to be able to put in , signs in the variable? But the contents of the variable is generated from other methods. So i get it as AABBCC without any , signs. Is there any similar method but by cutting the string by telling a method after how many digits each cut should be?
Link to comment
Share on other sites

see my edit...it may help

AutoIt Console written in C#. Write au3 code right at the console :D_FileWriteToLineWrite to a specific line in a file.My UDF Libraries: MySQL UDF Library version 1.6 MySQL Database UDF's for AutoItI have stopped updating the MySQL thread above, all future updates will be on my SVN. The svn location is:kan2.sytes.net/publicsvn/mysqlnote: This will still be available, but due to my new job, and school hours, am no longer developing this udf.My business: www.hirethebrain.com Hire The Brain HireTheBrain.com Computer Consulting, Design, Assembly and RepairOh no! I've commited Scriptocide!
Link to comment
Share on other sites

Very nice, thank you very much! Really appriciated.

no prob :lmao:

--glad to help

AutoIt Console written in C#. Write au3 code right at the console :D_FileWriteToLineWrite to a specific line in a file.My UDF Libraries: MySQL UDF Library version 1.6 MySQL Database UDF's for AutoItI have stopped updating the MySQL thread above, all future updates will be on my SVN. The svn location is:kan2.sytes.net/publicsvn/mysqlnote: This will still be available, but due to my new job, and school hours, am no longer developing this udf.My business: www.hirethebrain.com Hire The Brain HireTheBrain.com Computer Consulting, Design, Assembly and RepairOh no! I've commited Scriptocide!
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...