How to send command to terminal ?

Questions regarding syntax

How to send command to terminal ?

Postby Argonaut » Wed Sep 29, 2010 2:25 am

Hi
in windows and vb6 i use
shell

but i dont now how into linux ?? :?:

other thing in vb6 i use code
app.path
to get app location but how to on kbasic ? :?:

thanks :)
Argonaut
 
Posts: 11
Joined: Tue Sep 28, 2010 7:50 am

Re: How to send command to terminal ?

Postby pappawinni » Wed Sep 29, 2010 7:01 pm

Hi Jason

i am Windows User so .. I am not really shure what works for you.. but suggest
shell("ls")
should work and
? Application.Path
or
? Application.directoryName
pappawinni
 
Posts: 192
Joined: Tue Jan 19, 2010 11:27 pm
Location: Germany

Re: How to send command to terminal ?

Postby Argonaut » Thu Sep 30, 2010 1:09 am

Hi
Application.Path
;) thanks that's work but why
.Path
not load in function when write code ?

and for shell any other solution ?
Argonaut
 
Posts: 11
Joined: Tue Sep 28, 2010 7:50 am

Re: How to send command to terminal ?

Postby pappawinni » Thu Sep 30, 2010 7:19 pm

Please Jason the Argonaut,

use some more words to explain what went wrong or what you need.
The quality of answers also depends on the quality of the questions.

What should this tell me ?
"not load in function when write code ?"
I have less then no idea ... and this is already rounded up.

and what is wrong with
shell("whatever")
as you ask for other solutions.

When I was starting to work as programmer... many years ago... in our office we had a banner on the wall.
It read " If all else fails, read instructions "
That is what I do.
pappawinni
 
Posts: 192
Joined: Tue Jan 19, 2010 11:27 pm
Location: Germany

Re: How to send command to terminal ?

Postby Argonaut » Sat Oct 02, 2010 5:28 am

Code: Select all
Please Jason the Argonaut,

Sorry but I'm not Jason ;)
What should this tell me ?
"not load in function when write code ?"
I have less then no idea ... and this is already rounded up.

look
Image

Image

.path not load in menu why ?

shell("whatever")

i now its simple but i dont now how to work in linux , i think must learn some command to use in konsole :oops:
Argonaut
 
Posts: 11
Joined: Tue Sep 28, 2010 7:50 am

Re: How to send command to terminal ?

Postby Slowdown » Sat Oct 02, 2010 7:36 am

Code: Select all
  Print Application.DirectoryName()
  Print Application.Path()

Look at the output, and yes both of them will work ;)
Regards
Slowdown for now i'm back
Slowdown
 
Posts: 347
Joined: Sat May 02, 2009 6:48 pm
Location: Netherlands

Re: How to send command to terminal ?

Postby pappawinni » Sat Oct 02, 2010 8:03 am

Hi Argonaut

the .path is for VB6 compatibility and obviously
application.directoryname is doing the same.

This is what I read from the manual
http://www.kbasic.com/doku.php?id=static_objects#application

/Winni

BTW: what's your nationality ? Greek ?
Pappa makes everything what otherwise none likes :)
pappawinni
 
Posts: 192
Joined: Tue Jan 19, 2010 11:27 pm
Location: Germany

Re: How to send command to terminal ?

Postby Argonaut » Sat Oct 02, 2010 11:15 am

Look at the output, and yes both of them will work

thank you , i know that ;)

what's your nationality ? Greek ?

:D Why are you interested ? I'm not Greek ... Sorry I'm someone else ... thank you ;)
Argonaut
 
Posts: 11
Joined: Tue Sep 28, 2010 7:50 am

Re: How to send command to terminal ?

Postby dollyknot » Thu Nov 25, 2010 2:02 pm

Hello

I am also having problems getting external programs to work. I have been trying to get the command 'shell' to do something with no success.

Using yabasic I got this little program to work

#!/usr/bin/yabasic
input "what time limit?"t$
print t$
a$ = "-fcp crafty -tc "+t$+" -scp crafty"
system("xboard " +a$)


basically it evokes the chess gui 'xboard' with the chess engine 'crafty' the point being is I can set a time limit to the game.

Can someone please write how I would do the same thing in kbasic.

To the coder of the kbasic language, if I can get this to work, I will most certainly buy the professional version.

Regards

Peter

http://dollyknot.com
Regards,

Peter.

http://dollyknot.com
dollyknot
 
Posts: 17
Joined: Thu Nov 25, 2010 1:39 pm

Re: How to send command to terminal ?

Postby Slowdown » Thu Nov 25, 2010 2:51 pm

@dollyknot
Code: Select all
Private Sub Form_OnOpen()
  Dim ReturnCode as Integer
  Dim TimeCode as String
  TimeCode = Inputbox ("Time limit ")
  ? TimeCode
  ReturnCode = shell(application path/application 'program parameters', TRUE/FALSE)
End Sub

See the documentation for more details about the shell command.
@Bernd, brought to you a new customer :)
Regards
Slowdown for now i'm back
Slowdown
 
Posts: 347
Joined: Sat May 02, 2009 6:48 pm
Location: Netherlands

Next

Return to Coding Questions

cron