Subject Re: Grid search
From Robbie Nott <robnott@mweb.co.za>
Date Tue, 29 Sep 2020 11:59:38 +0200
Newsgroups dbase.getting-started

On 9/28/2020 3:15 PM, Mervyn Bick wrote:
> On 2020/09/28 11:14, Robbie Nott wrote:
>
>> Hi Mervyn
>>
>> The EXTERN is a mysterious and scary thing for me.
>> I'm in awe of the code you sent, looks like another
>> language altogether !
>> I know it's hooking into Windows DLL's and functions
>>
>> Would love to learn more about it
>> Will have a look at Ken's books and see if it's in there
>
> Ken devotes a complete chapter to the WIndows API and EXTERN in his
> dBASE book.
>
> The CALLBACK command, which was introduce in dBASE Plus 8, is covered in
> the dBASE Book Plus although Ken doesn't go into too much detail there.
>
> dBASE comes with over 2000 pre-defined EXTERN prototypes.  You will find
> them in
>
> C:\Program Files (x86)\dBASE\dBASE2019\Include\win32api.prg if you are
> using 64-bit Windows
>
> or
>
> C:\Program Files\dBASE\dBASE2019\Include\win32api.prg if you are using
> 32-bit Windows
>
> Unfortunately you will need to spend a LOT of time with Google to find
> out what each one does.  Programmers using C# or C++ use the API calls
> regularly.  Those dBASE programmers who also "speak" C tend to be the
> ones who fall back on the API functions when dBASE falls short.  Over
> the years the same few API methods have appeared in various examples
> with, very occasionally, a new one popping up.
>
> Every time I see a new API call I spend time following leads in the MSDN
> so that I can better understand why the API has been used.  It has got
> to the stage where I am now comfortable using these same API calls in my
> own code.  There are, however, probably still 2000 odd API calls that I
> still need to get to. :-)
>
>>
>> Perhaps I can get Windows to do more in future
>> I do have a client who runs Windows scripts from his program
>> Can dBase do this too ?
>
> I've never tried it and it may depend on what is in the scripts but the
> following line should allow you to do this.
>
> oWsh = new OleAutoClient( "WScript.Shell" )
>
> Now oWsh.method() in your code will execute the argument to the method.
>
> Mervyn.

Many thanks Mervyn

Your advice and samples are greatly appreciated.

Lots to think about and explore !

Kind regards
Robbie