Another time DataGrid.... not work ok in exe.

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

Post Reply
tabbiati
Posts: 18
Joined: Sat Jul 09, 2011 3:18 pm

Another time DataGrid.... not work ok in exe.

Post by tabbiati » Fri Aug 19, 2011 4:04 pm

Hello to all,
I needed more information on the DataGrid:
I made a small application with a DataGrid and with a button
that adds a record to the DataGrid by taking the values of some field;
everything is working fine in development mode but once built the executable
visually everything is fine ( i see added record) but the next time you start application added records are not saved
( in development mode work ok).
This code is used to add data:

put field "Titolox" into gVTheDataB["Titolo"]
put field "Cognomex" into gVTheDataB["Cognome"]
put field "Nomex" into gVTheDataB["Nome"]
put field "Giornox" into gVTheDataB["Giorno"]
put field "Orax" into gVTheDataB["Ora"]
put field "Posizionex" into gVTheDataB["Posizione"]
put field "Presenzax" into gVTheDataB["Presenza"]

put 1 into theLineNo
dispatch "AddData" to group "DataGrid 1" with gVTheDataB, theLineNo
put the result into theNewIndex

I see a previous similar topic but i think that is not same thing.
I start to read PDF of DataGrid but now i am more confused....
Thanks

Klaus
Posts: 14194
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: Another time DataGrid.... not work ok in exe.

Post by Klaus » Fri Aug 19, 2011 4:26 pm

Bongiorno tabbiati,

standalones NEVER save themselves on any platform!

You need to export the complete data when the app closes and re-import when the app starts!
This is a common technique, so get used to it 8)

Check this RunRev newsletter, you can adapt the principles (at least the place WHERE to save your data) to your needs:
http://runrev.com/newsletter/october/is ... etter3.php

If your datagrid is a TABLE then you can simply get/set the dgtext of grp "your data grid here" and save/read it to/from
a file in a directory where your app has write permission, see the newsletter!
If your datagrid is a FORM, then this will requre some extra steps.

And come back when you have more questions. :)


Best

Klaus

tabbiati
Posts: 18
Joined: Sat Jul 09, 2011 3:18 pm

Re: Another time DataGrid.... not work ok in exe.

Post by tabbiati » Fri Aug 19, 2011 4:47 pm

Thank again Klaus,
:oops: I am so stupid....
but another time i will better (perhaps...) :wink:

Post Reply