RE: tsunami help

new topic     » goto parent     » topic index » view thread      » older message » newer message

Sorry George,  as far as I know, Tsumani only writes one thing: record 
-- which is a string.  I didn't see any provision for writting sequence, 
sequence, atom, integer, etc.  Then again, I've been writting records of 
one string for over 20 years, so I really never looked for anything 
else.  I'll check it out and get back to you tonight after I get back 
from Valdosta, GA.
George Walters wrote:
> 
> 
> Ron, you missed my question point. Your expample has vars that are 
> strings,
> mine are not. They are either  integer or string or atom... am I going 
> to
> have to convert the record to all string fields?
> 
> george
> ----- Original Message -----
> From: "Ron Austin" <ronaustin at alltel.net>
> To: <EUforum at topica.com>
> Sent: Tuesday, December 16, 2003 2:59 PM
> Subject: RE: tsunami help
> 
> 
> > George Walters wrote:
> > >
> > >
> > > I'm trying to figure out how to use tsunami record manager. Here's my
> > > problem/question.
> > >
> > > I have a record {1,250,"Company 250", 1,3....etc) which is a customer
> > > setup
> > > record.
> > >
> > > 1 = company number (integer) ( 2 digits max)
> > > 250 = customer number (integer) (6 digits max)
> > >
> > > the key in EUdata base would be " 1    250"
> > >
> > > rc = trmSegDef (1,"company", 1, 1, 2, 0)
> > > rc = trmSegDef (2,"CustNbr", 1, 2, 6, 0)
> > >
> > > Is this how I would try to define the segments? Reading the doc it would
> > > seem that the segment fields for a key should be strings not integers or
> > > atoms. So I'm confused on how to get back a record once it's been
> > > written.
> > >
> > > record = GegEqual(atom hFile, 1 , {1, 250})............Is this how? Or
> > > do I
> > > have to construct a string key and if so then I'm really confused how
> > > the
> > > input and output get matched up.
> > >
> > > thanks for any pointers.
> > >
> > > george
> > >
> > > I use strings for my keys.  Your seg defs are okay, except I would use a
> > > 6 for the flag parameter:
> > rc = trmSegDef (1,"company", 1, 1, 2, 6)
> > rc = trmSegDef (2,"CustNbr", 1, 2, 6, 6)
> >
> > The 6 means no duplicates allowed and no key compression used.
> > all the flags are listed below:
> >
> > Here's one of my init files:
> >
> > -- Diaginit.exw - by Ron Austin -- bubbashrimp
> > -- Initializes files using Tsunami Wrapper written
> > --                         by H.W. Overman -- euman
> >
> > include trm_eu.ew
> > object result,
> >       EyePath,
> >           fio
> >
> >
> >    EyePath = getenv("EYEDIR")
> >     puts(1,EyePath)
> >   fio = "Diagnosis.dat"
> >       if sequence(EyePath) then
> >     fio=EyePath&"\\Data\\Diagnosis.dat"
> >         end if
> >
> > -- Step 1: define the Tsunami file ----------------------------
> >
> > result = trm_FileDef(1, 0, 2) -- 1 page, no compression, 2 key segments
> >
> > -- Step 2: define the Tsunami file's key segment(s) -----------
> >
> > -- trmSegDef (segment#,index name,key #, start location, length, flags)
> > --flags
> > -- 1 - case sensitive
> > -- 2 - no duplicates
> > -- 4 - no compression
> > -- 8 - binary key
> > -- 2+4=6 -- no dups, no key compression
> > result = trm_SegDef(1, "Diag_Code", 1, 1, 6, 6)
> > result = trm_SegDef(2, "Diagnosis", 2, 8, 44, 4)
> >
> > -- Step 3: - create the Tsunami file --------------------------
> > result = trm_Create(fio, 1)
> > --if  not result then
> > result = message_box(fio&" created successfully ","File Created ",
> > MB_OK)
> > --end if
<snip>

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu