Help with custom properties (or something like that)

Raymond Griffith rgriffit at ctc.net
Sun Apr 16 22:48:45 EDT 2006




On 4/16/06 6:22 PM, "Cubist at aol.com" <Cubist at aol.com> wrote:

>    I've run into a weird problem which I can*not*, for the life of me,
> understand or solve. Let me explain, in hopes that *somebody* out there can
> clue me 
> in...
> 
>    I'm working with MetaCard 2.4.1, running under MacOS 9.0.2 (it serves my
> needs, what can I say?). I have a stack with a custom property called
> "AdMailTemplate". This property contains a file. I know it's *in* there,
> because the 
> statement "answer the length of (the AdMailTemplate of this stack)" gives me
> the 
> length of the file... but "answer (the AdMailTemplate of this stack)" gives
> me *nothing*.
>    I've tried using base64Encode on the file before storing it in the
> property, and base64Decode after retrieving the stored file. This was a
> partial 
> success; "answer (the AdMailTemplate of this stack)" no longer gives me
> bupkiss, 
> but it base64Decodes to nothing.

Base64Decode does have an inherent problem with file lengths, and I have run
into a few problems with it if there were odd characters.

If you have some odd characters in the file, it may not "answer" in any
case. 

Before you stick it into the custom property, try sticking it into a
variable and returning it. Does it work on sticking it into a variable and
returning it? If not, look at what you are putting in there.

One other thing I have used is to "compress" a variable before putting it
into the custom property. That often helps with unprintable characters.


>    What the heck is going on here? Why should a custom property behave like
> that? Is it possible that there's something weird about the content of said
> custom property which MetaCard doesn't like? Would it make any difference if
> the 
> file contains nulls and/or other funky characters?

Yes. Nulls in custom properties mess things up. And IIRC, base64encode does
not handle nulls well.

> Is it possible that the
> file's bytes have coincidentally copied some portion of the MC2.4.1 stack file
> format?
>    I sure hope this is a known flavor of bug with a known solution, that
> someone can say "You need to do X" and it's fixed. If more information is
> needed, 
> I will send a copy of the stack (via private email) to anyone who asks.

Try the compress option and let me know how it works. Compress seems to
handle nulls well. 

Regards,

Raymond E. Griffith

> _______________________________________________
> use-revolution mailing list
> use-revolution at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription
> preferences:
> http://lists.runrev.com/mailman/listinfo/use-revolution





More information about the use-livecode mailing list