getting into the url cache

Dave Cragg dcragg at lacscentre.co.uk
Thu Dec 12 20:12:01 EST 2002


At 3:47 pm -0800 12/12/02, Richard Gaskin wrote:

>>
>>  First:
>>
>>  load url "http://whatever.com/whatever.gz" ##now in cache
>>
>>  then later:
>>
>>  go stack decompress(url "http://whatever.com/whatever.gz") ##will
>>  take it from the cache
>
>I don't think so.  Here I get a "not a stack" error, which seems logical
>once I thought it through.

I use this technique a lot so don't give up.  Monte's point about 
using compress on the "binfile" when making the compressed file may 
be significant.

>The "go stack" command takes a stack descriptor rather than stack data, so
>it would seem your example is expecting MC to treat the decompressed stack
>data as a stack descriptor, no?

I thought the same until I started messing around one day.

Another trick is to set a custom property to a compressed stack file. E.g.

    set the cMagicStack of this stack to compress(url 
("binfile:path/to/file.mc"))

Then do this:

    go stack decompress(the cMagicStack of this stack)

I've never used this for anything practical, but I've often wondered 
about employing this technique as a way of creating configuration 
palettes for distributable widgets that you create as a group of 
objects. Normally you would use a substack as a palette, but you 
can't copy substacks with groups.

For example, you might make some kind of table object as a group of 
fields and buttons. And you've made it in a way that you can 
configure various settings, for example, the number of columns or 
rows. You might do this with some setprop handlers in the group. Then 
you want to copy the object into various other  stacks. But you want 
to be able to configure the settings of these copies with a visual 
interface instead of relying on scripting. So you create a stack that 
lets you set the configurable options for the widget (rows, columns, 
whatever) and put the stack inside a custom property of the group. 
You also  provide a means in the group (option-clicking for example) 
to open this "magic window". Feasible?

Cheers
Dave



More information about the metacard mailing list