Sign in to follow this  
Followers 0
not-me

Help Plz

6 posts in this topic

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



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

#3 ·  Posted (edited)

@/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

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


[center]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.[/center]

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

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

[center]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.[/center]

Share this post


Link to post
Share on other sites

Thank you all for ur relpy.

it works now

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  
Followers 0