Page 1 of 1

Advice on where to begin...

Posted: Thu Nov 14, 2013 7:25 pm
by glawrie
I'm new to LiveCode, so apologies if this question answered somewhere already. I have searched, but not found it.

My interest in LiveCode is initially to see if I can put together a simple app that one of my sons can use to monitor his training regime - basically I'm hoping (eventually) to create an iPhone app that he can use to capture what time he goes to sleep, the duration of sleep, his waking pulse-rate, and his assessment of how tired he is on waking. What we imagine is an app with a single button to push when he turns-in for the night, and push again when he wakes - at which point it pops a dialog up to capture his waking pulse (number) and tiredness rating (1-10 scale). Periodically the app will need to be able to export the data (ideally in a form that can be imported into a spreadsheet).

From what I've read I can see how the interaction bit can be done in LiveCode. However, what I cannot work out is how the daily data gets stored, or exported. I'm sure I'm missing something obvious here, but obviously too dim to spot what.

The closest I found so far is in some examples there is mention of a "Custom Property" for a card ("CData") - but not yet found out what this is. In other examples there is talk of linking to SQL databases... Both sound rather more complex than helpful. I suspect all I need to do is write out the data to a structured text file. But so far I've not found a simple example of anyone doing this...

So. Perhaps someone could give me some pointers - either into doing what I'm trying to do, or to an example bit of code that does something similar, or to explain why what I'm trying to do is based on wrong-thinking etc.

Thanks in advance for any help.

Re: Advice on where to begin...

Posted: Thu Nov 14, 2013 8:39 pm
by dunbarx
Well.

Welcome.

All simple to do in LC. Providing, of course, that you have basic skills. It will be very difficult to become just proficient enough to make your app, as if only those aspects of LC will be needed, and can be learned in a vacuum.

But if you are willing to put just a little effort in, and listen to the wailing of this remarkable community, you can learn enough to build this entirely on you own after a month or so of effort. It will take less time actually, since you will be trying to put your app together right from the start and working on those tools needed. And with our help.

So, where do you start? Go through the lessons and tutorials. Look at the dictionary for, say, the words "put", "convert", "ask", and a few others to come. Can you make a new mainStack? Write back often with your thoughts. Your comfort is on this forum.

Craig Newman

Re: Advice on where to begin...

Posted: Thu Nov 14, 2013 10:58 pm
by glawrie
Hi Craig

Thanks for the inspirational warm words. Appreciated. But actually I was rather hoping for something more tangible - of course I can trawl around in the dictionary hoping to stumble across what I'm looking for, but would be really useful to find an example of a LiveCode stack that captures and saves information to a file that is subsequently exported. To see how others have done this would be a great help. But maybe I'm just being too optimistic, and actually your being enigmatic is simply a cautious reflection of limitations in LC: I suspect not, but would be good to know for sure.

Regards

Gavin

Re: Advice on where to begin...

Posted: Thu Nov 14, 2013 11:29 pm
by dunbarx
I was not being enigmatic. I was saying that learning to program is a much larger endeavor than learning to use prepackaged tools from some software package, regardless of how cool (or awful) those tools are. I will explain:

Open LiveCode and, in the file menu, invoke "New Mainstack". There. You just made an application. Oh yes, it does nothing at all. But it is yours. You can save it if you wish.

So. You can likely get a working gadget by asking for examples and guidance in this forum. That would be a shame, since afterwards you would have little to show for it all except the gadget. Maybe that is all you are really interested in, and, then, well and good. So is this the case? Or do you want to learn to make your own gadgets?

Craig

Re: Advice on where to begin...

Posted: Fri Nov 15, 2013 12:31 am
by Simon
Hi Gavin,
Here is the lesson for a simple text file:
http://lessons.runrev.com/s/lessons/m/4 ... put-output
Using tab's or commas for your delimiter it would be easy to get it into a spreadsheet. (<that is a test sentence :))

Have you studied any programming language before?

And I hope the "heart rate" is manually plugged in and not bluetooth as that would be very difficult for a beginner.

Simon

Re: Advice on where to begin...

Posted: Fri Nov 15, 2013 1:20 am
by glawrie
Simon - thanks a lot of the link. Helpful. And yes, manual data entry is the plan :)
Craig - I fully appreciate the sentiment, a version of the Oxfam 'fish' or 'rod' example I suppose. But giving someone a rod without instructions, and just hoping he or she happens to know how to fish (or will work it out) is not what was being suggested I think.

For the record, I'm a graduate in electrical & mechanical engineering and my degree thesis was concerned the design of an interactive graphic interface for an advanced power system modelling programs (in the days when interactive computing was a novelty research topic itself), and so have written a fair amount of code in my time. But while the mostly procedural programming I have done helps with algorithm design, it is not much use when it comes to working with object orientated approaches - particularly where (as seems to be the case here) input/output activities are 'side effects' of events (in the best LISP tradition) rather than formally triggered activities. Having some practical examples to work through will hopefully help me get to some understanding of appropriate methods more quickly: and indeed that is surely why "lessons<dot>runrev<dot>com" exists. All I was hoping was to get to the useful bits more quickly than I would left to find them on my own.

Fingers crossed, I'll learn a bit about how to get this system to work. If it lands nicely, then yes I hope that I can use the learning again on other projects later. But one step at a time I think.

Re: Advice on where to begin...

Posted: Fri Nov 15, 2013 1:26 am
by dunbarx
Gavin.

OK. You already have a heck of a head start. It is just a matter of learning how xTalks differ from procedural languages. You will be amazed at how "high" a level this sort of thing as evolved to.

So look at what Simon has pointed you to, and write back often. You will get tips on how to put the objects you need into place, and how to start adding functionality to them. We will point you to the dictionary often, because that is your greatest resource. And there is an element of not knowing what to look up yet; sort of not being able to find a word in a normal dictionary until you know how to spell it.

As for the fish thing, you have it all wrong. It goes:

Give a man a fish, and you feed him for a day.
Teach a man to fish, and you set him up for divorce.

Craig

Re: Advice on where to begin...

Posted: Fri Nov 15, 2013 1:42 am
by Mark
Hi Gavin,

In addition to Craig's advice, --yes it is important to go through tutorials-- you might want to order Colin's book LiveCode Mobile Development Beginner's Guide and my book Programming LiveCode for the Real Beginner. Together, they will give you a good basic understanding of LiveCode.

Kind regards,

Mark

Re: Advice on where to begin...

Posted: Fri Nov 15, 2013 1:44 am
by Simon
no no no

Give a man a fish and feed him for a day.
Teach a man to fish and he will sit in a boat and drink beer all day.

Simon

Re: Advice on where to begin...

Posted: Fri Nov 15, 2013 4:50 am
by dunbarx
Simon,

You are not thinking of the big picture. What happens when he gets home late that night?

Craig

Re: Advice on where to begin...

Posted: Fri Nov 15, 2013 4:54 am
by FourthWorld
dunbarx wrote:Simon,

You are not thinking of the big picture. What happens when he gets home late that night?
If he married the right woman she greets him at the door with a nightcap. :)