1. RE: tsunami question

George Walters wrote:
> 
> 
> I don't see a function to clear a tsunami file w/o deleteing it and
> recreating it. Did I over look this? I have a lot of files that are 
> cleared
> at the end of the month or year as well as transaction files that need 
> to be
> cleared after being posted.
> 
> george
> when you create a file using trm_Create("my.dat",flag), if flag=1 then 
> you can re-create and clear the file.  If flag=0 and you try to recreate 
> the file you get a warning message.  If you used flag=1 then you could 
> write an include file with procedure that would re-create and clear the 
> file.  You don't have to erase the file first.
>

new topic     » topic index » view message » categorize

2. RE: tsunami question

George Walters wrote:
> 
> 
> Ron, I understand the Create function, but using this you have do define 
> all
> over again the characteristics of the file. I was hoping that a function
> existed that would simply clear the file and retain it's original
> characteristics.
> 
> george
> 
As far as I know, there is no "clear file". I have made an "init.exw 
program for each of my files, for instance DiagInit.exw creates the 
Diagnosis.dat file.  There is one line to define the file, two lines to 
create the two indexes and then the final line creates (or re-creates 
the file).  Since the init program had to be written to initally create 
the file, all you have to do is run it again to clear the file, or as I 
said earlier maybe it wood be good to put the procedure for creating all 
the indexes in one include file and call them as needed.  
ClearFile("Diagnosis.dat") or even CLearFile("Diagnosis") is all you 
would need.  Of course you would still have to be sure no one was using 
the file when you cleared it.  I imagine you are already doing that with 
your present file system anyway.
> ----- Original Message -----
> From: "Ron Austin" <ronaustin at alltel.net>
> To: <EUforum at topica.com>
> Sent: Wednesday, December 17, 2003 12:20 PM
> Subject: RE: tsunami question
> 
> 
> > George Walters wrote:
> > >
> > >
> > > I don't see a function to clear a tsunami file w/o deleteing it and
> > > recreating it. Did I over look this? I have a lot of files that are
> > > cleared
> > > at the end of the month or year as well as transaction files that need
> > > to be
> > > cleared after being posted.
> > >
> > > george
> > > when you create a file using trm_Create("my.dat",flag), if flag=1 then
> > > you can re-create and clear the file.  If flag=0 and you try to recreate
> > > the file you get a warning message.  If you used flag=1 then you could
> > > write an include file with procedure that would re-create and clear the
> > > file.  You don't have to erase the file first.
> > >
> >
> > TOPICA - Start your own email discussion group. FREE!
> >
> >

new topic     » goto parent     » topic index » view message » categorize

3. RE: tsunami question

That's interesting George, but I believe it assumes you are using the 
"String based API"  and Euman used the "Pointer based API #1".

I don't think there is a way of passing a filedef when creating the file 
with the pointer base api.

string  API: result= trmCreate(file$,FileDef$,OverWrite)
pointer API: result= trmCreate(file,OverWrite)

pointer based assumes the filedef has already been defined.

Maybe Euman will have a different answer, but that's the way I see it.


George Walters wrote:
> 
> 
> Ron, there was some interesting code (power basic) on the TRM website on
> this issue.
> 
> 
>  ' Open the existing Tsunami file
> 
>  MultiUser& = %FALSE
>  File$      = "C:\My Data\Customers.dat"
> 
>  hFile& = trm_Open(File$, MultiUser&)
> 
>  IF hFile& < 1 THEN
>     Msg$ = "Error opening file:" + STR$(ABS(hFile&))
>     ' Display message
> 
>  ELSE
>     ' File opened successfully
>     ' Get it's File Definition string
> 
>     FileDef$ = trm_GetFileDef(hFile&)
> 
>     ' Close the file so it can be recreated
> 
>     Result& = trm_Close(hFile&)
> 
>     IF Result& THEN
>        Msg$ = "Error closing file:" + STR$(Result&)
>        ' Display message
> 
>     ELSE
>        ' The file is closed... we can now recreate it using the
>        ' file's original name and original File Definition string
> 
>        OverWrite& = %TRUE
> 
>        Result& = trm_Create(File$, FileDef$, OverWrite&)
> 
>        IF Result& THEN
>           Msg$ = "Error recreating file:" + STR$(Result&)
>           ' Display message
>        ELSE
>           ' File recreated successfully
>        END IF
> 
>     END IF
>  END IF
> 
> 
> ----- Original Message -----
> From: "Ron Austin" <ronaustin at alltel.net>
> To: <EUforum at topica.com>
> Sent: Wednesday, December 17, 2003 1:26 PM
> Subject: RE: tsunami question
> 
> 
> > George Walters wrote:
> > >
> > >
> > > Ron, I understand the Create function, but using this you have do define
> > > all
> > > over again the characteristics of the file. I was hoping that a function
> > > existed that would simply clear the file and retain it's original
> > > characteristics.
> > >
> > > george
> > >
> > As far as I know, there is no "clear file". I have made an "init.exw
> > program for each of my files, for instance DiagInit.exw creates the
> > Diagnosis.dat file.  There is one line to define the file, two lines to
> > create the two indexes and then the final line creates (or re-creates
> > the file).  Since the init program had to be written to initally create
> > the file, all you have to do is run it again to clear the file, or as I
> > said earlier maybe it wood be good to put the procedure for creating all
> > the indexes in one include file and call them as needed.
> > ClearFile("Diagnosis.dat") or even CLearFile("Diagnosis") is all you
> > would need.  Of course you would still have to be sure no one was using
> > the file when you cleared it.  I imagine you are already doing that with
> > your present file system anyway.
> > > ----- Original Message -----
> > > From: "Ron Austin" <ronaustin at alltel.net>
> > > To: <EUforum at topica.com>
> > > Sent: Wednesday, December 17, 2003 12:20 PM
> > > Subject: RE: tsunami question
> > >
> > >
> > > > George Walters wrote:
> > > > >
> > > > >
> > > > > I don't see a function to clear a tsunami file w/o deleteing it and
> > > > > recreating it. Did I over look this? I have a lot of files that are
> > > > > cleared
> > > > > at the end of the month or year as well as transaction files that
> need
> > > > > to be
> > > > > cleared after being posted.
> > > > >
<snip>

new topic     » goto parent     » topic index » view message » categorize

4. RE: tsunami question

Isn't that a horrible message?  Especially since it left one obvious 
problem out -- FILE DOES NOT EXIST.  I'd check to be sure the file is in 
the directory you are working from or that you have a path to the 
directory.  Every time I have gotten that message it was because the 
file didn't exist.

Euman got these messages from Tsunami and they're okay for a programer, 
but I asked Euman if I could trim them down and make them a little more 
user friendly.  He gave the ok, but I haven't had time to do it yet

George Walters wrote:
> 
> 
> Next problem, I've created all the files and now am trying to open one 
> to
> populate it and am getting this long message that it's not a file 
> created
> with trm or the header is corrupted or created by a different dll 
> version.
> Any Ideas??
> 
> george
> 
> ----- Original Message -----
> From: "Ron Austin" <ronaustin at alltel.net>
> To: <EUforum at topica.com>
> Sent: Wednesday, December 17, 2003 2:51 PM
> Subject: RE: tsunami question
> 
> 
> > That's interesting George, but I believe it assumes you are using the
> > "String based API"  and Euman used the "Pointer based API #1".
> >
> > I don't think there is a way of passing a filedef when creating the file
> > with the pointer base api.
> >
> > string  API: result= trmCreate(file$,FileDef$,OverWrite)
> > pointer API: result= trmCreate(file,OverWrite)
> >
> > pointer based assumes the filedef has already been defined.
> >
> > Maybe Euman will have a different answer, but that's the way I see it.
> >
> >
> > George Walters wrote:
> > >
> > >
> > > Ron, there was some interesting code (power basic) on the TRM website on
> > > this issue.
> > >
> > >
> > >  ' Open the existing Tsunami file
> > >
> > >  MultiUser& = %FALSE
> > >  File$      = "C:\My Data\Customers.dat"
> > >
> > >  hFile& = trm_Open(File$, MultiUser&)
> > >
> > >  IF hFile& < 1 THEN
> > >     Msg$ = "Error opening file:" + STR$(ABS(hFile&))
> > >     ' Display message
> > >
> > >  ELSE
> > >     ' File opened successfully
> > >     ' Get it's File Definition string
> > >
> > >     FileDef$ = trm_GetFileDef(hFile&)
> > >
> > >     ' Close the file so it can be recreated
> > >
> > >     Result& = trm_Close(hFile&)
> > >
> > >     IF Result& THEN
> > >        Msg$ = "Error closing file:" + STR$(Result&)
> > >        ' Display message
> > >
> > >     ELSE
> > >        ' The file is closed... we can now recreate it using the
> > >        ' file's original name and original File Definition string
> > >
> > >        OverWrite& = %TRUE
> > >
> > >        Result& = trm_Create(File$, FileDef$, OverWrite&)
> > >
> > >        IF Result& THEN
> > >           Msg$ = "Error recreating file:" + STR$(Result&)
> > >           ' Display message
> > >        ELSE
> > >           ' File recreated successfully
> > >        END IF
> > >
> > >     END IF
> > >  END IF
> > >
> > >
> > > ----- Original Message -----
> > > From: "Ron Austin" <ronaustin at alltel.net>
> > > To: <EUforum at topica.com>
> > > Sent: Wednesday, December 17, 2003 1:26 PM
> > > Subject: RE: tsunami question
> > >
> > >
> > > > George Walters wrote:
> > > > >
> > > > >
> > > > > Ron, I understand the Create function, but using this you have do
> define
> > > > > all
> > > > > over again the characteristics of the file. I was hoping that a
<snip>

new topic     » goto parent     » topic index » view message » categorize

5. RE: tsunami question

I tried it and I get a "file not open" error, although I know for sure 
that it is open.  I'll report this to Euman next time I talk to him, or 
he might see this post and comment on it before get a chance to talk to 
him.

George Walters wrote:
> 
> 
> Ron, it seems that using trm_GetFileDef(handle) crashes exw.exe. Have 
> you
> tried using it?
> 
> george
> 
> ----- Original Message -----
> From: "George Walters" <gwalters at sc.rr.com>
> To: <EUforum at topica.com>
> Sent: Wednesday, December 17, 2003 3:12 PM
> Subject: Re: tsunami question
> 
> 
> > Next problem, I've created all the files and now am trying to open one 
> > to
> > populate it and am getting this long message that it's not a file 
> > created
> > with trm or the header is corrupted or created by a different dll 
> > version.
> > Any Ideas??
> >
> > george
> >
> > ----- Original Message -----
> > From: "Ron Austin" <ronaustin at alltel.net>
> > To: <EUforum at topica.com>
> > Sent: Wednesday, December 17, 2003 2:51 PM
> > Subject: RE: tsunami question
> >
> >
> > > That's interesting George, but I believe it assumes you are using the
> > > "String based API"  and Euman used the "Pointer based API #1".
> > >
> > > I don't think there is a way of passing a filedef when creating the file
> > > with the pointer base api.
> > >
> > > string  API: result= trmCreate(file$,FileDef$,OverWrite)
> > > pointer API: result= trmCreate(file,OverWrite)
> > >
> > > pointer based assumes the filedef has already been defined.
> > >
> > > Maybe Euman will have a different answer, but that's the way I see it.
> > >
> > >
> > > George Walters wrote:
> > > >
> > > >
> > > > Ron, there was some interesting code (power basic) on the TRM website
> on
> > > > this issue.
> > > >
> > > >
> > > >  ' Open the existing Tsunami file
> > > >
> > > >  MultiUser& = %FALSE
> > > >  File$      = "C:\My Data\Customers.dat"
> > > >
> > > >  hFile& = trm_Open(File$, MultiUser&)
> > > >
> > > >  IF hFile& < 1 THEN
> > > >     Msg$ = "Error opening file:" + STR$(ABS(hFile&))
> > > >     ' Display message
> > > >
> > > >  ELSE
> > > >     ' File opened successfully
> > > >     ' Get it's File Definition string
> > > >
> > > >     FileDef$ = trm_GetFileDef(hFile&)
> > > >
> > > >     ' Close the file so it can be recreated
> > > >
> > > >     Result& = trm_Close(hFile&)
> > > >
> > > >     IF Result& THEN
> > > >        Msg$ = "Error closing file:" + STR$(Result&)
> > > >        ' Display message
> > > >
> > > >     ELSE
> > > >        ' The file is closed... we can now recreate it using the
> > > >        ' file's original name and original File Definition string
> > > >
> > > >        OverWrite& = %TRUE
> > > >
> > > >        Result& = trm_Create(File$, FileDef$, OverWrite&)
> > > >
> > > >        IF Result& THEN
> > > >           Msg$ = "Error recreating file:" + STR$(Result&)
> > > >           ' Display message
> > > >        ELSE
> > > >           ' File recreated successfully
> > > >        END IF
> > > >
> > > >     END IF
> > > >  END IF
> > > >
> > > >
<snip>

new topic     » goto parent     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu