INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Jobs

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

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

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

(OP)
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

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

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: http://computer-programming-forum.com/19-clipper/6...
It is also mentioned on this forum, but I haven't been able (due to time restrictions) to search for it :-|

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

(OP)
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:overstrike() 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:overstrike(), 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

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

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.

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

(OP)
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.

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

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...)

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Resources

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close