AltME: SDK

Messages

Gregg
I use INCLUDE a lot, for both development runs and encapping. I just use different scripts to launch them. That is, I have a %_build.r that calls INLCUDE/LINK to produce an output script, then uses DO on that. %_encap.r, the CALLs encap and does other things like setting icon and version in the EXE.
Typos. %_encap.r calls INCLUDE/LINK, then CALLs encap...
DocKimbel
Ladislav: I just had a quick look at INCLUDE documentation, I still unsure if it can cover my needs. Let's take an example:
    REBOL [ ]
    do %lib/a.r
    do %lib/b.r
    app: context [...]
    app/run
How can I use INCLUDE there to make this script "encappable" (can be passed to Encap for generating an executable) while still being able to evaluate it with DO? Would the following code work?
    REBOL [ ]
     #include %include.r
    include %lib/a.r
    include %lib/b.r
    app: context [...]
    app/run
Gregg
Ladislav may have a different suggestion, but I've found that having build scripts works well for application oriented scripts, those that need to be encapped for deployment. For scripts that don't need to be encapped, I use INCLUDE directly, as you do above.
Though I use DO, not #INCLUDE in the latter case.
My build scripts also set a deployment target type that controls conditional includes and logic where needed. e.g., desktop vs rich 'net app vs plugin.
DocKimbel
Gregg: good point about DO, it should be rather:
    REBOL [ ]
    do %include.r           ;-- when run with DO
    #include %include.r     ;-- when passed to Encap
    include %lib/a.r
    include %lib/b.r
    app: context [...]
    app/run
Damn, no, `do %include.r` should be conditional, and disabled when encapping...
Ladislav
I use this form frequently:
REBOL [
    file: %myscript.r
]
    #include %lib/a.r
    #include %lib/b.r
    app: context [...]
    app/run
and evaluate it as follows:
include %myscript.r
also, this form is directly encappable
DocKimbel
The include system I use for all my apps that need to be encapped allows me to do this:
    # rebol -s %cheyenne.r
and
    # encap %cheyenne.r
Can INCLUDE provide similar feature? If yes, how can it be achieved in the easiest way? If not, what is the closest option INCLUDE can provide me?
Ladislav
Yes, that is very similar to what I use here
DocKimbel
Ladislav: in your above form, how do you deal with READ calls (for reading data files) in the application?
Ladislav
reading data files in the application? - you mean to be "in the application"?
(when encapped?)
DocKimbel
Both cases, when run and encapped.
Ladislav
yes, it is always both
DocKimbel
I mean, when encapped, such data file should be encapped too.
Ladislav
I can use either #include-binary or #include-string, etc. directives, or even the #do directive for something different
DocKimbel
When run with DO, it should be just read from disk.
Ladislav
it works using something like
# rebol -s %incl.r "%cheyenne.r"

Last message posted 125 weeks ago.