[NTLK] Need help with store parts

Matthias Melcher m.melcher at robowerk.de
Tue Mar 1 05:42:43 PST 2022



> On 1. Mar 2022, at 03:25, NewtonTalk <newtontalk at pda-soft.de> wrote:
> 
> Still facing the eternal challenge of localizing NewtTest in a halfway
> elegant way, I've decided that what I need is Store Parts.

> Well, I kind of
> HAD to decide it, after my brand spankin' new Custom Part, when installed on
> my Newton, reported the error "Part type not registered", and my thousands
> of pages of Apple's documentation didn't describe if, and how, one can
> register a part type.

Not sure if that was ever implemented. You have Application, Book, Auto, Store, and Stream available.

> // create the soup but don't xmit at build time
> local soup:=theStore:CreateSoupXmit(kSoupName, kSoupIndices, nil);
> 
> // add a couple entries
> soup:Add({anInteger: 1}) ;
> soup:Add({anInteger: 2}) ;
> 
> This doesn't work because when trying to add the two entries at the end, NTK
> complains
> 
>   Undefined variable: Soup

Not sure why it can't find "Soup" (pretty much everything in NewtonScript is case insensitive, so "Soup"=="soup"=="souP"). Maybe it is because of your older version of NTK, or maybe you have not set your Platform to Newton 2.0 in your project settings dialog. 

The text above should be in the only text file for this particular package. The script commands in this file run at Compile time and help to generate the package, so checking the return value of CreateSoupXmit may make sense. Maybe don;t make 'stor' local, or maybe put the entire code between a 'begin'...'end' to ensure the local scope.

I have the distinct feeling that all these advanced features were implemented, but not yet extensively tested when the last bits of development were thrown together for the "last release". Maybe any of the original devs can chime in?

> Any suggestions? A basic rule of thumb seems to be that Newton-related
> documentation does, more often than not, not tell the entire truth :-(

Good luck.

 - Matthias


More information about the NewtonTalk mailing list