Re: [NTLK] Okay, Newtonscript, I give up.

From: Paul Guyot (pguyot_at_kallisys.net)
Date: Thu Feb 19 2004 - 14:52:38 PST


Aux environs du 19/02/04 à 4:35 -0600, sous le titre "[NTLK] Okay,
Newtonscript, I give up.", Jack Burks prit sa plus belle plume pour
écrire les mots suivants:
>create a union soup using GetUnionSoup

GetUnionSoup doesn't create any soup. Actually, union soups are just
unions of soups and they do not exist per se. However, when you do:

>RegUnionSoup(kAppSymbol,{name: "High Scores",userName:"High
>Scores",ownerApp:kAppSymbol,ownerAppName:kAppName,indexes:{structure:'slot,p
>ath:'levels,type:'int}})

you do get some object that will create your soup when you will call
AddToDefaultStoreXmit on it. I.e. AddToDefaultStoreXmit will trigger
a call to CreateSoupXmit.

But this will fail because you didn't specify the indexes properly.
Indexes is an array of indexes, not a single index. The function
doesn't tell you and this is why I prefer to do it manually (i.e.
with GetDefaultStore():CreateSoupXmit(...) and then AddIndexXmit and
SetInfoXmit).

Anyway. You should try:

local myUnionSoup := RegUnionSoup(
     kAppSymbol,
     {
        name: "High Scores:" & kAppSymbol, // <-- notice how I make this
                                           // unique to your application
        userName: "High Scores",
        ownerApp: kAppSymbol,
        ownerAppName: kAppName,
        indexes:
            [
                {
                    structure: 'slot,
                    path: 'levels,
                    type: 'int
                },
                // <-- other indexes may come here
                // such as indexes on the timestamp.
            ]
     });

Also, to get this working, you may need (on your own Newton)
UnRegUnionSoup on the name (well, actually, since I advise you to use
something else than "High Scores" for the name, it may not be
necessary). What I mean is that RegUnionSoup will maintain in memory
the soup definition including the buggy index array if you passed a
frame (and not an array). And this thing goes away with a call to
UnRegUnionSoup. It probably also goes away with a restart.

HTH,

Paul

-- 
Philosophie de baignoire - consultations sur rendez-vous.
NPDS/NewtonOS: http://newton.kallisys.net:8080/
Apache/FreeBSD: http://www.kallisys.com/
-- 
This is the NewtonTalk list - http://www.newtontalk.net/ for all inquiries
List FAQ/Etiquette/Terms: http://www.newtontalk.net/faq.html
Official Newton FAQ: http://www.chuma.org/newton/faq/


This archive was generated by hypermail 2.1.5 : Thu Feb 19 2004 - 15:30:02 PST