Jump to content
Sign in to follow this  
Cyber

I need help for do parameters function

Recommended Posts

Cyber

Hi!

i need a function for convert string to array parameter

identical to $cmdline

:P

help me please

func _parameter($text)

..

..

return $cmdlineArray

endfunc


Console Browse: Navigate on the WEB in a textual consoleMultiPing!: Show computer on the lan and/or show the local/remote task, ALL animated!KillaWin: Event executingCryptPage: Crypt your webpage and show only with key

Share this post


Link to post
Share on other sites
Authenticity

What is the expected delimiter? space, comma? Try StringSplit()

Share this post


Link to post
Share on other sites
Cyber

Space and Comma

Parm0 "parameter one" parametertwo

=

parm0

"parameter one"

parametertwo

stringsplit is less usefull


Console Browse: Navigate on the WEB in a textual consoleMultiPing!: Show computer on the lan and/or show the local/remote task, ALL animated!KillaWin: Event executingCryptPage: Crypt your webpage and show only with key

Share this post


Link to post
Share on other sites
Cyber

Ok i resolve it....

command parameter "parameter 2" parameter3 parameter4 "parameter 5" ecc....

#include "array.au3"


func _parametersplit($t)


if StringInStr($t, """") > 0 Then
    
    Dim $array[1]
    $array[0] = 0

    $a = StringSplit($t, """")
    $d = $a
    For $i=1 to $a[0]
        
        
        
        
        if Mod($i,2) > 0 Then
            $t = StringSplit($a[$i], " ")
            
            for $j = 1 to $t[0]
                if $t[$j] <> "" Then
                    $array[0] = $array[0]+1
                    ReDim $array[$array[0]+1]
                    
                    $array[$array[0]] = $t[$j]
                EndIf
            Next
        Else
            $array[0] = $array[0]+1
            ReDim $array[$array[0]+1]
            
            $array[$array[0]] = $a[$i]          
        EndIf
    Next
Else
    $array = StringSplit($t, " ")
EndIf



return $array
Edited by Cyber

Console Browse: Navigate on the WEB in a textual consoleMultiPing!: Show computer on the lan and/or show the local/remote task, ALL animated!KillaWin: Event executingCryptPage: Crypt your webpage and show only with key

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.