Save and restore workarea, index etc.

General Help regarding HMG, Compilation, Linking, Samples

Moderator: Rathinagiri

Post Reply
User avatar
sudip
Posts: 1456
Joined: Sat Mar 07, 2009 11:52 am
Location: Kolkata, WB, India

Save and restore workarea, index etc.

Post by sudip »

Hi All,

Is there any function/s to save and restore work areas, indexes, relations, record numbers etc (which may be used during LostFocus and GotFocus of a window)?
Do you have any idea about it?
IMHO, it is required mainly for .dbf and RDDs.

TIA.

With best regards.

Sudip
With best regards,
Sudip
jparada
Posts: 433
Joined: Fri Jan 23, 2009 5:18 pm

Re: Save and restore workarea, index etc.

Post by jparada »

Hi Sudip, please take a look at following code:

Code: Select all

/****
* 
****/
Function SaveDbf( )

Return( { Select(), Iif( Used(), OrdSetFocus(), .F.) , Iif( Used(), Recno(), .F. ) } )
/********/

/****
* 
****/
Procedure RestDbf( _Arreglo )

  Select( _Arreglo[1] )
  If ValType( _Arreglo[2] ) = "C" .and. ! Empty( _Arreglo[2] )
     OrdSetFocus( _Arreglo[2] )
  Endif
  If ValType( _Arreglo[3] ) = 'N'
     Go _Arreglo[3]
  Endif

Return
/********/
I hope is helpful for you, or you can give an idea for what you need

Greetings
Javier
User avatar
sudip
Posts: 1456
Joined: Sat Mar 07, 2009 11:52 am
Location: Kolkata, WB, India

Re: Save and restore workarea, index etc.

Post by sudip »

Hello Javier,

Thanks a lot. Your code will be extremely helpful :)
With best regards.
Sudip
With best regards,
Sudip
jayadevu
Posts: 240
Joined: Tue May 19, 2009 7:10 am

Re: Save and restore workarea, index etc.

Post by jayadevu »

Dear Sudip,

Pls go thru the attached program, this is platform independent and extremly useful to save and restore database information.

Before changing the workarea, use dstk_push(), after your database operations use dstk_pop()

This program is from the book on clipper programming by Rick Spence.

Warm regards,

Jayadev
Attachments
DBF_STK.zip
(984 Bytes) Downloaded 247 times
User avatar
sudip
Posts: 1456
Joined: Sat Mar 07, 2009 11:52 am
Location: Kolkata, WB, India

Re: Save and restore workarea, index etc.

Post by sudip »

jayadevu wrote: Pls go thru the attached program, this is platform independent and extremly useful to save and restore database information.

Before changing the workarea, use dstk_push(), after your database operations use dstk_pop()

This program is from the book on clipper programming by Rick Spence.
Thanks a lot Jayadev.

Now, is it possible to add SET RELATION in those functions (both from Rick Spence and Jayadev)?

With best regards.

Sudip
With best regards,
Sudip
Post Reply