Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Cliopper 5.2e. GET command delays inserting keystrokes after backwards tab

Status
Not open for further replies.

AndrewMozley

Programmer
Oct 15, 2005
621
1
18
GB
I am finding that occasionally keystrokes entered into a GET field are not being immediately echoed on the screen.

This appears to happen when I have only a couple of fields defined. I enter characters into field 1, tab to field 2 and enter characters there.

If I then tab backwards to the first field, I am finding that the first two characters I enter at the beginning of that field are not being immediately echoed. They are echoed either when I enter a 3rd character into field 1, whereupon the miraculously appear, or when I tab into field 2 and enter a character there, and once again the character entered in field 1 appears. This is my program :

Code:
#include "inkey.ch"
#include "setcurs.ch"

FUNCTION MAIN
LOCAL lRow := 0, lName1, lName2
PRIVATE GetList:= {}

   SET SCORE OFF
   SET COLOR TO B/W, + GR/B
   @ 0, 0 CLEAR TO 24, 79

*  Test the basic GET system
   lName1 := SPACE(8)
   lName2 := SPACE(8)
   
   @ 1,1 SAY "Name 1" GET lName1
   @ 2,1 SAY "Name 3" GET lName2
         READ
   RETURN .T.

I have looked at the code in GETSYS.PRG, and there is a function, GetApplyKey() which within it appears to do the business of making the character appear on the screen, by calling Get:Insert() or Get:Overstrike().

If I put in an extra SAY instruction (perhaps @24,79 SAY " ") that seems to fix the problem - it seems to galvanise the GET into doing the business.

Has anyone else experienced this problem or is it a self-inflicted injury!

Thanks. Andrew
 
When using the 'plain' Clipper compiler and libraries, there is an issue with those libs not giving back cycles to the OS, and CPU-load being very high for that app. There are a few libraries that can be added to the linker script (and available on disk ofcourse) to fix this issue. It improves keyboard response dramatically.
Most used seems NFLib and OS.lib, as suggested in this old external thread: It is also mentioned on this forum, but I haven't been able (due to time restrictions) to search for it :-|
 
Thank you, Tonhu, for your response.

I have found the library you mentioned, and have include the substitute yinkey() function to call from GETSYS.PRG, but without success.

The problem appears to arise when the oget:eek:verstrike() method is called from GetApplyKey() when a key is pressed. Usually this has the desired result (a character appears), but in the case I have mentioned – in my demo program when I first tab back to the first field - this function call does not have the desired result.

I have tried several work-arounds, including calling oget:delete() before oget:eek:verstrike(), but without success.

If anyone else is able to observe the same result (characters not echoing during a GET), perhaps by compiling and running my demo program, and has found a solution, I would be grateful to hear of it.

Thanks. Andrew Mozley
 
Remove that yinkey() function, and replace that with the nf.lib (with patch) and FT_OnIdle call as suggested by Klas Engwall (response #6/14 in the thread mentioned above). I should have been more clear in pointing at that exact and definitive solution, sorry.
It solves all the problems you mentioned, as I have experienced myself.

Another working and future-proof solution is to replace the Clipper compiler and libs by Harbour-Project or xHarbour compilers, but that has quite some more impact, especially for a non-clipper programmer.
 
Thanks again Tonhu

Hope I am following your instructions correctly.

I have downloaded NANFOR.LIB, and also IAMIDLE.OBJ from the NFPAT1A.zip file which Klas makes available. I have included this instruction at the top of my demo program:

FT_OnIdle({|FT_IamIdle(30,.T.)})

. . . and the relevant part of my link file now says :

FI ANMGET (my test program
FI GETSYS (my modified GETSYS which includes mouse support)
FI IAMIDLE (The patch)
. . .
LI NANFOR (The Nanforum library)

However, when I run the link file, I get this error message :

BLINKER 1115 : IAMIDLE.OBJ(IAMIDLE) : 'CPMIISPROTECTED' : unresolved external

I feel I may not have understood Klas' patch. Sorry to bother you again, but could you describe how to install the patch in more detail.

Thanks. Andrew.
 
You need to add "LIB CPMI" (cpmi.lib is a part of NanFor) to your Blinker script to resolve that external too. (I googled for this answer...)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top