Asking a little help with datagrid or file locations

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
ValiantCuriosity
Posts: 128
Joined: Thu Jun 30, 2016 3:08 am

Asking a little help with datagrid or file locations

Post by ValiantCuriosity » Fri Mar 22, 2019 7:49 pm

Greetings from the beautiful Pacific Northwest. It is a lovely day here today.

I'm working on a MacBook. I'm now grappling with the Datagrid form Lesson here:
http://lessons.livecode.com/m/datagrid/ ... -of-people

Most of it is going well and is understandable. However, I'm having difficulty with the location of the image file folder. I downloaded the sample app to my "Downloads" folder and it works perfectly. However, my test app doesn't display the monkey.jpg or any other image I substitute when run from a different folder.

As an example,I have the test app located in Documents/LiveCodeProjects/DatagridLesson. When I try to run the app from its original location, the images don't display. When I move the app to the downloads folder, the images do display. I've searched the forum and used the dictionary to try to solve this. I imagine it is somehow related to the file locations, but I'm not sure how to solve it. I really don't want all my files to have to be in the downloads folder. ;-)

Code: Select all

...command uiPopulatePeople
   put "images/" into theImageFolder...
I've also tried

Code: Select all

put "Documents/LiveCodeProjects/DatagridLesson/images" into theImageFolder
. That doesn't work.

Another question related to this is: " How do I use an imported image rather than a stored image. The forum had a few similar questions. @Klaus suggested using buttons rather than images, but I wondered if there was a way to use the image. Wouldn't there be more overhead using a button image than only an image? I want to use the datagrid with iOS/Android so overhead could be an issue.

Sorry that I haven't posting more. I'm still here, but I've been lost in the LiveCode woods. Now, I'm just trying to learn from lessons and anything else that I can find. I like LiveCode. If I can just learn enough to do something productive I would be happy. My work with arrays is still ongoing.

I've also been reading the forum and trying to see if I could contribute, but most of the questions aren't about anything I know yet. :(

Have a day filled up with the best of times.
-Rachel
May I never be cured of my curiosity! :D

Klaus
Posts: 13806
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany
Contact:

Re: Asking a little help with datagrid or file locations

Post by Klaus » Fri Mar 22, 2019 8:11 pm

Hi Rachel,

this should do the trick:

Code: Select all

...
put specialfolderpath("documents" & "/LiveCodeProjects/DatagridLesson/images" into theImageFolder
...
Or better just re-create the original folder structure and copy that folder "images", which MUST still be in your downloads folder, into your "LiveCodeProjects/DatagridLesson" folder.

The stack obviously uses an RELATIVE pathname and will surely not work if you move that stack to some other folder, sounds logical, right!? So just don't do that! 8)
How do I use an imported image rather than a stored image. The forum had a few similar questions. @Klaus suggested using buttons rather than images, but I wondered if there was a way to use the image. Wouldn't there be more overhead using a button image than only an image? I want to use the datagrid with iOS/Android so overhead could be an issue.
Referenced or imported, does not make any difference really!

My proposal to use the images as ICONS in BUTTONS was only if you want to diplay the same image more than once in your stack. Since this way only ONE instance of the image is neccessary.

Best

Klaus

ValiantCuriosity
Posts: 128
Joined: Thu Jun 30, 2016 3:08 am

Re: Asking a little help with datagrid or file locations

Post by ValiantCuriosity » Fri Mar 22, 2019 10:21 pm

Ahhhhhh,
specialFolderPath()
is the magic word/function that opens the hidden path in the LC woods. :D

Thanks Klaus.
-Rachel
May I never be cured of my curiosity! :D

Klaus
Posts: 13806
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany
Contact:

Re: Asking a little help with datagrid or file locations

Post by Klaus » Sat Mar 23, 2019 10:19 am

You've already used specialfolderpath() before, Ma'am! 8)

TerryL
Posts: 78
Joined: Sat Nov 23, 2013 8:57 pm

Re: Asking a little help with datagrid or file locations

Post by TerryL » Wed Mar 27, 2019 6:44 pm

Hi Valiant. The datagrid form is the most complex object in LiveCode. New coders seem drawn to it like moth to flame, get burned and quickly lose interest. There's lots of LiveCode to explore without ever going near a datagrid. Here's a few links you might find helpful.

An essential Datagrid PDF: http://lessons.livecode.com/s/lessons/m/datagrid/pdf
Datagrid Lessons: http://lessons.livecode.com/m/datagrid
LC Share Download: http://livecodeshare.runrev.com/
LC Latest Version: http://downloads.livecode.com/livecode/
In shameless self-promotion, I have a public stack "Beginner Lab" that includes two lessons on datagrids among a few other subjects. Maybe it will help. Google "LiveCode Starter Kit" or https://tlittle72.neocities.org/info.html to download.
Terry
Beginner Lab (LiveCode tutorial) and StarterKit (my public stacks)
https://tlittle72.neocities.org/info.html

ValiantCuriosity
Posts: 128
Joined: Thu Jun 30, 2016 3:08 am

Re: Asking a little help with datagrid or file locations

Post by ValiantCuriosity » Fri Mar 29, 2019 4:26 am

Hi @Terry,

Thanks for the links and the thoughtful comments. I've been off the grid for a few days. I'll check out some of the links that you took the time to write up.

Oh, and, yes, you are so right about the datagrid. Loved the way you phrased it. The first time I tried LC in 2016, I jumped right at the grid. I went into a deep dive. I barely made it out alive and LC languished while I learned other technologies.I'm still not sure that LC will be where I actually stay, but I'm enjoying my time with it now. i've been working through a lot of material. I know that, eventually, the data form is where I will need to end up, but I'm taking my time. Your links will help a lot.

As I've said previously, the forum members are really what keeps me wanting to learn LC well enough to use it.

Smiles to all,
-Rachel
May I never be cured of my curiosity! :D

Klaus
Posts: 13806
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany
Contact:

Re: Asking a little help with datagrid or file locations

Post by Klaus » Fri Mar 29, 2019 10:54 am

Hi Terry,
TerryL wrote:
Wed Mar 27, 2019 6:44 pm
The datagrid form is the most complex object in LiveCode. New coders seem drawn to it like moth to flame, get burned and quickly lose interest.
so true, I experience this very often in the german LC forum. :D


Best

Klaus

jacque
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 7214
Joined: Sat Apr 08, 2006 8:31 pm
Location: Minneapolis MN
Contact:

Re: Asking a little help with datagrid or file locations

Post by jacque » Fri Mar 29, 2019 5:23 pm

For what it's worth, I have never needed a datagrid. It's good for managing records from a database where you might need dynamic population of large amounts of data, but for most things it's overkill. LC has some very good field and text capabilities that allow you to display content much the way the datagrid does without the complexity and without needing to add extra stacks to the project. Scrolling a datagrid is a little iffy too and is smoother with a standard field.

I view datagrids as a solution to a very specific problem that works great with databases (thus its name) but not usually required for a fixed amount of field content.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

ValiantCuriosity
Posts: 128
Joined: Thu Jun 30, 2016 3:08 am

Re: Asking a little help with datagrid or file locations

Post by ValiantCuriosity » Fri Mar 29, 2019 6:06 pm

@jacque

Thank you again for your knowledgeable help. I may have gotten confused by the example shown in the datagrid form lesson. It emulates the typical iOS list with thumbnails. That made me think that I should use the datagrid for iOS list views.

I have to use a tableview/listview to rebuild my app. Currently, I have a list that is populated dynamically using json. The list has a thumbnail, a title, and a description. It is basically a selector whereby the user can click on a selection and then be taken to a complete explanation of the item along with a video and other information. I'm all for using the most simplistic approach. One of my apps is way too big and I need to slim it down a lot. I was hoping to find a way to do this, but I have no idea how much LC will reduce my overhead since a lot of that depends on my ability to rewrite things properly.

I'll look at fields a little more to see how they might be used to emulate the "look and feel" of my current app. They certainly are powerful.

Have a great day.
-Rachel
May I never be cured of my curiosity! :D

jacque
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 7214
Joined: Sat Apr 08, 2006 8:31 pm
Location: Minneapolis MN
Contact:

Re: Asking a little help with datagrid or file locations

Post by jacque » Sat Mar 30, 2019 4:50 pm

You may be better off with a datagrid in that case actually, though before we had datagrids we'd do this with groups instead. Set up a single group with the image and text fields and then clone it as many times as necessary. Each clone would have to insert the correct content by script, and the clones would all be part of an enclosing group that scrolled.

It may be a toss up which you think is easier.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

bogs
Posts: 5435
Joined: Sat Feb 25, 2017 10:45 pm

Re: Asking a little help with datagrid or file locations

Post by bogs » Sat Mar 30, 2019 5:00 pm

jacque wrote:
Sat Mar 30, 2019 4:50 pm
It may be a toss up which you think is easier.
SEND IN THE CLONES !! :twisted:
Image

SparkOut
Posts: 2839
Joined: Sun Sep 23, 2007 4:58 pm

Re: Asking a little help with datagrid or file locations

Post by SparkOut » Sat Mar 30, 2019 10:25 pm

That description sounds just right for datagrids.
Datagrids are complex beasts, but they are not just complex. They ARE much simpler than equivalent grouped control constructions, it's the reason for their existence.
And Trevor made them so they work, and well.

Klaus
Posts: 13806
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany
Contact:

Re: Asking a little help with datagrid or file locations

Post by Klaus » Sat Mar 30, 2019 11:11 pm

SparkOut wrote:
Sat Mar 30, 2019 10:25 pm
And Trevor made them so they work, and well.
AND they look just cool right out-of-the-box with the resizable column headers,
build-in sorting and all... :D
Maybe another reason why newbies are so attracted by this beast.

bogs
Posts: 5435
Joined: Sat Feb 25, 2017 10:45 pm

Re: Asking a little help with datagrid or file locations

Post by bogs » Sun Mar 31, 2019 4:04 am

SparkOut wrote:
Sat Mar 30, 2019 10:25 pm
And Trevor made them so they work, and well.
That is true, but it just sounds so much cooler to say "SEND IN THE CLONES!!"
(It worked in Star Wars, after all) :twisted:
Image

Post Reply

Return to “Getting Started with LiveCode - Complete Beginners”