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

World: r3wp

[SDK]

Gregg
20-Mar-2006
[436]
I think that has to do with evaluation constraints then. That is, 
DRAW will get words, but not do further evaluation (kind of like 
CONSTRUCT), so it's safe.
Bo
23-Mar-2006
[437x3]
I'm trying to use the 2.6.2 version of enface from the SDK to encap 
a Rebol script I used to encap with rebolve, but I get the following 
error:
Set-Net not provided.
** Script Error: stylize has no value
** Near: stylize [
    wmtxt: text "Test" 255.255.0 font-size 16
    wtext: text " " 640 as-is no-wrap black white
    box: box...
** Press enter to quit...
Any ideas?  It also didn't support 'insert-event-func.
Graham
23-Mar-2006
[440]
you haven't included all the necessary files.
Bo
23-Mar-2006
[441x2]
Aha!
I guess I was expecting they were all included like with rebolve.
Graham
23-Mar-2006
[443]
you have to explicitly include all the necessary source files
Bo
23-Mar-2006
[444]
How does one ascertain which source files contain which functions?
Graham
23-Mar-2006
[445x4]
prot.r includes all the protocols
view.r includes all needed view stuff ( I think )
and there's another for mezz.r
you can edit these to rip out the stuff you don't need.
Bo
23-Mar-2006
[449x2]
Thanks Graham!  I have it up and running now, but it isn't working. 
:-(
I'll have to debug now to handle whatever changed in Rebol to cause 
it to stop working.
[unknown: 5]
24-Mar-2006
[451x3]
Just curious if the sdk package located at http://www.rebol.net/builds/sdk/
requires a newer license.key file?  I already own SDK but this one 
seems to tell me to put my license file in the correct directory 
when I try to run it and I have dropped into every directory I can 
think of.
If it requires a newer one then anyone know how much it cost them 
to simply upgrade their license file?
I am concerned that REBOL would require me to buy another one shortly 
afterwards.
Bo
24-Mar-2006
[454x2]
Paul, my license key still works.  I'd contact RT to see what's up.
You just need to put it in the directory where the executable is 
located (at least that's what I did).
[unknown: 5]
24-Mar-2006
[456]
Ok will do. How old is your license.key - when do you think you initially 
purchased SDK?
Bo
24-Mar-2006
[457]
Jan. 14, 2002.  But I used to work at RT so I may have a different 
license key than what you purchased.
[unknown: 5]
24-Mar-2006
[458x2]
Yeah that is true.  Thanks Bo.  I got an email into Cindy currently.
I guess this would be good to post in RAMBO for the future.
DideC
24-Mar-2006
[460]
My old lisense works with last SDK (license from end of 2004 IIRC)
JaimeVargas
24-Mar-2006
[461]
Same here.
[unknown: 5]
24-Mar-2006
[462]
It was a strange problem I think.  I think I had a pro key and an 
sdk key - that is my only explaination for the problem because Cindy 
sent me a copy of my original SDK download and that key worked on 
the newer one so I think I may have been using the wrong key file.
Louis
28-Mar-2006
[463]
The main problem I have with the SDK is that it makes it harder to 
find bugs. Does anyone have any idea what is causing this error message:

** Script Error: bind expected known-word argument of type: word
** Near: ctx-text: context bind ctx-text system/view
** Press enter to quit...
Graham
28-Mar-2006
[464]
you can optionally output your prerebol source and run that.  then 
no question of encap being involved.
Gabriele
29-Mar-2006
[465]
louis, my guess is that the encap version you are running is older 
than the version that code is expecting. (bind allowing objects is 
a rather new thing)
BrianH
10-Apr-2006
[466x3]
JeffM wrote in Core:

Can REBOL/SDK define functions that will be called from C and passed 
to a C function? For example:


c-logger: make routine! [ "Define the callback function for error 
tracking."

    logger: [string!] "using string! since a function ptr is just a pointer"
    return: [integer!]
] my-lib "C_Logger"

rebol-logger: func [s] [ print s ]

c-logger :rebol-logger
; Try this:

c-logger: make routine! [ "Define the callback function for error 
tracking."
    logger: [callback! [string!]] ; Here is the fix
    return: [integer!]
] my-lib "C_Logger"

rebol-logger: func [s] [ print s ]

c-logger :rebol-logger
Be careful though: The current implementation of callbacks in REBOL 
limits you to defining 16 per REBOL process. I'm not sure whether 
it is the making of the routine or the calling of the routine that 
establishes the callback though, so test to be sure. Most scripts 
I've seen use callbacks for logging, like your example, and so only 
call the routine once. Once the callback is established, there shouldn't 
be any limitation to the number of times the C code can call the 
REBOL function, in theory.
Anton
10-Apr-2006
[469]
The rebol function must complete before the C function tries to call 
it again - or there will be fireworks. Even a short rebol function 
can take 40ms to complete (for example), and if the C function tries 
to call it every 20ms that will stuff up the rebol interpreter.
JeffM
11-Apr-2006
[470x3]
okay. this is good to know. thanks, guys. something else i couldn't 
find in the documentation was a method of getting a values returned 
by a pointer. for example, void get_value(int field, float *value); 
In this case, "value" is an output parameter. Does REBOL have a method 
of correctly passing a buffer and having it get filled in?
I've already tried the following:
foo: 16#{00000000}

C_get_pointer: make routine! [ "Returns pointer to structure."
	dummy [string!] "Pass 'foo' here"
	return: [integer!]
] my-lib "c_get_pointer" 
foo: 16#{00000000}


I know this is a trivial example. In this one, calling c_get_pointer 
with foo does in fact fill foo in with 4 bytes of data (presumably 
the correct address), but all calls to other functions which make 
use of that pointer crash. I can only assume that the pointer is 
wrong (byte swapped perhaps) or that I'm doing something not quite 
right?
(ignore the second foo: 16#{00000000} -- it was a pasting error
BrianH
11-Apr-2006
[473]
; Try this
C_get_pointer: make routine! [ "Returns pointer to structure."
    ip [struct! [[integer!]]] "Pass 'foo' here"
] my-lib "c_get_pointer" 
foo: make struct! [val [integer!]] none
C_get_pointer foo
foo/val
JeffM
11-Apr-2006
[474]
That's working well. Thanks
AndrewL
18-Jun-2006
[475]
I've been reading the docs both for the preprocessor and for the 
newer include.r script but I'm a bit confused, I wonder if someone 
could help clear it up for me. Here's my situation. I have view and/or 
SDK installed on a PC and a script sitting on my desktop. This script 
needs one or more library scripts which are available from web servers. 
How do i write the start of the script so that I can do all of;

1) Double click and have it run in view

2) Run the preprocessor so that I have an all in one script ready 
to run/copy somewhere

3) Encap it by dragging and driopping it on encmdview.exe or similar


I want to be able to do this without changing a single character 
of the script. I want to access the library files from a web server 
because here at work I often write scripts on various different servers 
and prefer to keep one copy of the libs centrally and not downloaded 
onto each machine.
Gabriele
19-Jun-2006
[476x2]
one trick is to use something like:
x: #do [1]
either tuple? x [
    ; script has been run directly
    do %include1.r
    do %include2.r
] [
    ; script is being preprocessed/encapped
    #include %include1.r
    #include %include1.r
]
Anton
19-Jun-2006
[478]
don't you mean:
	either issue? x [...
Gabriele
19-Jun-2006
[479x4]
about include files being on a web server, the official prebol does 
not support that; i think that Ladislav's INCLUDE does, and I have 
a patched prebol.r that does support including from urls too.
Anton, of course i meant ISSUE?. sorry.
let me repeat it to avoid confusion:
x: #do [1]
either issue? x [
    ; script has been run directly
    do %include1.r
    do %include2.r
] [
    ; script is being preprocessed/encapped
    #include %include1.r
    #include %include1.r
]
AndrewL
19-Jun-2006
[483]
Great, that works perfectly, as you said for local files.. I haven't 
managed to get include to work yet for remote files, is the patched 
prebol.r available somewhere? (your rebsite is down)
Volker
19-Jun-2006
[484x2]
; would this work?
files: [#include  %include1.r #include  %include2.r]
foreach files[if file? files/1[change files load files/1]
do files
at least tihis version is buggy..