RE: tsunami question
- Posted by Ron Austin <ronaustin at alltel.net> Dec 17, 2003
- 490 views
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>