Alaska Software Inc. - TOOLS function Trapanykey() in xBASE++?
Username: Password:
AuthorTopic: TOOLS function Trapanykey() in xBASE++?
Klemens LichterTOOLS function Trapanykey() in xBASE++?
on Fri, 13 May 2011 07:42:46 +0200
Hi,

I have to convert a clipper program that uses several times the clipper 
tools III function trapanykey(). This function does not exist in xBase++ 
tools. Does anyone have an idea how to replace it?
Thanks

Klemens
AUGE_OHRRe: TOOLS function Trapanykey() in xBASE++?
on Fri, 13 May 2011 08:25:14 +0200
hi,

> tools III function trapanykey().

*** quote CA-Tools NG ***

TRAPANYKEY()
  Aufruf einer Prozedur bei jeder Tastatur-Eingabe

Syntax
  TRAPANYKEY(<cProzedur>) -> cAlteProzedur

Parameter
  <cProzedur> ber diesen Parameter mu der Name der Prozedur angegeben
  werden, die bei Bettigen einer Eingabe-Taste aufgerufen werden soll.

  () Durch Aufruf der Funktion ohne Parameter wird eine zuvor gewhlte
     berwachung von Tastatur-Eingaben wieder deinstalliert.

Rckgabe
  cAlteProzedur
  Die Funktion liefert jeweils den Namen der zuvor aktiven Trap-Prozedur,
  gegebenenfalls also auch einen Nullstring.

Anwendung
  ber diese Funktion ist es mglich, fr alle Tasten, die einen Code
  erzeugen, einen Trap in eine Prozedur auszulsen. Dies kommt quasi
  einem SET KEY <anykey> TO <prozedur> gleich und kann vielfltigst genutzt
  werden.
  Der Code der auslsenden Taste wird als Parameter an die Trap-Prozedur
  bergeben, jedoch noch nicht im Tastatur-Puffer abgelegt. Sollen normale
  Eingaben mglich sein, mu jedes Zeichen entweder ber den KEYBOARD-
  Befehl oder ber die Funktion KEYSEND() im Tastatur-Puffer plaziert
  werden. Ein KEYSEND(TastenCode, .T.) ist in der Regel von Vorteil, da
  hierbei immer zum vorhandenen Tastatur-Puffer mit den von CA-Clipper noch
  nicht verarbeiteten Zeichen hinzuaddiert wird - so knnen keine Eingaben
  verloren gehen.

  WICHTIG!
  Bei Anwendung dieser Funktion wird kein CA-Clipper-Key-Trap nachgebildet.
  Wann immer CA-Clipper versucht, eine Tastatur-Eingabe abzuholen, wird
  dieser Aufruf innerhalb des Treibers in die ber TRAPANYKEY() angegebene
  Prozedur umgelenkt. Da CA-Clipper auch auerhalb spezieller 
Eingabe-Befehle,
  wie GET/READ, die Tastatur abprft, sind diese Traps also fast immer wirk-
  sam. Da jedoch alle internen Routinen fr Eingabe-Befehle nicht reinterant
  sind und da diese Routinen hier im Gegensatz zu CA-Clipper-Key-Traps nicht
  verlassen werden, darf in der aufgerufenen Prozedur auf keinen Fall
  wieder der gleiche Eingabe-Befehl verwendet werden. Dies gilt fr alle
  Eingabe-Anweisungen wie GET/READ, PROMPT, ACCEPT und hnliche. Welcher
  Eingabe-Befehl bei Aufruf der Prozedur tatschlich gerade aktiv ist,
  kann sehr einfach ber INPUTMODE(.T.) festgestellt werden.

Hinweise
   Innerhalb der Trap-Prozedur mssen die bergebenen Tasten-Codes in
    irgendeiner Form weiterverarbeitet werden, sonst sind keine Eingaben
    mehr mglich und das Programm kann auch ber ALT-C nicht mehr verlassen
    werden.
   Rekursionen werden, im Gegensatz zu CA-Clipper-KEY-TRAPS, automatisch
    vermieden.
   Falls die angegebene Trap-Prozedur nicht vorhanden ist, de-
    installiert die Funktion sich selbst und lst keinen Laufzeit-
    Fehler aus.
    Falls bereits beim Linken eine Warnung bezglich einer fehlenden
    Prozedur gewnscht wird, so kann im Programm EXTERNAL <prozedur>
    angegeben werden.

*** eof ***

greetings by OHR
Jimmy
Thomas Braun
Re: TOOLS function Trapanykey() in xBASE++?
on Fri, 13 May 2011 09:52:12 +0200
AUGE_OHR wrote:

>> tools III function trapanykey().
> 
> *** quote CA-Tools NG ***
> 
> TRAPANYKEY()
>   Aufruf einer Prozedur bei jeder Tastatur-Eingabe

I really can't imagine how it might help Klemens - or anybody of the
english speaking community here - posting the german doc for this tools
function.

I'm quite sure that Klemens already knows what Trapanykey() does... most
likely he has access to the Tools III docs himself.

Thomas
AUGE_OHRRe: TOOLS function Trapanykey() in xBASE++?
on Fri, 13 May 2011 18:12:28 +0200
hi,

> I'm quite sure that Klemens already knows what Trapanykey() does...
> most likely he has access to the Tools III docs himself.

XbTools Help say -> "Function TrapAnyKey() is not supported"

while i did not have found "english" Norton Guide of CT3
i qoute "German" Help File just to give Klemens a Idee
what TrapAnyKey() Function does.

greetings by OHR
Jimmy
Pablo BotellaRe: TOOLS function Trapanykey() in xBASE++?
on Fri, 13 May 2011 16:24:09 +0200
Hi,

If SetappEvent() is not enought for your needs, maybe you can try to install a hook in the Xbase++ gui thread, with ot4xb_HookThread() is very easy, see the attached sample.

Regards,
Pablo Botella


TestingHooks.zip
Michael HoffmannRe: TOOLS function Trapanykey() in xBASE++?
on Sun, 15 May 2011 09:03:00 +0200
Hello Klemens,
how about using the preprocessor to inject your own Inkey() function wich 
calls on to the original and calls the hook function before returning the 
value?
hth,
Michael


<Klemens Lichter> wrote in message 
news:9e0649$6dd80eac$421f8@news.alaska-software.com...
> Hi,
>
> I have to convert a clipper program that uses several times the clipper 
> tools III function trapanykey(). This function does not exist in xBase++ 
> tools. Does anyone have an idea how to replace it?
> Thanks
>
> Klemens
>
Klemens LichterRe: TOOLS function Trapanykey() in xBASE++?
on Mon, 16 May 2011 08:12:21 +0200
Hi,

thank you all for your thoughts and tips. I also thought about something to 
do with the preprocessor, but than I need it not only with inkey() but also 
with other input functions/commands, as I meanwhile found in the sourcecode 
of this clipper-program. I think it will be some more work and not only 
simple converting in this case.
But thank you anyway to you all.

Klemens


<Michael Hoffmann> schrieb im Newsbeitrag 
news:3061b157$1a98f84d$5d04b@news.alaska-software.com...
> Hello Klemens,
> how about using the preprocessor to inject your own Inkey() function wich 
> calls on to the original and calls the hook function before returning the 
> value?
> hth,
> Michael
>
>
> <Klemens Lichter> wrote in message 
> news:9e0649$6dd80eac$421f8@news.alaska-software.com...
>> Hi,
>>
>> I have to convert a clipper program that uses several times the clipper 
>> tools III function trapanykey(). This function does not exist in xBase++ 
>> tools. Does anyone have an idea how to replace it?
>> Thanks
>>
>> Klemens
>>
>
>
Michael HoffmannRe: TOOLS function Trapanykey() in xBASE++?
on Mon, 16 May 2011 11:32:37 +0200
Hello Clemens,
don't give up so easily. GetSys is part of the Alaska package and you can 
modify it's use of Inkey() as well. You get 100% control. I do that to 
integrate mouse clicks into my old XpbCrt applications.
Best regards,
Michael

<Klemens Lichter> wrote in message 
news:7be4aaf4$5d8b165f$23f0a@news.alaska-software.com...
> Hi,
>
> thank you all for your thoughts and tips. I also thought about something 
> to do with the preprocessor, but than I need it not only with inkey() but 
> also with other input functions/commands, as I meanwhile found in the 
> sourcecode of this clipper-program. I think it will be some more work and 
> not only simple converting in this case.
> But thank you anyway to you all.
>
> Klemens
>
>
> <Michael Hoffmann> schrieb im Newsbeitrag 
> news:3061b157$1a98f84d$5d04b@news.alaska-software.com...
>> Hello Klemens,
>> how about using the preprocessor to inject your own Inkey() function wich 
>> calls on to the original and calls the hook function before returning the 
>> value?
>> hth,
>> Michael
>>
>>
>> <Klemens Lichter> wrote in message 
>> news:9e0649$6dd80eac$421f8@news.alaska-software.com...
>>> Hi,
>>>
>>> I have to convert a clipper program that uses several times the clipper 
>>> tools III function trapanykey(). This function does not exist in xBase++ 
>>> tools. Does anyone have an idea how to replace it?
>>> Thanks
>>>
>>> Klemens
>>>
>>
>>
>
>
Klemens LichterRe: TOOLS function Trapanykey() in xBASE++?
on Thu, 19 May 2011 12:17:02 +0200
Michael,
thank you for your kind words. No I dont give up, I just realize that it 
will be more work. That with the mouseclicks I did in the past in some CRT 
applications too.

Klemens

<Michael Hoffmann> schrieb im Newsbeitrag 
news:112f8892$48be775$233db@news.alaska-software.com...
> Hello Clemens,
> don't give up so easily. GetSys is part of the Alaska package and you can 
> modify it's use of Inkey() as well. You get 100% control. I do that to 
> integrate mouse clicks into my old XpbCrt applications.
> Best regards,
> Michael
>
> <Klemens Lichter> wrote in message 
> news:7be4aaf4$5d8b165f$23f0a@news.alaska-software.com...
>> Hi,
>>
>> thank you all for your thoughts and tips. I also thought about something 
>> to do with the preprocessor, but than I need it not only with inkey() but 
>> also with other input functions/commands, as I meanwhile found in the 
>> sourcecode of this clipper-program. I think it will be some more work and 
>> not only simple converting in this case.
>> But thank you anyway to you all.
>>
>> Klemens
>>
>>
>> <Michael Hoffmann> schrieb im Newsbeitrag 
>> news:3061b157$1a98f84d$5d04b@news.alaska-software.com...
>>> Hello Klemens,
>>> how about using the preprocessor to inject your own Inkey() function 
>>> wich calls on to the original and calls the hook function before 
>>> returning the value?
>>> hth,
>>> Michael
>>>
>>>
>>> <Klemens Lichter> wrote in message 
>>> news:9e0649$6dd80eac$421f8@news.alaska-software.com...
>>>> Hi,
>>>>
>>>> I have to convert a clipper program that uses several times the clipper 
>>>> tools III function trapanykey(). This function does not exist in 
>>>> xBase++ tools. Does anyone have an idea how to replace it?
>>>> Thanks
>>>>
>>>> Klemens
>>>>
>>>
>>>
>>
>>
>
>