I got it working with Glen’s code but I needed to compile my code from the terminal with gcc instead of compiling it in Xcode.
I really appreciate your help and every- ones help who replied. It is all useful information. Thank you! JB > On May 8, 2017, at 1:32 PM, Mike Bonner via use-livecode > <use-livecode@lists.runrev.com> wrote: > > If you are in terminal, and in the folder where your executable is, and you > type > > /yourexecutablename arg1 arg2 > does it do what you expect? (note the preceding dot . which means to start > at the working directory) > > If the file is set to executable by you, it should work. If you type the > command without the preceding dot slash ./ and if its not in the path, it > won't work, so you DO need to be explicit as to where it is. (hence the ./ > it defines exactly where to find the file so being in the set PATH isn't > necessary) > > If it DOES work that way from the command line, then in your script you can > a) set the folder to the location of the file, and then b) do a > shell("./theExe arg1 arg2") and it should work. Or for a) you can give a > full path specification to the location of the file. > > On Mon, May 8, 2017 at 12:54 PM, JB via use-livecode < > use-livecode@lists.runrev.com> wrote: > >> Hi Mike, >> >> Thank you for the info. >> >> The dictionary for Shell states it needs to work >> from the Terminal to work correctly with Shell so >> I have been doing everything from the Terminal at >> this point. I was trying to figure out how to write >> it properly in the Terminal so I could use similar >> code with the Shell. >> >> JB >> >> >>> On May 8, 2017, at 11:45 AM, Mike Bonner via use-livecode < >> use-livecode@lists.runrev.com> wrote: >>> >>> Seems to me, if its the compiled version, you shouldn't need to use >> "open" >>> at all. >>> >>> a simple >>> get shell("path/to/executable argument1 argument2") >>> If I understand what I read about "open" enough, it expects a file, that >>> will be opened in another app, like in Marks example. (whatever.c opens >>> xcode) >>> >>> If you want to experiment with open, you could try the following.. >>> >>> open -a /path/to/your/app /path/to/a/dummy/file/to/open --args arg1 arg2 >>> >>> I'm guessing that if you can format this right, it'll report the name of >>> the dummy file, and arg1 and arg2 as you expect. >>> >>> But since you just want to pass arguments to your compiled program, I am >>> pretty sure you just need to use shell() and call it directly with the >>> arguments as part of the call. >>> >>> >>> On Mon, May 8, 2017 at 12:05 PM, JB via use-livecode < >>> use-livecode@lists.runrev.com> wrote: >>> >>>> That is a typo. >>>> >>>> In fact I tried every way and every >>>> place within the open script and if >>>> it is written different the code is not >>>> executed and I get and error. >>>> >>>> JB >>>> >>>> >>>>> On May 8, 2017, at 10:57 AM, Mark Wieder via use-livecode < >>>> use-livecode@lists.runrev.com> wrote: >>>>> >>>>> On 05/08/2017 10:36 AM, JB via use-livecode wrote: >>>>> >>>>>> The file executes properly and the message is printed >>>>>> showing I did not enter any arguments even though I >>>>>> did try to and then it prints the file name and path like >>>>>> I told it to from argv[0]. >>>>>> >>>>>> JB >>>>> >>>>> In your original post you said "-args". The correct syntax is "--args" >>>> (with two dashes rather than one), so if that's not a typo in your >> original >>>> email, try correcting that and see what happens. >>>>> >>>>> -- >>>>> Mark Wieder >>>>> ahsoftw...@gmail.com >>>>> >>>>> _______________________________________________ >>>>> use-livecode mailing list >>>>> use-livecode@lists.runrev.com >>>>> Please visit this url to subscribe, unsubscribe and manage your >>>> subscription preferences: >>>>> http://lists.runrev.com/mailman/listinfo/use-livecode >>>>> >>>> >>>> >>>> _______________________________________________ >>>> use-livecode mailing list >>>> use-livecode@lists.runrev.com >>>> Please visit this url to subscribe, unsubscribe and manage your >>>> subscription preferences: >>>> http://lists.runrev.com/mailman/listinfo/use-livecode >>>> >>> _______________________________________________ >>> use-livecode mailing list >>> use-livecode@lists.runrev.com >>> Please visit this url to subscribe, unsubscribe and manage your >> subscription preferences: >>> http://lists.runrev.com/mailman/listinfo/use-livecode >>> >> >> >> _______________________________________________ >> use-livecode mailing list >> use-livecode@lists.runrev.com >> Please visit this url to subscribe, unsubscribe and manage your >> subscription preferences: >> http://lists.runrev.com/mailman/listinfo/use-livecode >> > _______________________________________________ > use-livecode mailing list > use-livecode@lists.runrev.com > Please visit this url to subscribe, unsubscribe and manage your subscription > preferences: > http://lists.runrev.com/mailman/listinfo/use-livecode > _______________________________________________ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode