ADS Tips

ADS Tips

Postby Carles » Thu Dec 27, 2007 8:07 am

Hello,

I think that it's goes being the moment that among all we go contributing our knowledge for somehow to be able to optimize the yield of ADS in our applications. I understand that the important thing is optimize the yield in the use of ADS in form Client/Server.

Many functions are not used or they are used bad. Does ADS work well, but can it work well? I believe that if it is possible. Today's tip

Use of a type field it dates.

Usually using the function DToC (), does the system work and are we so wide, but that it happens if we use the function AdsGetDate ()? Do we notice difference?

Code: Select all  Expand view
HB_FUNC( ZADSGETDATE )
{
   ADSAREAP pArea;
   UNSIGNED8  *pucFldName = (UNSIGNED8 *) hb_parc( 1 );
   UNSIGNED8  pucBuf[16];
   UNSIGNED16 pusLen = 16;

   pArea = (ADSAREAP) hb_rddGetCurrentWorkAreaPointer();


/*   ulRetVal = AdsGetServerName( hConnect,pucname,&puslen ) ; */

   AdsGetDate( pArea->hTable, pucFldName, pucBuf, &pusLen );

   if( pusLen > 0 )
   {
      hb_retc( (char *) pucBuf );
   }
    else
   {
      hb_retc(NULL);
   }

}


Y su uso en un browse seria:

Code: Select all  Expand view
@0, 0 LISTBOX oLbx  ;
      FIELDS (cAlias)->order              ,;
             (cAlias)->( ZAdsGetDate( 'mydate' ) )  ; 
      HEADER 'Order', 'Date' ;
      FONT oFont ALIAS cAlias SIZE 200,200 PIXEL OF oWnd


Note: It's interesting to carry out the tests with big tables and against Client/Server

I hope to encourage people to contribute their tips and among all to achieve a bigger yield of ADS
Salutacions, saludos, regards

"...programar es fácil, hacer programas es difícil..."

UT Page -> https://carles9000.github.io/
Forum UT -> https://discord.gg/bq8a9yGMWh
Skype -> https://join.skype.com/cnzQg3Kr1dnk
User avatar
Carles
 
Posts: 1132
Joined: Fri Feb 10, 2006 2:34 pm
Location: Barcelona

Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 77 guests