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

World: r3wp

[SDK]

Louis
15-Oct-2006
[815]
It just lies down on its back, vomits out some meaningless error 
messages (perhaps confessing past sins), then quits breathing. Doesn't 
even blink an eye.  Then I click a button and it completely disappears, 
buried somewhere on my hard drive.  I dig it up and try to revive 
it, but it is hopeless....at least for now. :>) I'm trying to get 
over it, but it is hard.
Gabriele
15-Oct-2006
[816]
Sunanda: well, porting the Detective (which is 700k of uncompressed 
rebol code) from view 1.2 to 1.3 required only removing a patch for 
a bug in 1.2. everything else works without any change.
Louis
15-Oct-2006
[817x6]
Oldes, I have to eat some words. 2.6.2 encaps the script. But when 
I run the encapped script I get this error message:

Misplaced item: "imanXw"
** Script Error: Cannot use path on word!
value
** Near: insert tail funds fb/1
** Press enter to quit...
Does that help you, or Gabriele or someone know what is wrong?
If %view.r from the old SDK is included instead of %view.r from the 
new SDK, the script runs but gives the following error message:

Misplaced item: "imanXw"
Misplaced item: "Quit"
Misplaced item: [
    (write %session-time.txt (session-time
 + (difference now/precise time-start)))
    (write %exchange-rate.txt exchange-rat
e/text)
    quit
]
That is using 2.6.2 to do the encapping.
If I encap with 2.6.2, including %view.r also from 2.6.2 the script 
does not run, but instantly gives this error message:

** Script Error: exchange-rate has no valu
e
** Where: switch
** Near: forall args [
    val: first args
    switch/default type?/word val [
        pair! [append pairs val]
        integer...
** Press enter to quit...
Using the old SDK and the old %view.r the program runs without error.
Gabriele
16-Oct-2006
[823]
Louis: it's hard to say without having the source. Using the new 
SDK with the old SDK sources will probably not work. I think your 
problem is probably a change in VID (the latter error you report 
is from LAYOUT parsing values), so you should probably check your 
layout blocks (and related code). Try to run them from View and see 
what could be wrong.
Louis
16-Oct-2006
[824]
OK, Gabriele, thanks.
Louis
18-Oct-2006
[825x2]
Is there a better way to do this:

comment {
    ;do %/c/sdk/source/view.r
    do %/c/sdk-2-6-2/source/view.r
    do %t-db-functions.r
    do %request-date.r
}

    #include %/c/sdk/source/view.r ;NOTE: THIS IS THE OLD SDK. WON'T 
    WORK WITH NEW SDK.
    #include %t-db-functions.r
    #include %request-date.r


So that I don't have to comment out  lines when I switch from interpreter 
to encap and back.
Also, would be nice if security didn't popup when using the interpreter---it 
slow programming down.
BrianH
18-Oct-2006
[827x2]
First question: Have you considered using the preprocessor yourself 
to generate a script to interpret? See %prebol.r and %prerebol.r 
in the SDK. Second question: Try the -s parameter to the interpreter, 
it will turn security off.
BTW, those were not my questions, they were answers to the questions 
asked by Louis.
Louis
18-Oct-2006
[829]
Thanks, Brian. I'll check this out.
Gregg
18-Oct-2006
[830]
The common approach with INCLUDE is to have a "launcher" script  
that builds a complete script, as you would use PREREBOL; then you 
just DO that output script. Another way you can do it is to check 
a known word from the script with VALUE? and only DO the script if 
VALUE? returns false for a word you know is set in the script. That's 
also easy to put into a loop, with word and script pairs.
Maxim
8-Nov-2006
[831x4]
for all SDK experts..   why is this not actually dumping the print 
to the CMD.EXE command shell?

this is encapped using enpro.exe:

rebol [
	Encap: [cgi]
]

print "-----"
I can only view output if I execute my command with a pipe to more 
like so:

> test.exe | more
which is obviously flawed?
I meant to say, isn't using the CGI option supposed to display the 
prints on the cmd.exe command line directly?
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]
?