Reading in images with a standalone
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
-
- Posts: 7
- Joined: Tue Apr 28, 2009 6:33 pm
Reading in images with a standalone
I am creating a program with about 100 image files. The way I have it set up is to loop through a list of filenames, setting the image to the specified filename on each iteration. When transferring to a standalone, the images are not showing up, presumably because the program is not accessing the files. If you add the file in the standalone settings panel, the image shows up, but this method is not particularly user friendly as it only lets you add one file at a time...making entering 100 or so onto that list rather tedious (especially when I am dealing with about 4 experiments of 100 images at a time). Is there another way for the standalone to be able to read the image files in? Perhaps I could do something from within the code that would allow it to access the files?
Like with your writing file question, this boils down to wrong filepaths. try to make a small test app with your filepath code put into a field instead of directly trying to access the file, and look where the problem could be. An example could be:
If you do not know how a correct path should look like, use the following code in the message box to see a path:
common problems:
- forgetting brackets around urls. the url will only work if it's all in one piece so the following won't work:
- using && instead of &: This has bitten me quite a few times... strangely i do not learn from that experience 
- missing slashes, or too many slashes. Again make sure your path is exact and correct.
- using existing paths that change when on another computer/directory/hard disk: If you hardcode the wrong parts of your path (for example always using "c:" then you might run into problems when the code is run from other locations.
Code: Select all
on mouseUp
put the effective filename of this stack into thePath
set the itemdelimiter to slash
put item 1 to -2 of thePath & slash into thePath
--go url ("binfile:" & thePath & "data.rev")
put thePath into field 1
end mouseUp
Code: Select all
answer file ""; put it
- forgetting brackets around urls. the url will only work if it's all in one piece so the following won't work:
Code: Select all
put url "file:" & myPath into theVar
--correct would be:
put url ("file:" & myPath) into myVar

- missing slashes, or too many slashes. Again make sure your path is exact and correct.
- using existing paths that change when on another computer/directory/hard disk: If you hardcode the wrong parts of your path (for example always using "c:" then you might run into problems when the code is run from other locations.
Various teststacks and stuff:
http://bjoernke.com
Chat with other RunRev developers:
chat.freenode.net:6666 #livecode
http://bjoernke.com
Chat with other RunRev developers:
chat.freenode.net:6666 #livecode
-
- Posts: 7
- Joined: Tue Apr 28, 2009 6:33 pm