how to let Livecode run json in proper format
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
-
- Posts: 4
- Joined: Sun Jul 21, 2013 10:18 am
how to let Livecode run json in proper format
Hello everyone:
I'm just learned some fundamental knowledge of livecode, and recently got a project to do, but i'm really confuse in how to change the code below in proper format, in other words, like the general survey format we usually in the web (like the first picture) and display it in livecode.
Any suggestions?
I'm just learned some fundamental knowledge of livecode, and recently got a project to do, but i'm really confuse in how to change the code below in proper format, in other words, like the general survey format we usually in the web (like the first picture) and display it in livecode.
Any suggestions?
Re: how to let Livecode run json in proper format
Hi tkytky,
Either you've changed your name or this same job was given to you.
In any case this exact question was asked before:
http://forums.runrev.com/phpBB2/viewtop ... =9&t=16024
If you ask specific questions regarding implementation of specific aspects I'd be happy to help.
Now have you gone through the lessons?
http://lessons.runrev.com/
The scripting conference?
http://www.hyperactivesw.com/revscriptc ... ences.html
Have you read or browsed the User Guide (resources icon)?
Simon
Either you've changed your name or this same job was given to you.
In any case this exact question was asked before:
http://forums.runrev.com/phpBB2/viewtop ... =9&t=16024
If you ask specific questions regarding implementation of specific aspects I'd be happy to help.
Now have you gone through the lessons?
http://lessons.runrev.com/
The scripting conference?
http://www.hyperactivesw.com/revscriptc ... ences.html
Have you read or browsed the User Guide (resources icon)?
Simon
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!
-
- Posts: 4
- Joined: Sun Jul 21, 2013 10:18 am
Re: how to let Livecode run json in proper format
Hi Simon:
Thank you very much for your reply.
I'm not sure which one of the plugin file i should use.
Also, the tutorial in the livecode web has few thing about json, i only got json to array file from it.But it seems haven't too much help.
Thank you very much for your reply.
I'm not sure which one of the plugin file i should use.
Also, the tutorial in the livecode web has few thing about json, i only got json to array file from it.But it seems haven't too much help.
Re: how to let Livecode run json in proper format
Hi tkytky,
There is not a "button" or "plugin" you can use to get what you would like. You will have to code this yourself.
There are no LC samples or examples that turn the info you are getting into a form.
Do you understand this?
The parsing is easy (for some of us) and creating the form as well.
Try, and if it's not working post your code here.
Simon
There is not a "button" or "plugin" you can use to get what you would like. You will have to code this yourself.
There are no LC samples or examples that turn the info you are getting into a form.
Do you understand this?
The parsing is easy (for some of us) and creating the form as well.
Try, and if it's not working post your code here.
Simon
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!
Re: how to let Livecode run json in proper format
Hi simon and darkshadow
By the way darkshadow wasnt me. But i guess darkshadow got the same problem as me .
By the way darkshadow wasnt me. But i guess darkshadow got the same problem as me .
Re: how to let Livecode run json in proper format
Not only the same problem but the same jason code.
Hey.. do you think it's your competitor?
Simon
Hey.. do you think it's your competitor?
Simon
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!
Re: how to let Livecode run json in proper format
I think we are doing on the same project and can`t get things going.
Btw simon do you have skype ?
Btw simon do you have skype ?
Re: how to let Livecode run json in proper format
Yes I do, but Dave (dave_probertGA6e24 ) is good.
Maybe a bit acidic but I'm hoping a good guy.
Simon
Maybe a bit acidic but I'm hoping a good guy.
Simon
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!
Re: how to let Livecode run json in proper format
Cause you been helping me since i posted my question. so i think you got an ideas what i m suppose to do.
I`m not sure about dave.
I`m not sure about dave.
Re: how to let Livecode run json in proper format
Dave, step up to the plate.
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!
Re: how to let Livecode run json in proper format
Can you give me more clues about radio button and stuffs? i tried the last coding you gave me. Successfully separate those question apart. but i aint sure about the radio button
-
- Livecode Opensource Backer
- Posts: 328
- Joined: Mon Dec 05, 2011 5:34 pm
- Contact:
Re: how to let Livecode run json in proper format
Thanks Simon - I was hoping to hide from this one
Ph-Neutral is what I aim for though 
Darkshadow / TKYTKY,
Not too sure I can help here, but I can try.
To summarise - you have a JSON output from some source (either file or generated), you need to create livecode cards with each of the questions on it along with the A,B,C radio choices.
To load the JSON I can recommend the JSON Library by the late Mark Smith. You might have to search to find a copy though. There should be links on the forum or Revonline.
Once you have run the data through the parser you should then have an array or arrays contain a structured version of the JSON file.
You should then iterate through the appropriate array parts and use the 'create' command in LC to make a new 'field' or 'button', put the text into the new object and then position it (depending on the device you are targeting).
Radio buttons should be created inside a group so that they know that they should work together.
Handling the responses from the 'form' is usually based on a 'button' script which will then look at the radio group to get the answer and move on to the next screen.
Most of this is pretty obvious in terms of functionality. The fine detail of exactly how you want to do this is really up to you and the requirements of your overall task. There is no 'standard' tool to create and handle a form - because everyone's needs are different.
If you have looked at each of the lessons regarding creating components, using groups, and working with radio buttons then it's only a case of combining that knowledge via understanding and coding ability.
If you need more help then it would be best to post a few examples of the JSON formatted questions, and a picture of the required output and if someone is being really nice and has some spare time they might create an example stack for you.
Cheers,
Dave
(I hope my Milk intake was enough to reduce any Acidity
)


Darkshadow / TKYTKY,
Not too sure I can help here, but I can try.
To summarise - you have a JSON output from some source (either file or generated), you need to create livecode cards with each of the questions on it along with the A,B,C radio choices.
To load the JSON I can recommend the JSON Library by the late Mark Smith. You might have to search to find a copy though. There should be links on the forum or Revonline.
Once you have run the data through the parser you should then have an array or arrays contain a structured version of the JSON file.
You should then iterate through the appropriate array parts and use the 'create' command in LC to make a new 'field' or 'button', put the text into the new object and then position it (depending on the device you are targeting).
Radio buttons should be created inside a group so that they know that they should work together.
Handling the responses from the 'form' is usually based on a 'button' script which will then look at the radio group to get the answer and move on to the next screen.
Most of this is pretty obvious in terms of functionality. The fine detail of exactly how you want to do this is really up to you and the requirements of your overall task. There is no 'standard' tool to create and handle a form - because everyone's needs are different.
If you have looked at each of the lessons regarding creating components, using groups, and working with radio buttons then it's only a case of combining that knowledge via understanding and coding ability.
If you need more help then it would be best to post a few examples of the JSON formatted questions, and a picture of the required output and if someone is being really nice and has some spare time they might create an example stack for you.
Cheers,
Dave
(I hope my Milk intake was enough to reduce any Acidity

Coding in the Sun - So much Fun.
Visit http://electronic-apps.info for released App information.
Visit http://electronic-apps.info for released App information.
-
- VIP Livecode Opensource Backer
- Posts: 10058
- Joined: Sat Apr 08, 2006 7:05 am
- Contact:
Re: how to let Livecode run json in proper format
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
Re: how to let Livecode run json in proper format
OK guilt got the better of me because I said I'd help if paid and he did offer. (just too small a job)
attached is the stack from Mark Smith modified for TKYTKY.
Mark did all the hard work I just present the info.
This will probably generate more questions.
Simon
attached is the stack from Mark Smith modified for TKYTKY.
Mark did all the hard work I just present the info.
This will probably generate more questions.
Simon
- Attachments
-
- TKYTKY.zip
- LC 6.1
- (11.76 KiB) Downloaded 331 times
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!