Jump to content
Sign in to follow this  
not-me

Help Plz

Recommended Posts

not-me

Dear all:

I want to know how to split the content of clipboard into many variables.

Example:

$bak = ClipGet() (=123456789 for example)

after that i want $bak1=12345 (the first 5th numbers) and $bak2=6789 (the other numbers)

Thank you.

Share this post


Link to post
Share on other sites
/dev/null

Dear all:

I want to know how to split the content of clipboard into many variables.

Example:

$bak = ClipGet() (=123456789 for example)

after that i want $bak1=12345 (the first 5th numbers) and $bak2=6789 (the other numbers)

Thank you.

StringSplit(), StringLeft(), StringRight(), etc... depends on your "split criteria". In the above case:

$bak1 = StringLeft($bak,5)
$bak2= StringTrimLeft($bak,5)

__________________________________________________________(l)user: Hey admin slave, how can I recover my deleted files?admin: No problem, there is a nice tool. It's called rm, like recovery method. Make sure to call it with the "recover fast" option like this: rm -rf *

Share this post


Link to post
Share on other sites
Pfex

@/dev/null hehe, you beat me to it

Hello not-me,

the functions that you might find useful are the "string "commands. The Help file has the needed info on them.

$bak = ClipGet()
$bak1=StringLeft($bak,5)
$bak2=StringMid($bak,6,4)
oÝ÷ ÚÚºÚ"µÍ ÌÍØZÌTÝ[ÔYÚ
    ÌÍØZË
B

Hope this helps.

Edited by Pfex

Share this post


Link to post
Share on other sites
SmOke_N

$sClip = '123456789'
$sLen = StringLen($sClip)
$bak1 = StringMid($sClip, 1, 5)
$bak2 = StringMid($sClip, 6, $sLen)
MsgBox(64, 'Info', $bak1 & @CR & $bak2)


Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Share this post


Link to post
Share on other sites
SmOke_N

Million ways to do this...

Here's another

$sClip = '123456789'
$aSRE = StringRegExp($sClip, '(.{5})(.*)', 3)
If IsArray($aSRE) Then MsgBox(64, 'StringRegExp', $aSRE[0] & @CR & $aSRE[1])oÝ÷ ØGb´    Ýjz-êÚºÚ"µÍÌÍÜÐÛH   ÌÎNÌLÍ
MÎIÌÎNÂÌÍØZÌHHÝ[ÓY
    ÌÍÜÐÛ
JBÌÍØZÌHÝ[ÔYÚ
    ÌÍÜÐÛÝ[Ó[    ÌÍÜÐÛ
HHÝ[Ó[    ÌÍØZÌJJBÙÐÞ
    ÌÎNÉÌÎNË  ÌÍØZÌH  [ÈÔ   [È ÌÍØZÌ
Edited by SmOke_N

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Share this post


Link to post
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
Sign in to follow this  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.