Jump to content
Sign in to follow this  
EdDyreen

Parameter Interpretation

Recommended Posts

EdDyreen

When u open up the Windows Terminal 'CMD', u can run a program from it &pass it parameters.

CMD will run the program &pass it any arguments as follows

Myprogram.EXE Parameter

Parameter << as parameter1

Myprogram.EXE "Parameter"

"Parameter" << as parameter1

Myprogram.EXE Para meter

Para << as parameter1

meter << as parameter2

Myprogram.EXE "Para meter"

"Para meter" << as parameter1

Myprogram.EXE mmmp"so/, "a" me"abb , "so/, "" me"

mmmp"so/, "a" me"abb << as parameter1

Myprogram.EXE mmmp"so/, "a" me" , "so/, "" me"

mmmp"so/, "a" me" << as parameter1

Myprogram.EXE mmmpso/, "a" me" , "so/, "" me"

mmmpso/, << as parameter1

I need my script to interpret parameters this way

$CmdLine[*] works exactly like that, but I can use it only for parameters being passed to my script

Not for parameters inside the script example:

$PAR = 'mmmp"so/,  "a"  me"abb  ,  "so/,  ""  me"'

CallSub ( $PAR )

Func CallSub ( $PAR )

    In here I want to split $PAR to

    'mmmp"so/,  "a"  me"abb     << as parameter1
    ,               << as parameter2
    "so/,  ""  me"          << as parameter3

EndFunc

I've played with regex but it's harder then i expected

In CMD script i would simply do

set "PAR=mmmp"so/,  "a"  me"abb  ,  "so/,  "" me"  "

For %%! in ( %PAR% ) do echo.%%~!

which gives me:

mmmp"so/, "a" me"abb << as parameter1

, << as parameter2

"so/, "" me" << as parameter3

Any suggestions ?


• Any number images • Images of any size • Any number of URLs • Any number of lines

Share this post


Link to post
Share on other sites
martin

Well I am fairly confused by that :D

Whay can't you call the function with parameters?

eg

CallSub($par1,$par2)

Func CallSub($a,$b,$c=-default)
etc

or pass an array to the function which is an easy way to have any number of parameters.

Edited by martin

Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.

Share this post


Link to post
Share on other sites
EdDyreen

Of course I can do it like that.

But I try to understand how 'CMD' which is written in C does it 'I believe it must be something not too complicated in C'.

&use this technique in every function.

Many console programs are not very happy if u use them like APP.EXE PARAMETER PARAMETER

Many prefer the syntax: APP.EXE /PARAMETER: "VALUE" /PARAMETER: "VALUE" /OPTIONAL_PARAMETER

I like that 2nd style but getting it to work is quite a challange...

In the end I wan't to be able to call a function like:

CallMySub ( 'ThisSub', '/Height: "VALUE" /Width: "VALUE" /restore' )

CallMySub will then Execute this command:

ThisSub ( $Height, $Width, $restore )

So why don't I simply use ThisSub ( $Height, $Width, $restore )

Because it is possible & I try to understand how 'CMD' does it.

Function CallMySub ( $SubRoutine, $Parameters = '' )

    $Sub_Depth += 1

    $Array_Pars = _StringExplode ( $Parameters, "/", 0 )

    $PAR_COUNT = UBound ( $Array_Pars )
    ;
    ReDim $Sub_Array[$Sub_Depth][$PAR_COUNT]
    ;
    $PAR_COUNT -= 1

    $Sub_Array[ $Sub_Depth - 1 ][0] = $SubRoutine

    For $Element_0 = 1 To $PAR_COUNT Step 1

        $Array_Par      = _StringExplode ( $Array_Pars[$Element_0], ':', 0 )
        ;
        $Par_COUNT_1    = UBound ( $Array_Par ) - 1

        For $Element_1 = 0 To $Par_COUNT_1 Step 1
            ;
            $PAR = $Array_Par[$Element_1]
            ;
            If $Element_1 = 0 Then
                ;
                $PAR_0 = $PAR
                $PAR_0 = StringStripWS ( $PAR_0, 8 )
                $PAR_0 = StringReplace ( $PAR_0, ',', '', 0, 2 )
                ;
                $Sub_Array[ $Sub_Depth - 1 ][$Element_0] = $PAR_0
                ;
            Else
                ;
                $PAR_1 = $PAR
                $PAR_1 = StringTrimLeft ( $PAR_1, StringInStr ( $PAR_1, '"', 2 ) )
                $PAR_1 = StringLeft ( $PAR_1, StringInStr ( $PAR_1, '"', 2, -1 ) - 1 )  
                ;
                $Sub_Array[ $Sub_Depth - 1 ][$Element_0] = $PAR_1
                ;
            EndIf
            ;
        Next
        ;
    Next

    Local $ArgArray[1] = [ 'CallArgArray' ]
    ;
    For $Element = 1 To $Par_COUNT Step 1
        ;
        ReDim $ArgArray[ $Element + 1 ]
        ;
        $ArgArray[$Element] = $Sub_Array[ $Sub_Depth - 1 ][$Element]
        ;
    Next
    ;
    Call ( $SubRoutine, $ArgArray )

    $Sub_Depth -= 1

EndFunc

This is how it is done in a CMD script 'take a close look at :PROC.PAR.FAST ()':

::Call ( :Suboutine star )
::
:: SJAB v137 beta
::
:: if /i ["@Suboutine"] neq [":CallMySub"] call @Suboutine @star
::
::INPUT:
:: @SubRoutine  STRING  Required;   SubRoutine that will be called
:: @star    STRING  Optional;   Parameters that will be passed to @SubRoutine
::
:: WARNING (
::
::  -Needs to stay on top of :CallMySub () since;
::  ;. This in no SubRoutine !
::
::  -Disables error handling for @SubRoutine since;
::  ;. Speed is important here !
::
::  -Cannot use :Debug since;
::  ;. This in not a SubRoutine !
::
::  -if %* contains "(" or ")" a normal if /i [""] == [""] () construction fails !
::  ;) This is solved by using if /i [""] == [""]
:: )
::
::(
    ::set "Debug.Sub=:Call"
    ::(
        ::%Debug.Define% echo. &echo.inside ::Call star: &echo.%*
    ::)

    ::%Debug.Define% echo.PROC PAR
    ::(
        @set "FirstPARAM=%1"

        ::%Debug.Define% echo. FirstPARAM=!FirstPARAM!_
    ::)

    ::%Debug.Define% echo.VALID
    ::(
        @if not defined FirstPARAM echo. :( not defined %%1 [ERROR] &pause &exit 1

        ::%Debug.Define% echo. FirstPARAM=!FirstPARAM!_
    ::)

    ::%Debug.Define% echo.Perform
    ::(
        shift &if /i ["!FirstPARAM!"] neq ["CallMySub"] (
            ::
            echo.>nul

            set /a Sub.Depth += 1
            call set Sub.!Sub.Depth!.Name=:%%0

            ::%Debug.Define% echo. call :%* &%Debug.Pause%
            echo.>nul
        )
        if /i ["!FirstPARAM!"] neq ["CallMySub"] call :%* &set /a Sub.Depth -= 1 &goto :eof
    ::)
::)

:CallMySub ( :Suboutine star )
::
:: SJAB v1.35 beta
::
:: call @Suboutine @star with error handling
::
::INPUT:
:: @SubRoutine  STRING  Required;   SubRoutine that will be called
:: @Parameters  STRING  Optional;   Parameters that will be passed to @SubRoutine
::
:: WARNING (
::
::  -Cannot use :Debug since;
::  ;( :CallMySub is a dependency of :Debug !
::
::  -Cannot use %Debug.Equals% since;
::  ;( :CallMySub is a dependency of %Debug.Equals% !
::
:: )
::
::(
    ::set "Debug.Sub=:CallMySub"
    ::(
        ::if /i ["!Debug.Sub!"] == [":CallMySub"] echo. &echo.inside :CallMySub star: &echo.%*
    ::)

    set /a Sub.Depth += 1

    set "Par.AsIS=" &( for /l %%! in ( 0, 1, !Par.C! ) do set "Par.%%!=" ) &set /a Par.C = -1

    :CallMySub.LOOP_0 ()
    ::(
        call set CallMySub.b=%%1
        shift

        ::%Debug.Define% echo. CallMySub.b=!CallMySub.b!_
        if defined CallMySub.b (
            ::
            set /a Par.C += 1

            if !Par.C! gtr 0 if defined Par.AsIS (
                ::
                set "Par.AsIS=!Par.AsIS! !CallMySub.b!"

            ) else  set "Par.AsIS=!CallMySub.b!"

            set Par.!Par.C!=!CallMySub.b!

            ::%Debug.Define% echo. Par.!Par.C!=!CallMySub.b!_
            echo.>nul

            goto :CallMySub.LOOP_0
        )
    ::)

    set "Sub.!Sub.Depth!.Name=:!Par.0!"
    set "Sub.!Sub.Depth!.Par.C=!Par.C!"

    for /l %%! in ( 1, 1, !Par.C!
    ) do (
        set "Sub.!Sub.Depth!.Par.%%!=!Par.%%!!"
        ::
        if defined Sub.!Sub.Depth!.Par.AsIS (
            ::
            set "Sub.!Sub.Depth!.Par.AsIS=!Sub.%Sub.Depth%.Par.AsIS! !Par.%%!!"

        ) else  set "Sub.!Sub.Depth!.Par.AsIS=!Par.%%!!"
    )
    ::if /i ["!Debug.Sub!"] == [":CallMySub"] for /l %%! in ( 1, 1, !Par.C! ) do echo. Sub.!Sub.Depth!.Par.%%!=!Sub.%Sub.Depth%.Par.%%!!_

    ::if /i ["!Debug.Sub!"] == [":CallMySub"] echo. call !Sub.%Sub.Depth%.Name! !Sub.%Sub.Depth%.Par.AsIS! &%Debug.Pause%
    call !Sub.%Sub.Depth%.Name! !Sub.%Sub.Depth%.Par.AsIS!

    ( for %%! in ( Par.AsIS Use ) do set "Sub.!Sub.Depth!.%%!=" ) &for /l %%! in ( 1, 1, !Sub.%Sub.Depth%.Par.C! ) do set "Sub.!Sub.Depth!.Par.%%!="

    set /a Sub.Depth -= 1
::
::if /i ["!Debug.Sub!"] == [":CallMySub"] %Debug% "outside :CallMySub" &%Debug.Pause%
goto :eof
::)

:Par.AsIS.Unset
::
:: SJAB v1.35 beta
::
::(
    ::%Debug% "inside :Par.AsIS.Unset"

    if defined Par.AsIS (
        ::
        if defined Par.AsIS.UnsetVar (
            ::
            set "?=!Par.AsIS!"

            ::%Debug.Define% echo.?=!?!_
            echo.>nul

            ::%Debug.Define% echo.Par.AsIS.UnsetVar=!Par.AsIS.UnsetVar!
                            call set "Par.AsIS=%%Par.AsIS: !Par.AsIS.UnsetVar!=%%"

            ::%Debug.Define% echo.Par.AsIS=!Par.AsIS!_
            if ["!?!"] == ["!Par.AsIS!"]    call set "Par.AsIS=%%Par.AsIS:!Par.AsIS.UnsetVar! =%%"

            ::%Debug.Define% echo.Par.AsIS=!Par.AsIS!_
            if ["!?!"] == ["!Par.AsIS!"]    call set "Par.AsIS=%%Par.AsIS:!Par.AsIS.UnsetVar!=%%"

            ::%Debug.Define% echo.Par.AsIS=!Par.AsIS!_
            echo.>nul
        )
    )
::
goto :eof
::)

:PAR.SHIFT.Defined
::
:: SJAB v1.35 beta
::
:: Shifts Variables inside Array Par.C
::
:: uses call, no advanced debug
::
::(
    ::set "Debug.Sub=:PAR.SHIFT.Defined"
    ::(
        ::%Debug% "inside :PAR.SHIFT.Defined"& %Debug% " Par.C=!Par.C!"& %Debug.Define% for /l %%a in ( 1, 1, !Par.C! ) do echo. Par.%%a=!Par.%%a!_
    ::)

    ::%Debug% "PERFORM" &%Debug.Define% %Debug.Pause%
    ::(
        set /a é = 0
        :PAR.SHIFT.Defined.LOOP
        ::(
            set /a é += 1
            if not defined Par.!é! (
                ::
                for /l %%! in ( !é!, 1, !Par.C!
                ) do (
                    set /a ? =%%! + 1
                    call set "Par.%%!=%%Par.!?!%%"
                    set "Par.!?!="
                )
                set /a Par.C    -= 1
                set /a é   -= 1
            )
            if !é! lss !Par.C! goto :PAR.SHIFT.Defined.LOOP
        ::)

        ::%Debug% " Par.C=!Par.C!"& %Debug.Define% for /l %%a in ( 1, 1, !Par.C! ) do echo. Par.%%a=!Par.%%a!_
    ::)
::
::%Debug% "outside :PAR.SHIFT.Defined" &%Debug.Define% %Debug.Pause%
goto :eof
::)

:PROC.PAR.FAST ()
::
:: SJAB v137 beta
::
:: Process :CallMySub () @Par.(@Number) to fixed, option, normal &rest parameters
:: @Par.FIX, @Par.NORM &@Par.REST will be dequoted if even
::
::INPUT:
:: @Par.FIX         STRING  Optional;   if @PAR.(@Number) = '/' &@STRING &':'   then    @STRING = @PAR.(@Number + 1)
:: @Par.OPT         STRING  Optional;   if @PAR.(@Number) = '/' &@STRING    then    @STRING = @PAR.(@Number)
:: @Par.NORM        STRING  Optional;   if @PAR.(@Number) = @STRING         then    @STRING = @PAR.(@Number)
:: @Par.REST        STRING  Optional;                           @STRING = @PAR.(@Number)
::
:: @Par.(@Number)   BYVAL   Internal;   from :CallMySub ()
::
:: WARNING (
::
::  -Uses call since;
::  ;. Speed is important here !
::
::  -Cannot use SetLocal since;
::  ;( Parameters may contain Special characters &cannot use :EndLocal.Prepare.VARs () since it depends on :PROC.PAR.* () !
::
::  -if u want to use '/par:    "par"' use :PROC.PAR.STABLE ()
::  ;.
::
::  -@Par.(@Number) will be unset when processed &become unavailable to the calling routine !
::  ;.
:: )
::
::(
    ::set "Debug.Sub=!Sub.%Sub.Depth%.Name!"
    ::(
        ::%Debug% "" "inside !Sub.%Sub.Depth%.Name! () Par.AsIS:" &echo.!Par.AsIS!_
        set "Sub.!Sub.Depth!.Use=:PROC.PAR.FAST ()"
    ::)

    ::%Debug% "PROC PAR"
    ::(
        ::%Debug.Equals% for %%! in ( Par.FIX Par.OPT Par.NORM Par.REST ) do echo. %%!=!%%!!_
    ::)

    ::%Debug% "VALID"
    ::(
        ::%Debug.Equals% for %%! in ( Par.FIX Par.OPT Par.NORM Par.REST ) do echo. %%!=!%%!!_
    ::)

    ::%Debug% /Debug.Pause "Perform"
    ::(
        if defined Par.FIX (

            ::%Debug% "Par.FIX=!Par.FIX!"
            for %%b in ( !Par.FIX!
            ) do (

                ::%Debug% /Debug.Pause "b=%%b"
                set "%%b="

                set /a Processed.Par.FIX = 0
                set "PROC.PAR.C="
                for /l %%a in ( 1, 1, !Par.C!
                ) do (

                    ::%Debug% "Par.C=!Par.C!"
                    if !Processed.Par.FIX! lss 1 (
                        ::
                        if defined PROC.PAR.C (
                            ::
                            set "PROC.PAR.C="

                        ) else (

                            ::%Debug% " if /i [""/%%b:""] == [""!Par.%%a!""]"
                            if /i ["/%%b:"] == ["!Par.%%a!"] (
                                ::
                                set /a Processed.Par.FIX = 1

                                set /a PROC.PAR.C= %%a + 1 &for %%! in ( !PROC.PAR.C! ) do set "Par.AsIS.UnsetVar=!Par.%%!!"

                                ::%Debug.Equals% echo. set %%b=!Par.AsIS.UnsetVar!
                                set "%%b=!Par.AsIS.UnsetVar!"

                                ::%Debug.Equals% echo. set "Par.AsIS.UnsetVar=!Par.%%a! !Par.AsIS.UnsetVar!"
                                set "Par.AsIS.UnsetVar=!Par.%%a! !Par.AsIS.UnsetVar!"
                                %Par.AsIS.Unset%

                                ::%Debug.Equals% echo. Par.AsIS=!Par.AsIS!
                                set "Par.!PROC.PAR.C!="
                                set "Par.%%a="

                                ::%Debug.Equals% %Debug.Pause%
                                %PAR.SHIFT.Defined%
                            )
                        )
                    )
                )
                ::%Debug.Equals% echo. %%b=!%%b!_
                echo.>nul
            )
            ::%Debug.Equals% echo. Par.AsIS=!Par.AsIS!_ &%Debug.Pause%
            echo.>nul
        )

        if defined Par.OPT (

            ::%Debug% "Par.OPT=!Par.OPT!"
            for %%b in ( !Par.OPT!
            ) do (

                ::%Debug% " Par.C=!Par.C!_"
                set "%%b="

                for /l %%a in ( 1, 1, !Par.C!
                ) do (

                    ::%Debug% " if /i [""/%%b""] == [""!Par.%%a!""]"
                    if /i ["/%%b"] == ["!Par.%%a!"] (
                        ::
                        set "%%b=/%%b"
                        set "Par.AsIS.UnsetVar=!Par.%%a!" &%Par.AsIS.Unset% &set "Par.%%a="
                        %PAR.SHIFT.Defined%

                        ::%Debug.Equals% ( if defined Par.AsIS (set ?=!Par.AsIS:^"=""!) else set "?=" ) &%Debug% " ""%%b=!%%b!""" " Par.AsIS=!?!_" &(echo.)
                        echo.>nul
                    )
                )
                ::%Debug.Equals% echo. %%b=!%%b!_
                echo.>nul
            )
            ::%Debug.Equals% echo. Par.AsIS=!Par.AsIS!_ &%Debug.Pause%
            echo.>nul
        )

        if defined Par.NORM (

            ::%Debug% "Par.NORM=!Par.NORM!"
            set /a PROC.PAR.C= 0
            for %%a in ( !Par.NORM!
            ) do (
                set "%%a="
                set /a PROC.PAR.C += 1

                ::%Debug.Equals% call set ?=%%Par.!PROC.PAR.C!%%&%Debug% " Par.!PROC.PAR.C!=!?!"
                if defined Par.!PROC.PAR.C! (

                    for %%! in ( !PROC.PAR.C! ) do set "Par.AsIS.UnsetVar=!Par.%%!!"

                    ::%Debug.Equals% ( if defined Par.AsIS (set ?=!Par.AsIS:^"=""!) else set "?=" ) &%Debug% /Debug.Pause " Par.AsIS=!?!_" &(echo.)
                    %Par.AsIS.Unset%& set "Par.!PROC.PAR.C!="

                    ::%Debug.Equals% ( if defined Par.AsIS (set ?=!Par.AsIS:^"=""!) else set "?=" ) &%Debug% /Debug.Pause " Par.AsIS=!?!_" &(echo.)
                    >nul (echo.)

                    ::%Debug.Equals% ( if defined Par.AsIS (set ?=!Par.AsIS:^"=""!) else set "?=" ) &%Debug% /Debug.Pause " Par.AsIS=!?!_" &(echo.)
                    set "%%a=!Par.AsIS.UnsetVar!"
                )
                ::%Debug.Equals% echo. %%a=!%%a!_
                echo.>nul
            )
            ::%Debug.Equals% echo. Par.AsIS=!Par.AsIS!_ &%Debug.Pause%
            %PAR.SHIFT.Defined%
        )

        if defined Par.REST (

            ::%Debug% "Par.REST=!Par.REST!"
            set "!Par.REST!="

            for /l %%? in ( 1, 1, !Par.C! ) do for %%! in ( !Par.REST! ) do set "%%!=!%%!!!Par.%%?!"

            ::%Debug.Equals% echo.!Par.REST!=!%Par.REST%!_ &%Debug.Pause%
            for %%! in ( !Par.REST! ) do %DeQuote.IfEven% %%! &if defined %%! set %%!=!%%!:""=^"!

            ::%Debug.Equals% echo.!Par.REST!=!%Par.REST%!_ &%Debug.Pause%
            set "Par.AsIS=" &( for /l %%! in ( 1, 1, !Par.C! ) do set "Par.%%!=" ) &set "Par.C="

            ::%Debug.Equals% echo. Par.AsIS=!Par.AsIS!_ &%Debug.Pause%
            echo.>nul
        )

        if defined Par.AsIS %DeQuote.BeginSpace% Par.AsIS
        ::%Debug.Equals% echo. Par.AsIS=!Par.AsIS!_ &%Debug.Pause%

        for %%! in (

            !Par.FIX!
            !Par.NORM!
            !Par.REST!

        ) do (
            if defined %%! %Dequote.IfEven% %%!

            ::%Debug.Equals% echo. %%!=!%%!!_ &%Debug.Pause%
            echo.>nul
        )

        for %%! in ( FIX OPT NORM REST ) do set "Par.%%!="
    ::)
::
::%Debug% /Debug.Pause "outside !Sub.%Sub.Depth%.Name! ()"
goto :eof ()
::)

All that code enables me to call a function in cmd with the syntax:

for %%! in ( PQMagicPro8.ISS ) do %ExeThisAPP% /FullPathFile: "!FullPath.STAND!\Install.CMD" /Message: " ""Install: %%!"" " /DontWait /ScreenSwitchMin /Parameters: "/Action: Install /APP: "%%!" "
Edited by EdDyreen

• Any number images • Images of any size • Any number of URLs • Any number of lines

Share this post


Link to post
Share on other sites
EdDyreen

The previous AU3 function I posted works but it gets confused when it has to:

/Height: "Value""with , some really bizarre "syntax" " /Width: "..." /....

it should give me this:

$Height = "Value""with , some really bizarre "syntax" "

but it chokes on the "" symbols i can't use replace since i don't believe CMD uses that method

and replace is not a reliable way to do this.

CMD gives u the impression it is really easy though :huggles:

I will solve it :D

Edited by EdDyreen

• Any number images • Images of any size • Any number of URLs • Any number of lines

Share this post


Link to post
Share on other sites
martin

The previous AU3 function I posted works but it gets confused when it has to:

/Height: "Value""with , some really bizarre "syntax" " /Width: "..." /....

it should give me this:

$Height = "Value""with , some really bizarre "syntax" "

but it chokes on the "" symbols i can't use replace since i don't believe CMD uses that method

and replace is not a reliable way to do this.

CMD gives u the impression it is really easy though :huggles:

I will solve it :D

Passing parameters to a program from the command line is exactly the same whether the program is written in C or AutoIt or any language. But the functions in C receive parameters the same as functions in AutoIt. Parameters passed to a program from the command line are treated as space separated lists but ignoring spaces between quotation marks. So if you have

/Height: "Value""with , some really bizarre "syntax"

then you are passing 2 parameters or you have to parse the $CmdLineRaw . The way the parameters are extracted is up to the programmer, so if you want to have a function operate in the same way then you just pass it one long string with all the parameters and sort out out from there.

But what's the point? If you want to do it because you have an unknown number of parameters then passing an array is simpler.


Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.

Share this post


Link to post
Share on other sites
EdDyreen

Passing parameters to a program from the command line is exactly the same whether the program is written in C or AutoIt or any language. But the functions in C receive parameters the same as functions in AutoIt. Parameters passed to a program from the command line are treated as space separated lists but ignoring spaces between quotation marks. So if you have

/Height: "Value""with , some really bizarre "syntax"

then you are passing 2 parameters or you have to parse the $CmdLineRaw . The way the parameters are extracted is up to the programmer, so if you want to have a function operate in the same way then you just pass it one long string with all the parameters and sort out out from there.

But what's the point? If you want to do it because you have an unknown number of parameters then passing an array is simpler.

You are right there is no point :huggles:

but I do have to corrigate on your /Height: "Value""with , some really bizarre "syntax" comment.

If you count /Height: as the first parameter then there are 2 parameters but i meant the other part

if it were:

/Height: "Value""with , some really bizarre " syntax"

then you would have been right about beeing it two parameters however

/Height: "Value""with , some really bizarre "syntax"

really is only one parameter, let me explain:

"

<quoting is on any spaces will be ignored from now on

Value"

<quoting is off any spaces will end this parameter from now on

"with , some really bizarre

<quoting is on any spaces will be ignored from now on

"syntax

<quoting is off any spaces will end this parameter from now on

"

<quoting is on any spaces will be ignored from now on

We encountered an eol :D

Edited by EdDyreen

• Any number images • Images of any size • Any number of URLs • Any number of lines

Share this post


Link to post
Share on other sites
martin

You are right there is no point :huggles:

but I do have to corrigate on your /Height: "Value""with , some really bizarre "syntax" comment.

If you count /Height: as the first parameter then there are 2 parameters but i meant the other part

if it were:

/Height: "Value""with , some really bizarre " syntax"

then you would have been right about beeing it two parameters however

/Height: "Value""with , some really bizarre "syntax"

really is only one parameter, let me explain:

"

<quoting is on any spaces will be ignored from now on

Value"

<quoting is off any spaces will end this parameter from now on

"with , some really bizarre

<quoting is on any spaces will be ignored from now on

"syntax

<quoting is off any spaces will end this parameter from now on

"

<quoting is on any spaces will be ignored from now on

We encountered an eol :D

If you have

/Height: "Value""with , some really bizarre "syntax"

then that is two parameters because there is a space after /Height:

If you pass that as a paremeter list to an AutoIt script and look at $CmdLine[0] you will see there are 2 parameters. As I said, if you want to treat it as one parameter then you have to parse the whole parameter string ($CmdLineRaw).


Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.

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  

×