Jump to content

My argument func isn't working anymore?


daslick
 Share

Recommended Posts

This is set up at the beginning of my program to find arguments....

dim $args = "", $howrun = ""
;Command line useage!
if $CmdLine[0] > 0 Then
            for $i = 1 to $CmdLine[0]
                Global $args = $args & " " & $CmdLine[$i]
            Next
    Select
        Case $args = "password"
            MsgBox(0,"","a")
        Case $args = "admin"
            ProcessClose("explorer.exe")
            Run("explorer.exe")
        Case $args = ""
        Case Else
            
    if $args = "password" then MsgBox(0,"A","FSA")
    if $args <> "password" then MsgBox(0,"ASDDAADADAADADAD",$args)
            $args = FileGetLongName($args, 1)
            _ra($args)
            Exit
    EndSelect
EndIf

Every time I run it with the arguments 'password' it doesn't msgbox(0,"","a") like it should, but it does MsgBox(0,"ASDDAADADAADADAD",$args) and tells me that $args = "password"... I don't get it. so $args = password but it doesn't?

Could some1 help me with this sloppy and, apparently, broken function?

Link to comment
Share on other sites

How can $arg <> "password" , wouldn't that mean $arg less than or greater than "password"?

Perhaps your'e looking for

If NOT $arg = "password" then ;whatever

(Sorry if I have that wrong)

Edited by BALA
[font="Comic Sans MS"]BA-LA[/font]http://ba-la.110mb.comJoin my community, CLICK HEREAlternative links to my site:http://www.ba-la.tkhttp://www.ba-la.co.nrContact me if you would like to help with some of my projects: joeythepirate@gmail.com
Link to comment
Share on other sites

You might want to look up operators in the help file.

Yeah, my previous BASIC experience messed me up.

Edited by BALA
[font="Comic Sans MS"]BA-LA[/font]http://ba-la.110mb.comJoin my community, CLICK HEREAlternative links to my site:http://www.ba-la.tkhttp://www.ba-la.co.nrContact me if you would like to help with some of my projects: joeythepirate@gmail.com
Link to comment
Share on other sites

  • Developers

don't you want something like this ?

Your for-next loop really build the content of $CommandLineRaw

Dim $args = "", $howrun = ""
;Command line useage!
For $i = 1 To $CmdLine[0]
    $args = $CmdLine[$i]
    Select
        Case $args = "password"
            MsgBox(0, "", "a")
        Case $args = "admin"
            ProcessClose("explorer.exe")
            Run("explorer.exe")
        Case $args = ""
        Case Else
            If $args = "password" Then MsgBox(0, "A", "FSA")
            If $args <> "password" Then MsgBox(0, "ASDDAADADAADADAD", $args)
            $args = FileGetLongName($args, 1)
            _ra ($args)
            Exit
    EndSelect
Next

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

  • Developers

Yeah, my previous BASIC experience messed me up.

nah ... basic always had the NotEqual <> for as long as I can remember ... and I am pretty sure I am older :)

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

nah ... basic always had the NotEqual <> for as long as I can remember ... and I am pretty sure I am older :)

In DarkBASIC and NT Batch Scripting for example it means less than or greater than, but since those are the only other BASIC-ish languages I know, I guess you're probably right. Well now I know, thanks.

[font="Comic Sans MS"]BA-LA[/font]http://ba-la.110mb.comJoin my community, CLICK HEREAlternative links to my site:http://www.ba-la.tkhttp://www.ba-la.co.nrContact me if you would like to help with some of my projects: joeythepirate@gmail.com
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...