unpacking

Paul Foraker paul at whitefeather.com
Sun Mar 2 01:00:36 EST 2008


Thanks, Jim.

Yes, I have confirmed in the inspector that the property exists, and as I
mentioned, the correct data is retrieved in the Message Box, but not in the
stack script.

The variable jDate is composed of the letter "j" and the seconds for the
date. I delete the "j" when I want to convert the seconds back to a long
date for the dialog. Otherwise, it's not a date and the conversion would
fail.

-- Paul

On Sat, Mar 1, 2008 at 9:54 PM, Jim Ault <JimAultWins at yahoo.com> wrote:

> First, use the stack inspector to confirm that your property is indeed the
> value you think it is.
>
> Do this by opening the stack inspector, then choose the "custom
> properties"
> drop down.  Now inspect the values:
>
> set the jDate of this stack to "99/88/77"
>
> then
> put the jDate of this stack into tJournal
>
> By the way, why would you be doing....
> >     delete char 1 of jDate -- j
> >     convert jDate to long date
> >     answer "Sorry, there's no journal for" && jDate &"."
>
> since jDate is the name of the custom property and contains no data
> itself,
> and why would you want to delete char 1 of jDate?
>
> Hope this helps
>
> Jim Ault
> Las Vegas
>
>
> On 3/1/08 9:32 PM, "Paul Foraker" <wfsmail at gmail.com> wrote:
>
> > I'm building a stack that is a data entry app for a daily journal. Once
> the
> > day's entries have been posted (emailed to myself), I want to store them
> in
> > the stack. I came up with a scheme of prepending "j" to the seconds
> > representing the day and using that as the name of a custom property. No
> > problem storing that. When I retrieve it in a script, however, it's
> always
> > empty.
> >
> > on unpackTheData jDate -- in seconds
> >   put "j" before jDate
> >   put empty into tJournal
> >   put the jDate of this stack into tJournal
> >   -- do "put the" && jDate && "of this stack into" && tJournal -- didn't
> > work
> >   put the jDate of this stack into tJournal
> >   if tJournal is empty then
> >     delete char 1 of jDate -- j
> >     convert jDate to long date
> >     answer "Sorry, there's no journal for" && jDate &"."
> >     exit to top
> >   end if
> >   -- ...
> > end unpackTheData
> >
> > I'm passing the seconds for a date I know exists, and I can execute code
> > similar to the above in the Message Box and it works fine. In the
> script,
> > however, tJournal is always empty.
> >
> > I thought maybe it was a data-typing error, but this works in the
> Message
> > Box:
> >
> > put empty into tJournal
> > put "2/29/08" into jdate
> > convert jDate to seconds
> > put "j" before jDate
> > put the jdate of this stack into tJournal
> > put tJournal
> >
>



More information about the use-livecode mailing list