Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Run external commands
#1
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.
Reply
#2
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....
Reply
#3
(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.

 The commands are " System" and " Shell Execute.

 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.

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.  Big Grin
Reply
#4
(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.

 The commands are " System" and " Shell Execute.

 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.

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.  Big Grin

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
Reply
#5
Well, is anyone here to teach me naalaa how it works?

Rent Laptops Toronto
Reply
#6
What do you need to know?
Reply
#7
I shall write some examples soon Smile

In this program, http://www.naalaa.com/community/showthread.php?tid=142 , I use shellexecute.
Reply
#8
'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");
shellexecute "open", f$, "", "", true

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.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)