How to use Slurpee to get and put records for NewtDb---------------------------------------------------Slurpee is a soup entry / dump Newton program by Steve Weyer. If you use it please pay his shareware fee. You should user version 1.7 of Slurpee or later. Starting with v1.7, it's NOS 2.0 compatible. Slurpee uses a terminal program on a PC/Mac to send and receive data. See the Slurpee readme on terminal programs.Basic Slurpee usage-------------------Start Slurpee running on Newton. It defaults to 9600 baud, 8 bits, no parity, and 2 stop bits.Remember to set an inter-line delay in your terminal so that Slurpee can process the commands. Two seconds should do it. This delay will be needed when you send records to Slurpee as Newton sometimes needs a second to make a new soup entry.For Z-Term, it's the Settings -> Text Pacing -> Delay between lines. Turn off "Wait for character echo" and have "Line Prompt Char" blank.Slurpee always wants a Soup name (watch Slurpee's display) before doing anything. NewtDb's database soups are named NewtDb01:dmp to NewtDb16:dmp.After sending a soup name, Slurpee wants a frame spec. The frame spec. tells Slurpee how to dump the data. NewtDb's basic frame spec is:{NewMod:'symbol,SeqNum:"int",_modtime:"int",i0:"string",i1:"string",i2:"string", dbdata:["string","string","string"]} This basic frame spec. has all the items in the soup that NewtDb defines. All of them. You won't need all of them all of the time, but there they are.NewMod: Set to new, old, or modified to show how a record has been used.SeqNum: The highest record number that NewtDb (or the NCK) makes when adding records. _modtime: The internal Newton way of keeping track when a record has been modified.i0, i1 and i2: The three indexes that NewtDb uses for searches.dbdata: The array of your data in that record. Note: you must place as many "string" parameters inside the "[]'s as you have fields in your database. When dumping records, Slurpee can have some optional parameters in the DUMP! command. We'll use this DUMP command for NewtDb:DUMP!{delay: 1, printFunction: func(v) SPrintObject(v), fieldDelimiter: "", recordDelimiter: "", soupDelimiter: ""}The "Delay:1" says to wait one second after receiving the command before sending the data.The "" is the separator Slurpee places between fields.The "" is separator Slurpee places at the end of each record.The "" is separator Slurpee places at the end of the soup dump.You can change any of the above separators. Slurpee also puts an extra field separator at the end of each record so use an editor or word processor to search and replace the combination of to what you want at the end of a record.For the separators, you can make them other characters that can not be put tin quotes. Examples are "\t" for tab, "\n" for a new line. Just like in 'C'.Ok. Enough with the techie stuff. On to Slurping. It's best to work with a text editor to hold the commands which you can then paste into the terminal program.Newton to Desktop-----------------Dump the following to Slurpee, one line at a time so you can see what changes in the Slurpee status window:newtdb7:dmp{NewMod:'symbol,SeqNum:"int",_modtime:"int",i0:"string",i1:"string",i2:"string", dbdata:["string","string","string"]} DUMP!{delay: 1, printFunction: func(v) SPrintObject(v), fieldDelimiter: "", recordDelimiter: "", soupDelimiter: ""}Did you remember to change the soup name ? How about putting enough "string" 's in the dbdata:[] space ?You'll get a dump something like this:new24879966312345Sprocket14.9512345Sprocket14.95new44879955522345End Cap12.0522345End Cap12.05new64879955533412Bearing Rod1023.9933412Bearing Rod1023.99new84879955541232Muffler19.9541232Muffler19.95new104879955551632Oil Filter3.0551632Oil Filter3.05new124879955562853Tire47.0062853Tire47.00new144879955572492Filter19.0572492Filter19.05new164879955587823Wiper4.2387823Wiper4.23new184879955593524WW Fluid.9993524WW Fluid.99Great ! Now, do it again and before pasting the lines in you terminal program, set it to store incoming text to disk. Most terminal programs have this feature. Some call it "Capture Session" or just plain "Capture". It is NOT any type of ASCII / Text file receive.Now you can shorten the frame spec to just the data. No need for the _modtime or the i0,i1,i2 index fields. Try a frame spec of just: {dbdata:["string","string","string"]} Example:newtdb7:dmp{dbdata:["string","string","string"]} DUMP!{delay: 1, printFunction: func(v) SPrintObject(v), fieldDelimiter: "", recordDelimiter: "", soupDelimiter: ""}You'll get something like:12345Sprocket14.9522345End Cap12.0533412Bearing Rod1023.9941232Muffler19.9551632Oil Filter3.0562853Tire47.0072492Filter19.0587823Wiper4.2393524WW Fluid.99Just the record data fields were sent.Desktop to Newton--------------------OK. So much for dumping records to your PC/Mac. Now lets put some new records into Newton.Stop !! Did you remember to Back Up your Newton ? Just in case you really mess it up? Do so now !Slurpee wants data to be tab delimited when sending to Newton. This is different than when using NCK to import data to NewtDb !Now lets define a frame spec for sending data to Newton:{NewMod:'symbol,SeqNum:"int",i0:"string",i1:"string",i2:"string", dbdata:["string","string","string"]} We don't want the _modtime:"int" field as it's an internal Newton one.The NewMod and SeqNum fields would have been created when you used NCK. We'll put some default values there so NewtDb can see them. For NewMod use "new" and for SeqNum use "0". If you can, for ease of exporting your data from your desktop database, create two new fields for each record.Since you're sending new records directly into Newton, you'll have to send the index data too. A work around is to just send anything for the index data and then, in UtilityDb, do a Re-Index database operation. But you must send something or else the index place holders in a record will not be created. This *will* cause NewtDb to crash !Since you're probably doing a tab delimited export from you Mac/PC database, just include the fields that are indexed twice in your export setup. Once at the start of the record for the index and then for the actual data. If you can limit the number of characters for the indexes (i0,i1,i2, not the data field) then so much the better. You you can't, then do a database re-index (in UtilityDb) after enter records, before using NewtDb.Check my web page for a Mac / PC program that will read your database export file and make the Indexes, NewMod and SeqNum fields for a ready to Slurp file. I'll write one when I get a chance.So, to enter a record to Newton, look at the following example of data being sent to Newton:newtdb7:dmp{NewMod:'symbol,SeqNum:"int",i0:"string",i1:"string",i2:"string", dbdata:["string","string","string"]} new 0 111 222 333 111 222 333new 0 555 666 7777 555 666 7777BYE!The above sends 2 new records to the NewtDb database #7. Each record has three fields. The data lines are:Records are marked as "new".The Sequence Number is 0.The three index fields data is next sent.The last data are the three datum for the fields.After all records are send, the BYE! command terminates the entry mode.That's all there is. Have fun !This document is copyright 1996 by Dave Pompea, DMP Systems. All rights reserved.Comments and questions to:Dave PompeaDMP Systems62 Brittany cir.Rochester NY 14618email:CIS: 74736,172AOL: DPOMPEA