hi all !
I need to write a simple console app but I have troubles ..
todo: on the terminal you start an app with parameters on win/linux/mac and get back as return a string:
foo parameter1 parameter2 parameter3 parameter4
return should be maybe "secret".
so the question is, how to do this in livecode ? how you return a string as return code ? I did not find any sample and my tests only open a stack window on mac or freeze on mac
and linux ! Should be the code in openstack or in startup or ...
thank you in advance,
harald
simple console app with string as return
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller
-
- VIP Livecode Opensource Backer
- Posts: 16
- Joined: Mon May 09, 2011 3:01 pm
-
- VIP Livecode Opensource Backer
- Posts: 10044
- Joined: Sat Apr 08, 2006 7:05 am
- Contact:
Re: simple console app with string as return
Startup. When running facelessly stacks are never "opened" per se, so AFAIK "startup" is the only message you'll get.harald.schlager wrote:Should be the code in openstack or in startup or ...
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: 16
- Joined: Mon May 09, 2011 3:01 pm
Re: simple console app with string as return
thank you, when i put in the startup message "return "secret"" and when i start with "open -g x.app" I get nothing back, when I put "put dddd" inside - nothing returns - also when i redirect it in a log file
-
- VIP Livecode Opensource Backer
- Posts: 10044
- Joined: Sat Apr 08, 2006 7:05 am
- Contact:
Re: simple console app with string as return
"return" won't do anything, since there's no LiveCode script calling it to return anything.
"put" should work, but perhaps you'll need to call the app directly rather than through the "open" command (that is, just run the app name in Terminal).
"put" should work, but perhaps you'll need to call the app directly rather than through the "open" command (that is, just run the app name in Terminal).
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: 16
- Joined: Mon May 09, 2011 3:01 pm
Re: simple console app with string as return
the only command in the startup handler is put "secret" and quit. i call it with the -ui option
windows: no output put quits correctly
linux: invalid pointer at quit, without quit the app did not stop (waiting for input ... )
harald@harald-ubuntu:~/pwkeep$ ./pwkeep -ui
secret
*** glibc detected *** ./pwkeep: munmap_chunk(): invalid pointer: 0x0828ae64 ***
======= Backtrace: =========
/lib/i386-linux-gnu/libc.so.6(+0x75ee2)[0xce2ee2]
/lib/i386-linux-gnu/libc.so.6(+0x765c5)[0xce35c5]
./pwkeep[0x82516b5]
./pwkeep[0x8052683]
./pwkeep[0x811d42e]
/lib/i386-linux-gnu/libc.so.6(__libc_start_main+0xf3)[0xc864d3]
mac: when i call it directly it works correctly
Harald-Schlagers-MacBook-Pro-9:MacOS haraldschlager$ ./pwk -ui
secret
maybe on linux and windows is a bug ?
windows: no output put quits correctly
linux: invalid pointer at quit, without quit the app did not stop (waiting for input ... )
harald@harald-ubuntu:~/pwkeep$ ./pwkeep -ui
secret
*** glibc detected *** ./pwkeep: munmap_chunk(): invalid pointer: 0x0828ae64 ***
======= Backtrace: =========
/lib/i386-linux-gnu/libc.so.6(+0x75ee2)[0xce2ee2]
/lib/i386-linux-gnu/libc.so.6(+0x765c5)[0xce35c5]
./pwkeep[0x82516b5]
./pwkeep[0x8052683]
./pwkeep[0x811d42e]
/lib/i386-linux-gnu/libc.so.6(__libc_start_main+0xf3)[0xc864d3]
mac: when i call it directly it works correctly
Harald-Schlagers-MacBook-Pro-9:MacOS haraldschlager$ ./pwk -ui
secret
maybe on linux and windows is a bug ?