323 posts
Location
Boston, MA
Posted 21 June 2015 - 07:23 AM
Hai.
My question is how to autodetect "arguments" in a string. So, if my string was edit "this is a test" how would I get the shell.run function to get the arguments between the two? I dunno if that makes any sense at all
Thanks for any and all help
2679 posts
Location
You will never find me, muhahahahahaha
Posted 21 June 2015 - 07:44 AM
sherll.run can work in several ways:
1. shell.run("edit","this","is","a","test")
2. shell.run("edit this is a test")
If you want "this is a test to be one argument, then do this:
shell.run("edit \"this is a test\"")
323 posts
Location
Boston, MA
Posted 21 June 2015 - 07:46 AM
The thing is it's user input in a string. So the string could be something with a billion spaces, but the program just doesn't run it for some reason.
If the string is edit "this is a test" it works just fine.
If the string is "this is a test" or this is a test it doesnt.
323 posts
Location
Boston, MA
Posted 21 June 2015 - 08:03 AM
Nevermind, I got it working.
2679 posts
Location
You will never find me, muhahahahahaha
Posted 21 June 2015 - 09:02 AM
Glad you did! Where did the problem lie?
323 posts
Location
Boston, MA
Posted 21 June 2015 - 10:51 AM
Glad you did! Where did the problem lie?
I seriously have no idea. I just futzed with it over and over again and then it worked. xD