Sign in to follow this  
Followers 0
daslick

My argument func isn't working anymore?

9 posts in this topic

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?

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

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

Share this post


Link to post
Share on other sites

that should do the same thing...

regardless, "case $args = "password" is not working even though $args = "password"

Can some1 please helP? I've rewritten this like 5 times

Share this post


Link to post
Share on other sites

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

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

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

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

Share this post


Link to post
Share on other sites

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

Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

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 :)

Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
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

Share this post


Link to post
Share on other sites

Thanks a lot Jbd... I don't quite understand what I did wrong... I do like how u got the arguments though.

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  
Followers 0