[REBOL] Re: SDK newbie dumb question
From: karim:elfounas:easybraine at: 2-Jun-2006 19:20
Steven White a =E9crit :
> I just purchased the SDK and have found a work-related use for it, so am
> eager to show it off. I have run into a little problem which I have
> encapsulated into this test script (at the end of this message).
>
> If I bring up the REBOL interpreter and "do" this script, it works.
>
> If I try to encap the script by dragging it onto enface or enpro, or by
> running enface or enpro and entering the script name interactively, the
> resulting .exe file does NOT run, and gives the following message:
>
> ** Script Error: layout has no value
> ** Near: MAIN-WINDOW: layout [
> title "Main Window"
> ]
> view MAIN-WINDOW
> ** Press enter to quit...
>
> This has got to be something dumb, but what? Yes, I did read the manual.
>
> Thank you. (If the solution is in the manual in plain sight, feel free to
> point that out.)
>
> Test script follows:
>
> REBOL [
>
> ]
>
> MAIN-WINDOW: layout [
> title "Main Window"
> ]
>
> view MAIN-WINDOW
>
> Steven White
> City of Bloomington
> 1800 W Old Shakopee Rd
> Bloomington MN 55431-3096
> USA
> 952-563-4882 (voice)
> 952-563-4672 (fax)
> steven.white-ci.bloomington.mn.us
>
Hello Steven,
When you "encap" a script, it's not executed by the normal rebol/view
but by rebol/face wich is rebol/view without many mezzanine functions.
You have to include them with your script with the #include command
(which is preprocessed before the encapping process).
Simply add this line at top of your script and the encapped version will
work.
#include %../source/view.r
(in your case, path will certainly differs and must point to the source
directory supplied with your SDK)
But usually you have to include more mezzanine functions. More
informations about this in the documentation here :
http://www.rebol.com/docs/sdk/kernels.html
I Hope it will help.
--
Karim EL FOUNAS
EasyBraine SA
Campagne des Rites, 8 - 1421 Ophain Bois-Seigneur-Isaac
T=E9l : +32 2 387 32 34
Mobile : +32 495 57 32 34
Email : karim.elfounas-easybraine.com