[Etoys] SugarDataStore>>getFilename: problem

Bert Freudenberg bert at freudenbergs.de
Tue Dec 30 05:08:22 EST 2008

On 30.12.2008, at 00:44, karl ramberg wrote:

> Hi,
> I've been trying to get jpegs loaded from datastore but keep getting
> errors with SugarDataStore>>getFilname:id. I use this code:
> store := SugarDataStore new.
> list := (store find:{'mime_type'->#('application/x-squeak-project'
> 'image/jpeg')} with:#('uid')).
> id := ((list at:1) at:'uid') asString.
> store getFilename: id.
> I can test different entries in the journal changing 'list at:1' to
> different numbers. Problem is that the Squeak projects return a file
> path but jpegs return only ''
> Does anybody have a suggestion ?

It's a simple typo I assume - list is an array of 2 elements, the  
second is the total number of items, the first is an array of  
dictionaries for each entry. Your code should look like

   list := (store find: ... with: ...) first.

With that change it works fine here (and the #asString send is not  
even needed).

If it does not then maybe your jpeg journal entries indeed do not have  
files in them? Can you open them in another activity?

- Bert -

More information about the Etoys mailing list