Capturing data via LiveCode using Forms

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
Subas
Posts: 32
Joined: Mon May 20, 2013 5:15 am

Capturing data via LiveCode using Forms

Post by Subas » Mon Jun 17, 2013 2:44 am

Dear LiveCode Gurus.

Please bare with me as I am still learning to code in LiveCode and I don't have any experience in coding.

I wanted to know which is the easiest way to capture data of an iPad using Forms. Currently I am capturing data via a document form which has fields like Date, Time, Name and stock number. I want to convert this paper method of capturing data and basically use the iPad to display the form and I will be able to capture it. After capturing the data, it will be saved onto a text file on the iPad and when I have Internet connection via mobile or wifi the iPad will automatically send this text file to a designated email address. After sending it the processes will terminate and if the user has additional items to capture it will be restarted by the user.

I have managed to get the fields of data onto a text file based on my previous queries on this forum.

Could the gurus please explain if I need to use a datagrid placed on a card or just a plain card with fields and drop boxes and calendar menus on it?

The above question will give me a start on looking for the right Information on this forum as I don't know which should I use or what will be the best practices used by LiveCode developers to design a Form on an iPad, iPhone or windows tablet.

Best Regards
Subas

Simon
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3901
Joined: Sat Mar 24, 2007 2:54 am

Re: Capturing data via LiveCode using Forms

Post by Simon » Mon Jun 17, 2013 5:05 am

Hi Subas,
If it's just a few fields I'd make it part of the message body (not sure the state of attachments in iOS).
OK
mobileComposeMail subject, [recipients, [ccs, [bccs, [body, [attachments]]]]]
but don't forget the attachment will be text, binary is one extra step.

Aside, put the fields into a variable and make that the body:
repeat with N = 1 to the number of field of this card
put "Here is the information:" & cr & cr into myBody
put field N of this cd & cr into myBody
end repeat
mobileComposeMail subject, [recipients, [ccs, [bccs, [myBody, [attachments]]]]]

Simon
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!

Subas
Posts: 32
Joined: Mon May 20, 2013 5:15 am

Re: Capturing data via LiveCode using Forms

Post by Subas » Mon Jun 17, 2013 2:33 pm

Dear Simon.

Thank you for the information.
I prefer to place those fields I captured into the body of the email.
I will try it out. Once again thank you for the help.

Simon
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3901
Joined: Sat Mar 24, 2007 2:54 am

Re: Capturing data via LiveCode using Forms

Post by Simon » Mon Jun 17, 2013 6:05 pm

Hi Subas,
Yes, I was thinking a bit more about "Why use the body of an email?"
Well because it contains more information about who sent the information, that the user never has to enter. email, date sent and if in the body that information will be stored as a record, with an attachment one might lose that.

Simon
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!

Post Reply