Console app, output to console?
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller
Console app, output to console?
I'm trying to make a console app, it'll run on linux but I'm testing on linux and windows.
In the Dictionary it says that write "Stuff here" to stdout should output the text on the console, but it doesn't work (On Windows nor Linux)
Tried running with -ui, and chmodded to 755 on linux.
On Linux it freezes, I get a new blank line and then nothing, on Windows I get a blank line and the it quits back to prompt.
What am I missing here?
In the Dictionary it says that write "Stuff here" to stdout should output the text on the console, but it doesn't work (On Windows nor Linux)
Tried running with -ui, and chmodded to 755 on linux.
On Linux it freezes, I get a new blank line and then nothing, on Windows I get a blank line and the it quits back to prompt.
What am I missing here?
Marcus
-
- VIP Livecode Opensource Backer
- Posts: 9834
- Joined: Sat Apr 08, 2006 7:05 am
- Location: Los Angeles
- Contact:
Re: Console app, output to console?
I'm surprised stdOut isn't working, but you may try simply "put" without a destination to do that as well, e.g.:
Code: Select all
put "Hello Console"
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
Re: Console app, output to console?
That doesn't work either.
I tried putting it in the card script, and the stack script, but nothing outputs.
I've tried with the last version as well as the latest version.
I tried putting it in the card script, and the stack script, but nothing outputs.
I've tried with the last version as well as the latest version.
Marcus
-
- VIP Livecode Opensource Backer
- Posts: 9834
- Joined: Sat Apr 08, 2006 7:05 am
- Location: Los Angeles
- Contact:
Re: Console app, output to console?
Do you know if the app is even running? Perhaps you could try writing some output to a file to check that.
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
Re: Console app, output to console?
Could I ask for a favor?
Can you make a .livecode file that compiles and works with outputting to the console/CLI on your computer, that I can download and look at?
Maybe I'm missing something subtle or silly, it would also let me confirm that it's me and not the LC compiler.
Can you make a .livecode file that compiles and works with outputting to the console/CLI on your computer, that I can download and look at?
Maybe I'm missing something subtle or silly, it would also let me confirm that it's me and not the LC compiler.
Marcus
-
- VIP Livecode Opensource Backer
- Posts: 9834
- Joined: Sat Apr 08, 2006 7:05 am
- Location: Los Angeles
- Contact:
Re: Console app, output to console?
This should work - just put this into the stack script of a standalone and build for Linux:
Code: Select all
on startup
put "Hello Console"
end startup
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
Re: Console app, output to console?
I opened a new stack, put that in and compiled, didn't work on Windows but worked on Linux...
I swear I tried that before and it didn't work..
Thank you, FourthWorld! (Sorry, I can't remember your name, I'm horrible with names..)
I swear I tried that before and it didn't work..
Thank you, FourthWorld! (Sorry, I can't remember your name, I'm horrible with names..)
Marcus
-
- VIP Livecode Opensource Backer
- Posts: 9834
- Joined: Sat Apr 08, 2006 7:05 am
- Location: Los Angeles
- Contact:
Re: Console app, output to console?
Windows is finicky; best left behind to hasten its declining market share. (Pardon my Linux fanboyism)trenatos wrote:I opened a new stack, put that in and compiled, didn't work on Windows but worked on Linux...
I swear I tried that before and it didn't work.
More seriously, sometimes on Win the trick is to set the value of LC's shellCommand global property to the full path of the shell you're using. Let me know if that doesn't do it for you.
I put it in my sigline to help others as bad with names as I am.Thank you, FourthWorld! (Sorry, I can't remember your name, I'm horrible with names..)
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
Re: Console app, output to console?
Haha that's what I get for not paying attention, thank you Richard!
Yeah I like Linux better than Windows too, but I also like lots of games on Windows, and most of my clients use it, so there's no escaping it. lol
Yeah I like Linux better than Windows too, but I also like lots of games on Windows, and most of my clients use it, so there's no escaping it. lol
Marcus
-
- VIP Livecode Opensource Backer
- Posts: 9834
- Joined: Sat Apr 08, 2006 7:05 am
- Location: Los Angeles
- Contact:
Re: Console app, output to console?
Just install KDE on their systems and tell 'em it's Windows 9 - all they'll know is it's faster, leaner on resources, more usable, and has as much app compatibility as Win RT.trenatos wrote:Yeah I like Linux better than Windows too, but I also like lots of games on Windows, and most of my clients use it, so there's no escaping it. lol
Keep me posted on how the shellCommand thing works out.
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
Re: Console app, output to console?
Heh, tempted to do that. lol
So now stdout works on Linux, but it still doesn't work on Windows.
That's not an issue for me, this application is for Linux only, but the Dictionary does say that it should work with Windows, so I may have stumbled on a bug in the latest rc2 release?
So now stdout works on Linux, but it still doesn't work on Windows.
That's not an issue for me, this application is for Linux only, but the Dictionary does say that it should work with Windows, so I may have stumbled on a bug in the latest rc2 release?
Marcus
Re: Console app, output to console?
Hey Richard, since you're a Linux guy and programmer, maybe you could help me out on this one too:
The program I'm making, I'd like it to be able to run in the background, both when run manually and on server boot, any pointers on that?
The program I'm making, I'd like it to be able to run in the background, both when run manually and on server boot, any pointers on that?
Marcus
-
- VIP Livecode Opensource Backer
- Posts: 3581
- Joined: Mon Jan 22, 2007 7:36 am
- Location: Berkeley, CA, US
- Contact:
Re: Console app, output to console?
stdout on Windows is weird - the console doesn't count. You can, however, send stderr to the console, IIRC.
Try launching the app from a commandline and redirect the output to a text file.
At any rate, writing to stdout works on linux. Put does not go to stdout.
Try launching the app from a commandline and redirect the output to a text file.
At any rate, writing to stdout works on linux. Put does not go to stdout.
PowerDebug http://powerdebug.ahsoftware.net
PowerTools http://www.ahsoftware.net/PowerTools/PowerTools.irev
PowerTools http://www.ahsoftware.net/PowerTools/PowerTools.irev
-
- VIP Livecode Opensource Backer
- Posts: 9834
- Joined: Sat Apr 08, 2006 7:05 am
- Location: Los Angeles
- Contact:
Re: Console app, output to console?
Where does it go?mwieder wrote:Put does not go to stdout.
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
-
- VIP Livecode Opensource Backer
- Posts: 3581
- Joined: Mon Jan 22, 2007 7:36 am
- Location: Berkeley, CA, US
- Contact:
Re: Console app, output to console?
stdout goes to a different pipe on Windows. The console is connected to stderr, but not to stdout. If you redirect the stdout output you can catch it in a file.
Ah. I see I answered a different question from the one you asked.
I'm not sure where put goes. In the IDE it goes to the message box unless it's redirected.
I don't know what happens in a standalone... maybe it's one of those uncaught messages that are trapped by a frontscript in the IDE.
Ah. I see I answered a different question from the one you asked.
I'm not sure where put goes. In the IDE it goes to the message box unless it's redirected.
I don't know what happens in a standalone... maybe it's one of those uncaught messages that are trapped by a frontscript in the IDE.
PowerDebug http://powerdebug.ahsoftware.net
PowerTools http://www.ahsoftware.net/PowerTools/PowerTools.irev
PowerTools http://www.ahsoftware.net/PowerTools/PowerTools.irev