![]() |
Run external commands - Printable Version +- NaaLaa Forum (http://www.naalaa.com/community) +-- Forum: NaaLaa (http://www.naalaa.com/community/forumdisplay.php?fid=1) +--- Forum: Questions and discussions (http://www.naalaa.com/community/forumdisplay.php?fid=3) +--- Thread: Run external commands (/showthread.php?tid=151) |
Run external commands - Keybong - 06-11-2019 Hi, I'm new to NaaLaa. I like it alot... So my question is: Is there any way to run external programs or shell commands from within NaaLaa? The program I'm working on would benefit greatly from that capability. RE: Run external commands - Aurel - 06-12-2019 It seems that the more I use them, the less they do . I get this feeling that there is a mysterious hacker somewhere that is trying to control the world's computers. I hope that some day someone creates a user friendly computer, so that I can have my hobby back. ha ha ...nice thinking Rick I have same feeling sometimes.... RE: Run external commands - Keybong - 06-12-2019 (06-12-2019, 03:43 PM)Rick3137 Wrote: There are 2 NaaLaa commands that try to do this, but I have tried to use them and can't get anywhere. LOL. I found out about system early this morning when I got my linux back up and running. Last night before I posted this, I only knew about 'run'. It would give me errors when I tried to run an external program or shell command. I want to create a shell/program launcher, so I need to be able to execute things externally, otherwise there would be no point. Before I saw this response, I was about to write a qb64 program that would encapsulate the naalaa program, intercept a text string from the encapsulated NaaLaa program, run it through a SELECT CASE block with a long list of selector strings, to perform a 'SHELL _DONTWAIT' command (running the desired program/shell script/ external command/etc.). that probably would have done it, but It would have been way sloppier than just using NaaLaa itself. Thanks for letting me know, saved me a bunch of 2 language nonsense. ![]() RE: Run external commands - Keybong - 06-13-2019 (06-12-2019, 10:18 PM)Keybong Wrote:(06-12-2019, 03:43 PM)Rick3137 Wrote: There are 2 NaaLaa commands that try to do this, but I have tried to use them and can't get anywhere. Well it turns out that I couldnt get Shell Execute to work... and system actually opened up the program twice, along with a command prompt window. lol RE: Run external commands - oneworldrentalca - 11-15-2019 Well, is anyone here to teach me naalaa how it works? Rent Laptops Toronto RE: Run external commands - cvirus - 11-15-2019 What do you need to know? RE: Run external commands - Marcus - 11-17-2019 I shall write some examples soon ![]() In this program, http://www.naalaa.com/community/showthread.php?tid=142 , I use shellexecute. RE: Run external commands - Marcus - 11-17-2019 'system' is easy to use, but it opens a command prompt whenever you call it: Code: system "dir & echo Hello World & pause" If you want to launch a program it's better to use 'shellexecute'. If the following program is executed from the c:\N6 directory, it will launch the naalaa ide and wait until you close it: Code: shellexecute "open", "NED6.exe", "", "", true If you set the last parameter to false, your program will continue running without waiting for the new instance of the ide to close. This piece of code let's the user select an exe file to run: Code: f$ = openfile("exe"); The third parameter can be used for setting the directory where the program you want to execute is located. It's not needed in the example above, since f$ itself will contain the full path. The fourth one is for sending parameters to the program. |