Page 1 of 1

LiveCode Mobile

Posted: Tue Jul 28, 2015 7:58 pm
by RedDeupree
Is there any version in the pipeline that will run itself on iOS or Android to allow live debugging of code between

if the environment is "mobile" then
-- blah
-- I want to debug this and step through logic that is not actually platform independent at the script level.
-- blah
end if

?

Re: LiveCode Mobile

Posted: Wed Aug 26, 2015 11:54 am
by MaxV
Just use this:
########CODE#######
on errorDialog pErrore
if environment() = "mobile" then
answer "Errore " & the system date &" - "& the time &CR& pErrore
end if
pass errorDialog
end errorDialog
#####END OF CODE#####

See ErrorDialog in the dictionary

Re: LiveCode Mobile

Posted: Thu Aug 27, 2015 11:57 am
by rinzwind
I would go for the console out mode. put "test" forwards it to the console (visible in the simulator cmd+/ or for the real device in the device view in xCode (somewhat hidden beneath a small button over there). Real time debugging isn't going to happen I think.

Some log command like:

Code: Select all

command logmsg pmsg, ptype
   local tmsg
   if ptype is empty then
      put "console" into ptype
   end if
   put formatDate(the seconds) & tab & pmsg & cr into tmsg
   switch ptype
      case "console"
         if the environment is "development" then
            put tmsg after msg
         else
            put tmsg
         end if
         break
      case "file"
         put tmsg after url("file:" & the effective filename of this stack & ".log")
         break
      case "dialog"
         answer tmsg
         break
   end switch
end logmsg

Re: LiveCode Mobile

Posted: Thu Aug 27, 2015 7:02 pm
by jacque
There is no live debugging available on mobile, you can only track errors or log progress for anything you set up. There are different ways to do that from very simple "answer" dialogs to more complex logging to stdout. I have a web page with my notes from a conference talk I did a while ago which explains the more comprehensive (but less simple) console method: http://www.hyperactivesw.com/resources_ ... gging.html