Marc,
Thanks for that. That looks like the best explanation. However why
it works when you add a row but doesn't work when you don't is still
a mystery to me.
Anyway, I'm sure a Save method would be "better" but I got it to work
exactly how I want it to by moving the save code into the close event
of the listbox. As someone who only programs something I need every
2 years or so, I forget the rules and standards really quickly.
This is just a very simple little app that keeps track of what
project I'm working on and puts time stamps on my entries when I
work. Nothing special. It does save as I work so if I crash I have
what was last entered.... However, in the interest of learning, I
believe I will tackle a Save Method next.
Thanks to you and everyone on the list who had thoughts or opinions.
Cheers,
Joel
On Mon, November 6, 2006 9:53 pm, Joel Newport wrote:
Hey list,
If after I reopen I add a new row, or delete a row, it works fine.
It's almost like the rows in listbox don't exist if I don't alter
them. Also simply changing a value in an existing row doesn't work.
I have to add or delete a row.
You've got your save code in the app.close event -- could it be the
window
closes (disappears) before the app.close event fires and so there's
nothing in the listbox to write? That wouldn't explain why it works
sometimes and not others, though.
I'm not sure what the problem is, but I'd probably rethink your
structure:
why not create a Save method and call it from the listBox's Action
event?
That way any time the list data is modified, it gets saved (as long
as you
don't have a huge amount of data the time to save shouldn't be an
issue).
That's better than in the app.close event because if your app crashed or
the computer was unplugged or whatever, data would be lost before the
app
would be quit.
--
Marc Zeedar
Publisher
REALbasic Developer Magazine
http://www.rbdeveloper.com
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>
Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>