Page 1 of 1

I don't know how to debug...

Posted: Mon Mar 31, 2014 4:30 pm
by jpyck
I'm not sure if this is OK, but I've attached a file that needs debugging. Can anybody tell me how to debug this code.
It's my version of lesson 3 and there are two issues I can't resolve.
1) On the cards "contactDetails" and "contactNew", the title always reverts to "Contacts" in the Title group.
(this is probably a MobGui problem)
2) The "save" or "databaseAddRecord" code does not work.
I've spent too much time trying to figure this out, and I'm sure it's a simple fix, I just can't see it...
I am very green and could use some help in debugging. i.e. how can we step through the code and see if an array gets populated etc.


Re: I don't know how to debug...

Posted: Mon Mar 31, 2014 5:48 pm
by dave.kilroy
Hi jpyck

Debugging is a really important skill - and writing code without this skill is a bit like Russian Roulette - you code works or BANG! you're dead. If you can debug you can take the bullet out of the pistol and carry on coding...

I suggest stop trying to complete lesson 3 and spend a bit of time reading Devin's most excellent introduction to debugging

once you 'get it' you'll be able to breeze through whatever the bugs are in your lesson 3 script - as well as your future work.

Really - completing lesson 3 is not important, learning to debug is important - have fun! :)

Kind regards

Re: I don't know how to debug...

Posted: Tue Apr 01, 2014 4:11 pm
by Bobisback
Good stuff. Thanks for the post!!

Re: I don't know how to debug...

Posted: Fri Apr 11, 2014 8:19 am
by newtronsols
The issues I've found I chase around the most is where you 'believe' functionality works on say version 6.5.2 but actually it only works on version 6.6 - for example email attachments. Or with mobgui - you build with the old version - but realise you should have built for Android with the new mobgui (or standard Livecode) - otherwise some functionality that works when you test it on iOS/Windows may not work on Android.