Hi Xavi,

That's good, but pls work together with Przemek, 
to offer a multiplatform solution in one portable 
core function. And use hbwin only to provide the 
extra functionality, if and only if those cannot 
be done in portable way.

> PRG .-
> aAdapters := win_GetAdaptersInfo()
> aAdapters == { {cTipo, cNameDes, cMAC, cAddress, cMask, cGateway, cAdapter, 
> nStatus} }
> Sort by nStatus.
> 
> C .-
> DWORD hbwin_GetAdaptersInfo( PHB_ITEM pItmArray )
> 
> File .-
> contrin/hbwin/win_getadt.c
> 
> It need .-
> #include <Iphlpapi.h>
> 
> Also I've an added nStatus to try sort it by relevance.
> I don't know whether to bring it or not? .-
> ...
>      pMacro = hb_macroCompile( "{|x,y|x[8]>y[8]}" );
>      if( pMacro  ){
>         hb_macroRun( pMacro ); hb_macroDelete( pMacro );
>         pCodeBlock = hb_stackItemFromTop( -1 );
>         if( pCodeBlock && HB_IS_BLOCK( pCodeBlock ) ){
>            hb_arraySort( pItmArray, NULL, NULL, pCodeBlock );
>         }
>         hb_stackPop();
>      }
> ...

I think such sorting is best to be done by the caller if 
necessary. IMO it's not very good to make such low-level 
code dependent on macro compiler, or make any internal 
automatic sorting whatsoever (you can leave pCodeblock 
to NULL), since it can be solved easily on .prg level, 
thus it's redundant.

Brgds,
Viktor

_______________________________________________
Harbour mailing list (attachment size limit: 40KB)
[email protected]
http://lists.harbour-project.org/mailman/listinfo/harbour

Reply via email to