Load Array and put it into a Datagrid - Bugs?

Deploying to Windows? Utilizing VB Script execution? This is the place to ask Windows-specific questions.

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
Tomka
Posts: 59
Joined: Mon Apr 18, 2011 7:30 pm

Load Array and put it into a Datagrid - Bugs?

Post by Tomka » Sat Aug 11, 2012 2:24 pm

Hi there,

since weeks i´m working on really nasty problem. The attached .zip contains the isolated problem:

in the .livecode-file you can see what i wanna do: Btn "Laden" loads an array from a binfile. The buttons "0" and "1" sorts the datagrid by the column "Flag_Abstossung". It works well in Livecode BUT NOT in a standalone.

I cant find any reasons why its not working like under development-envoirment.

Anyone got a idea whats wrong in this little scripts?


bet wishes
Thomas

edit: In a former state of work (btns "0" & "1" werent working) the array was succesfully loaded into the grid. Then I added the scripts for the 2 buttons and nothing works anymore.
Attachments
load datagrid.zip
(4.25 KiB) Downloaded 535 times

sturgis
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 1685
Joined: Sat Feb 28, 2009 11:49 pm

Re: Load Array and put it into a Datagrid - Bugs?

Post by sturgis » Sat Aug 11, 2012 2:56 pm

The most likely answer is that the datagrid template got deleted. (it as an automatically created substack added to the project when a datagrid is added)

Try this..

Open your stack in the IDE.
Add a new datagrid
Delete the new datagrid
When it asks if you want to delete the template associated with the datagrid answer no.
Save your stack.
Build the standalone and see if it works.

You must also make sure that your data file is in the right spot. If you go to your standalone settings, the copy files pane, you can add the file that contains your encoded array. This way, when you build the standalone that file will be copied and placed next to the .exe. (or on a mac it would place it in the .app package) The defaultfolder when the application starts should be the directory it executes from so if the data file should be readable using your current code.

After adding and removing a datagrid, but leaving the template, your stack is working for me as a standalone.

Klaus
Posts: 14177
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: Load Array and put it into a Datagrid - Bugs?

Post by Klaus » Sat Aug 11, 2012 2:57 pm

Hi Tom,

I think this is just a path problem!
You have this in the btn "Laden":
...
## No path, just the filename!
put URL "binfile:test_highscores" into zwischen
...
And in the standalone the DEFAULTFOLDER is obviously set to somewehre else!
This also did not work in my IDE because of this, I had to set the defaultfolder first! 8)

Crate an ABSOLUTE pathname with the stack/standalone filename and it should work.


Best

Klaus

Tomka
Posts: 59
Joined: Mon Apr 18, 2011 7:30 pm

Re: Load Array and put it into a Datagrid - Bugs?

Post by Tomka » Sat Aug 11, 2012 3:02 pm

Hi sturgis,

thx alot this works. Never mentioned that the substack was deleted or so. This is really nasty.

@Klaus:

No, it wasnt the path cause I copied the .exe-file in the same directory like the binfile.

sturgis
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 1685
Joined: Sat Feb 28, 2009 11:49 pm

Re: Load Array and put it into a Datagrid - Bugs?

Post by sturgis » Sat Aug 11, 2012 3:08 pm

It is possible the substack was accidentally deleted in the app browser. (or the message box) If you right click a substack in the app browser and click delete it goes away with no warning this is true. While its not EASY to accidentally delete a substack it is certainly possible, but now that you know what to look for you'll be able to watch for the problem. (open the application browser, click the disclosure triangle next to your stack name, and see if there is a numbered datagrid template stack listed there also)

If its not there, that is a problem.
Tomka wrote:Hi sturgis,

thx alot this works. Never mentioned that the substack was deleted or so. This is really nasty.

Klaus
Posts: 14177
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: Load Array and put it into a Datagrid - Bugs?

Post by Klaus » Sat Aug 11, 2012 3:31 pm

Tomka wrote:@Klaus:
No, it wasnt the path cause I copied the .exe-file in the same directory like the binfile.
OK, it looked like :D

Post Reply