Recommendations for storing/editing text?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Recommendations for storing/editing text?

Schwab,Wilhelm K
Hello all,

The basic problem is to store, for example, HTML with lots of ugly Java
script to drive a physical device, in a way that makes it easily "found"
in the image, and edited.  Possible solutions include:

(1) a packaged global containing a ZLib-compressed version of the text,
combined with a way to open a shelled value presenter on it.

(2) the program could look either in its own directory or a fixed
location for a file that contains the script; this allows it to be
edited w/o redeploying.  One could have the program lazily write default
text on startup or some other event.

(3) store the text "in-line" in a method; it's a little ugly, but there
are no extra tools required.

Any strong opinions, other options, or favorite solutions?

Have a good one,

Bill

--
Wilhelm K. Schwab, Ph.D.
[hidden email]


Reply | Threaded
Open this post in threaded view
|

Re: Recommendations for storing/editing text?

Chris Uppal-3
Bill,

> (1) a packaged global containing a ZLib-compressed version of the text,
> combined with a way to open a shelled value presenter on it.
>
> (2) the program could look either in its own directory or a fixed
> location for a file that contains the script; this allows it to be
> edited w/o redeploying.  One could have the program lazily write default
> text on startup or some other event.

There doesn't seem to be much difference between these; either way you have the
"default" text stored in the image (I probably wouldn't bother compressing it).
The second adds the option of local modification/override of the text, only you
can say if that's a valuable feature in your application.  (A FileLocator might
be useful here, BTW.)


> (3) store the text "in-line" in a method; it's a little ugly, but there
> are no extra tools required.

I don't like that -- editing "real" text stored as a quoted string can be
painful.

FWIW, I'd probably just store/install the text as a file external to the
application without bothering with a backup/default version stored in the
image.  If it fails, it fails...


Just for frivolity's sake, a fourth option is to store the text externally in a
file on /your/ system and hard-wire the contents of the file into a
constant-valued method's literal frame (but not into the source code) with a
compile-time expression:

-------------------------------
defaultHTMLText
    ^ ##(self readDefaultHTMLText).
-------------------------------

where #readDefaultHTMLText is a class-side method that opens the file and
answers its contents ;-)

(Another option would be to include the text as a "real"  Window's resource in
the .exe file, but I can't think of /any/ advantages to that approach...)

    -- chris