Using __psp

Using __psp

Postby Vladimir Grigoriev » Fri Mar 03, 2006 3:39 pm

Questing to Antonio Linares and other FW gurus.
When a Clipper program starts it saves the adrres of PSP in global variable __psp (Microsoft C startup code). I can use it, for example, to know command tail address. This addres I can futher use to set DTA for DOS find file functions. O'k. But can I use the PSP command tail address in FiveWin program?
Maybe this question is general for all Win16 programs not only Clipper programs.

Vladimir Grigoriev
Vladimir Grigoriev
 
Posts: 54
Joined: Fri Oct 21, 2005 10:45 am
Location: Russia, Moscow

Postby Antonio Linares » Fri Mar 03, 2006 7:00 pm

Vladimir,

Yes, you may be able to use it from a low level user defined function. Have you tried it ?
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42118
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Postby Vladimir Grigoriev » Mon Mar 06, 2006 12:06 pm

Yes, I tried using _psp but only under pure Clipper.
The question arised when I wanted to write a Clipper function for searching files. What address to use for Disk Transfer Area (DTA) that used by DOS search functions? If to use a virtual string to store DTA structure then it real address can differ (I think so) between two sequential calls of the function if we will declare new strings or arrays.
Standard Clipper function DIRECTORY() uses for this purpose stack address. But DIRECTORY() does all stuff inside "one call". I've looked through open source code of some third part Clipper search functions that I found in internet but these functions always set DTA before calling DOS find first or find next functions. I don't like this. So I wonder why all these functions don't use standard DTA address. To get it is very simple as Clipper uses C start code i.e. there is global variable _psp that contains needed address.
Vladimir Grigoriev
 
Posts: 54
Joined: Fri Oct 21, 2005 10:45 am
Location: Russia, Moscow


Return to FiveWin for CA-Clipper

Who is online

Users browsing this forum: No registered users and 4 guests