errors trapped inside data grids?

Bob Sneidar bobs at twft.com
Fri Jan 27 12:05:23 EST 2012


I think some errors are trapped so that they do not cause a code break. Check the result to see if it contains anything.

Bob


On Jan 27, 2012, at 4:53 AM, Ken Corey wrote:

> Hi All,
> 
> I noticed something *very* strange, and I was hoping someone could either confirm or set me straight.
> 
> I'm implementing dataGrids for the first time, so I'm reading a lot of the lessons and tutorials (since that's the only documentation, seemingly).
> 
> I wanted to do something with the data once the user had finished editting it, so I put this handler in:
> 
> ----------------------8<---------------------
> ## CloseFieldEditor placed in data grid script
> on CloseFieldEditor pFieldEditor
>    put the dgColumn of the target into theColumnBeingEdited
>    ## Store UTF8 text
>    put unidecode(the unicodetext of pFieldEditor, "UTF8") into theNewText
> 
>    ## Save data to database using command I defined
>    put "Person" into theTable
>    ## Get the unique id of the row in the database we want to edit
>    put GetDataOfIndex(the dgIndex of me, "id") into theRowID
> 
>    SaveDataToDatabase theTable, theRowID, theColumnBeingEdited, theNewText
> 
>    ## Update dgData.
>    ## Setting dgDataOfIndex will refresh the data grid display as well as update dgData
>    put the dgDataOfIndex[ the dgIndex of the target] of me into theDataA
>    put theNewText into theDataA[theColumnBeingEdited]
>    set the dgDataOfIndex[the dgIndex of the target] of me to theDataA
> end CloseFieldEditor
> ----------------------8<---------------------
> 
> Okay, so far so good. After the unidecode I added a line "answer theNewText", which happily shows me an alert dialog with the text I editted.  This is almost feeling easy.
> 
> Then, I was wondering why my data is reverting after editting, and noticed the 'SaveDataToDatabase' call.
> 
> It's not anywhere.  I performed a 'Find' that should have winkled it out.
> 
> If it's not anywhere, then shouldn't it bark when it can't be found?
> 
> Just for grins, I put 'qqqxqqq' in the handler just after the 'answer' I'd put before.
> 
> No error message at all.
> 
> Surely an error message of some stripe should be reported, yes?
> 
> -Ken
> 
> _______________________________________________
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode





More information about the use-livecode mailing list