Função Strslipt

Advanced Macro Recorder/Editor.

Moderator: Pulover

ricowars
Posts: 8
Joined: 17 Jun 2021, 08:37

Função Strslipt

Post by ricowars » 19 Jul 2021, 08:00

Hello, i need analyse clipboard for get strings and replace to variables ex:
clipboard: "Whats your name"
take 3 variables
variable1 = "whats"
variable2 = "your"
variable3 = "name"
I Know a code from autohotkey:
clipboard:= "Whats your name"
StringSplit , arr , Clipboard , %a_space%
msgbox %arr3%
:dance:

this code works but in plataform pulover's macro creator not works
:(
obs: sorry my english, i am Brazilian
image.png
image.png (20.25 KiB) Viewed 2204 times

User avatar
Pulover
Posts: 612
Joined: 29 Sep 2013, 19:51
Location: Brazil
Contact:

Re: Função Strslipt

Post by Pulover » 19 Jul 2021, 08:16

Não se deve usar sinal de porcentagem em variáveis dentro de expressões.

You should not enclose variables in percent signs inside expressions.
Rodolfo U. Batista
Pulover's Macro Creator - Automation Tool (Recorder & Script Writer)

ricowars
Posts: 8
Joined: 17 Jun 2021, 08:37

Re: Função Strslipt

Post by ricowars » 19 Jul 2021, 10:02

image.png
image.png (38.7 KiB) Viewed 2191 times
Ainda assim não funciona, me dê um exemplo por favor

give me example please

ricowars
Posts: 8
Joined: 17 Jun 2021, 08:37

Re: Função Strslipt

Post by ricowars » 19 Jul 2021, 15:00

Please, read all topic

User avatar
Pulover
Posts: 612
Joined: 29 Sep 2013, 19:51
Location: Brazil
Contact:

Re: Função Strslipt

Post by Pulover » 19 Jul 2021, 16:37

You've got a few things wrong:
1. You are setting clipboard to an invalid string, you should enclose it in quotes.
2. The parameters for the function are wrong. First comes the input, then the delimiter (which I believe you want A_Space, instead of A_Tab).
3. I can see that arr is your output so it should be in the Output Variable field.
4. StrSplit creates an Object Array which cannot be accessed as %arr1% (you can use StringSplit command if that's what you want) so in this case you can use % before the MsgBox parameter to make it an expression and use [] to read the content of the array.

Check the code below. Btw, you could have checked the example in the help file/website for arrays.

Code: Select all

[PMC Globals]|None||
[PMC Code v5.4.0]|F5||1|Window,2,Fast,0,1,InputThenPlay,-1,-1,1|1|Macro1
Context=None|
Groups=Start:1
1|[Assign Variable]|clipboard := "what's your name"|1|0|Variable|Expression||||1|
2|[Pause]||1|300|Sleep|||||2|
3|StrSplit|arr := clipboard, a_space|1|0|Function|||||3|
4|[MsgBox]|% arr[1]|1|0|MsgBox|0||||4|

Rodolfo U. Batista
Pulover's Macro Creator - Automation Tool (Recorder & Script Writer)

ricowars
Posts: 8
Joined: 17 Jun 2021, 08:37

Re: Função Strslipt

Post by ricowars » 20 Jul 2021, 14:21

Thanks Rodolfo! It worked

Post Reply

Return to “Pulovers Macro Creator”