ADS Tips

Post Reply
User avatar
Carles
Posts: 937
Joined: Fri Feb 10, 2006 2:34 pm
Location: Barcelona
Contact:

ADS Tips

Post by Carles »

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

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

@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..."

https://modharbour.app
https://modharbour.app/compass
https://forum.modharbour.app
Post Reply