Jump to content

Help Plz


not-me
 Share

Recommended Posts

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.

Link to comment
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 *

Link to comment
Share on other sites

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

  • Moderators

$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.

Link to comment
Share on other sites

  • Moderators

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.

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...