r3wp [groups: 83 posts: 189283]
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search
 

World: r3wp

[SDK]

Gregg
8-Nov-2006
[835]
I think we've all hit this at one time or another. REBOL won't write 
to the Windows console. I was just trying a test to use the API to 
do it, and can't get that to work either, so it's still piping or 
nothing.
Maxim
8-Nov-2006
[836x2]
Quoting Gabriele: "Maxim, the Detective uses the cgi option, and 
prints to the dos command prompt if you call it from there (try running 
"nren help"). It does not use call though, but async-call, but i 
don't remember problems with call + cgi options."
I am practically sure I've had it work too.
Gregg
8-Nov-2006
[838x2]
nren help
 just launches the app here, no help printed to the console.
I know I've never gotten it to work without piping, but I haven't 
tried it with async-call.
Maxim
8-Nov-2006
[840]
is there a better pipe output than more available? one which wont 
stop at every screen full?
Maarten
8-Nov-2006
[841x2]
Let me check the Detective source...
works when you pipe to more :-)
Maxim
8-Nov-2006
[843x2]
but more will jam at first page full...
and its not very professional for clients...
Maarten
8-Nov-2006
[845]
Yep. It's not what I want my customers to show as well
Maxim
8-Nov-2006
[846]
for some reason, I am sure I had it working... I did so many tests.
Maarten
8-Nov-2006
[847x2]
Well.... you must have been mistaken
Now I can either create a wrapper program that can do this and runs 
my rebol program in the background, or ask my users to use 'more
Maxim
8-Nov-2006
[849]
but the more serious limitation is not being able to ask a question 
on the command-line   ;-(
Maarten
8-Nov-2006
[850]
Yes, but in my particular case, that is not a problem
Maxim
8-Nov-2006
[851]
I wonder if this limitation is only due to the fact that Carl does 
not want the rebol executable to be bloated... cause I see no reason 
why this limitation exists... even python works directly in the console... 
maybe RT should look at python's startup code to see how they did 
it?
Maarten
8-Nov-2006
[852]
I have no idea aither, but code bloat seems unlikely here.
Gregg
8-Nov-2006
[853]
I thought the API approach would at least work, but I don't know 
if doing it inside a process that has already opened the console 
in a non-shared mode would cause the issues I saw or not. And I would 
think that CGI mode would work too.
PeterWood
9-Nov-2006
[854x3]
Max: Perhaps you could come up with a nomore for clients. I came 
up with one in JScript (as it is pre-installed on all Windows 98 
& NT 5.0 onwards).

Usage:
test.exe. | cscript\\Nologo nomore.js

Script:
var si = WScript.StdIn;
var so = WScript.StdOut;
var line;
while (!si.AtEndOfStream)
  {so.WriteLine(line = si.ReadLine());}
Here's a quicker one that buffers all the output:
var si = WScript.StdIn;
var so = WScript.StdOut;
so.Write(si.ReadAll());
..but it needs to recieve all the output at once.
Maxim
9-Nov-2006
[857x2]
thanks, Unless RT fixes this long-standing issue for the next R2 
bug fixes I'll at least try this  :-)
and could wrap my app in a little batch file... to make it invisible 
...
Tomc
9-Nov-2006
[859]
Maxim  Im pretty sure windows has always woked this way , can you 
also pipe to TYPE to avoid stopping at 1 page?
Maxim
9-Nov-2006
[860x2]
type doesn't seem to work for me  :-(  it expect a file name as an 
argument...
is there any way to use class methods from C++ implemented external 
libraries?
Tomc
9-Nov-2006
[862x2]
... | copy con
grasping at very old straws here
Maxim
9-Nov-2006
[864]
?
Tomc
9-Nov-2006
[865x2]
can you pipe to copy con
or has some kind soul implemented  unix cat for dos
Maxim
9-Nov-2006
[867]
hum... cat.exe probably exists maybe less.exe also...
Maarten
9-Nov-2006
[868]
http://unxutils.sourceforge.net/
Robert
10-Nov-2006
[869]
How can I change/get rid of the REBOL word in the title?
Maxim
10-Nov-2006
[870x3]
depends if you are in view or not.
when not in view:  (on windows)  Graham posted this a while back:

win-lib: make object! [
	
	user-lib: load/library %user32.dll

	SetWindowText: make routine! [
		handle			[integer!]
		Title			[string!]
		return:			[integer!]
	] user-lib "SetWindowTextA"
	
	set 'WindowTitle func [
		Title [string!] 
	] [
		SetWindowText get-modes system/ports/system 'window Title
	]	
]
for view windows,  there is a title field in the encap part of the 
rebol header

rebol [
	encap: [title "NOT REBOL"]
]
Henrik
1-Dec-2006
[873]
are there ways to extract version information about an encapped binary 
from REBOL? I'm building a software update tool and want to read 
the version information about a specific binary.
Maxim
1-Dec-2006
[874]
not AFAICT cause its always the same wrapper, and the content is 
encrypted, so you can't just read and parse the binary  !
Henrik
1-Dec-2006
[875]
I guess it would be possible to do a checksum and correlate that 
against a version list.
Maxim
1-Dec-2006
[876]
but for that you have to have access to the version info from the 
outside, meaning you already know it... but I guess this is not such 
an issue depending on why you want version info..
Henrik
1-Dec-2006
[877]
yes, the app and updates come from me and so I'll know which version 
it is if I just have a checksum on the executable.
Maxim
1-Dec-2006
[878x2]
if you have full control on the app sources... using a resource editor 
(on windows), you could probably edit the rebol version data included 
in the binary metadata and then there are probably os calls to get 
that natively.
this has the added benefit of being precise within the icons and 
shortcuts... and may remove the reference to REBOL within which is 
a bit annoying when you release stuff and its not labeled as per 
your output names ' :-/
Henrik
1-Dec-2006
[880]
except it has to be fully automatic...
Maxim
1-Dec-2006
[881]
on encap you mean?
Henrik
1-Dec-2006
[882]
yes, no human involvement between initiating build and finished executable 
and knowing the version
Maxim
1-Dec-2006
[883x2]
well you know the version from the source, and as you say, can resolve 
a checksum from the output bin.  but you must keep a table of all 
the builds somewhere...   I wonder if there are any commandline resource 
hackers?
which would allow you to stamp the version (maybe) within the bin 
automagically.