LiveCloud Forums
Notepad Example (Questions) - Printable Version

+- LiveCloud Forums (https://forums.livecloud.io)
+-- Forum: General (https://forums.livecloud.io/forumdisplay.php?fid=1)
+--- Forum: Getting Started (https://forums.livecloud.io/forumdisplay.php?fid=4)
+--- Thread: Notepad Example (Questions) (/showthread.php?tid=5)



Notepad Example (Questions) - Paul - 04-25-2019

I've been studying the NotePad example. 

1- In design mode, I clicked on the little Disk icon and then right click, Edit script. Looking for the code that did the actual saving nothing was there. The Save button works fine. If I don't press Save, the data is not saved. But where's the code?

2- Also, looking around at what code I could find, mosting in the Stack Initialization area, there seems to be lots of references to Behaviors. Is this something I need to read up and understand to utilize CanelaDB


RE: Notepad Example (Questions) - Linda Lu - 04-26-2019

(04-25-2019, 11:34 PM)Paul Wrote: I've been studying the NotePad example. 

1- In design mode, I clicked on the little Disk icon and then right click, Edit script. Looking for the code that did the actual saving nothing was there. The Save button works fine. If I don't press Save, the data is not saved. But where's the code?

2- Also, looking around at what code I could find, mosting in the Stack Initialization area, there seems to be lots of references to Behaviors. Is this something I need to read up and understand to utilize CanelaDB

Hi Paul,

The notepad sample app has one behavior assigned to the "main" card in the "notepad" stack. This behavior stores all the code that is used to generate UI and perform CRUD operations in the app such as saving your data. If you open the project browser in LiveCode, you can see the structure of the app and where the code is located.

Understanding behaviors in LiveCode is not necessary to create a CanelaDB app. It is a method of organizing scripts that we use.


RE: Notepad Example (Questions) - Paul - 04-26-2019

Quote:Understanding behaviors in LiveCode is not necessary to create a CanelaDB app. It is a method of organizing scripts that we use.

Thanks for your quick reply.

Considering that these this LiveCloud example is intended to be an easy way to get familiar with CanelaDB, they would probably be much more effective if the required code was placed in each button as 90% of LiveCode users would expect.

Maybe... before your May presentation at the conference, someone could rewrite the example in this more simplistic form.


RE: Notepad Example (Questions) - mark_talluto - 04-26-2019

Thanks Paul for your feedback. We will discuss this in our morning meeting tomorrow.


RE: Notepad Example (Questions) - mark_talluto - 04-26-2019

(04-26-2019, 05:07 AM)mark_talluto Wrote: Thanks Paul for your feedback. We will discuss this in our morning meeting tomorrow.

We talked about this and agreed that new developers to LiveCode might not understand how behaviors work. It is our primary goal to make reading the code examples easy. 

We are considering moving the code from the behavior to the card. We are also thinking of putting a button on the example that will open the script editor to the code for you. Thoughts?


RE: Notepad Example (Questions) - Paul - 04-26-2019

Quote:We are considering moving the code from the behavior to the card. We are also thinking of putting a button on the example that will open the script editor to the code for you. Thoughts?

A good example should demonstrate as many critical functions as possible. Creating a great example will significantly decrease support requests AND user dropouts. Think about it.

Your NurseNotes app makes you one of the top LiveCode users, but the LiveCode community likes explicit examples. For instance, back in 2011 I wrote this example app to demonstrate the most critical SQLite functions. Two things that make this example app stand out is its ability to generate test data AND most importantly how to place database data into a LiveCode Grid. Getting CanelaDB data into the Data Grid is the MOST important aspect of all. Anyone who's using a database is going to want to display their data using the Data Grid. Here. Have a look, this is what I did. It would be nice to have something like this for CanelaDB. But also, you'll want to include a couple of extra buttons: one to select local or remote data, the other to sync data.

This would absolutely give all your users a big running head start. Plus it would be nice to show off at the conference.

CRUD SQLite example
[Image: file.php?id=5744]
PS: I haven't looked at that v5.0 example in a long time. If there are any problems or if for some reason it does not run right in LiveCode v9, let me know and I'll fix it. I probably wouldn't take that much work to update this example, replacing the SQLite code with CanelaDB code.


RE: Notepad Example (Questions) - mark_talluto - 04-26-2019

(04-26-2019, 07:34 PM)Paul Wrote:
Quote:We are considering moving the code from the behavior to the card. We are also thinking of putting a button on the example that will open the script editor to the code for you. Thoughts?

A good example should demonstrate as many critical functions as possible. Creating a great example will significantly decrease support requests AND user dropouts. Think about it.

Your NurseNotes app makes you one of the top LiveCode users, but the LiveCode community likes explicit examples. For instance, back in 2011 I wrote this example app to demonstrate the most critical SQLite functions. Two things that make this example app stand out is its ability to generate test data AND most importantly how to place database data into a LiveCode Grid. Getting CanelaDB data into the Data Grid is the MOST important aspect of all. Anyone who's using a database is going to want to display their data using the Data Grid. Here. Have a look, this is what I did. It would be nice to have something like this for CanelaDB. But also, you'll want to include a couple of extra buttons: one to select local or remote data, the other to sync data.

This would absolutely give all your users a big running head start. Plus it would be nice to show off at the conference.

CRUD SQLite example
[Image: file.php?id=5744]
PS: I haven't looked at that v5.0 example in a long time. If there are any problems or if for some reason it does not run right in LiveCode v9, let me know and I'll fix it. I probably wouldn't take that much work to update this example, replacing the SQLite code with CanelaDB code.

We have a simple CRUD stack that we have used in the past as a sample stack. The feedback we got on its value was more or less positive. We got a lot of requests for actual working applications that represented real-world apps. It would not be too hard to bring it back as another simple stack.