[NTLK] Need help with store parts

NewtonTalk newtontalk at pda-soft.de
Mon Feb 28 18:25:14 PST 2022


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.

HGRMMMPPFFFF....

As to Store Parts, there's a wonderful description, complete with sample
code, starting on page 12-13 of the Newton Programmers Guide. The title is
"Creating a Store Part". How cool's that...

The sample code goes like this (all I've changed is the store name and the
soup name):

// some useful consts; note use of developer signature
constant kStoreName := "NT-FR:FGSoft" ;
constant kSoupName := "French2:FGSoft" ;
constant kSoupIndices := '[] ;

// theStore is a global var provided by NTK
theStore:SetName(kStoreName) ;

// 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

when compiling the package. If I comment those lines out, the package is
compiled fine and downloaded to the Newton. But an empty soup isn't all that
helpful. I'd much rather have localized texts in there...

One thing that puzzles me is that my variable is a lowercase "soup" whereas
NTK complains about not finding "Soup".

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

For what it's worth, I'm running the 1.6.1 version of the Newton Toolkit on
a Windows XP Virtual Box Virtual Machine hosted on a Windows 7 computer.

Thanks

Frank

-- Newton software and hardware at http://www.pda-soft.de




More information about the NewtonTalk mailing list