Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Keypress behavior different between APP and EXE
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Keypress behavior different between APP and EXE
Miscellaneous
Thread ID:
00856049
Message ID:
00856049
Views:
62
We've got an EXE that calls various APP's when the user selects something off the menu. I've got a form that had this code in the KeyPress event of a textbox. The textbox is based on the base VFP classes (not a subclass of something else). This code works fine when compiled as an EXE, it works fine inside of the VFP development environment, and works fine when I call this APP from the VFP command prompt (eg. DO MyApp.APP). It doesn't work when being called from within our EXE which calls this APP.

I've added code inside of the IF BETWEEN, so I know this code is actually running. It looks like the NODEFAULT/DODEFAULT doesn't run correctly inside of the APP. Basically what happens is when you type a character, the character doesn't get displayed in the textbox, and my LOCATE then fails (since This.Value doesn't contain any value).

I've tried adding PUSH KEY/POP KEY around the code, CLEAR TYPEAHEAD, etc. This code is running, it's just not doing the NODEFAULT/DODEFAULT stuff.

As a fix, I've moved the search code to the InteractiveChange event, which works OK. So I've got a workaround. Now I just want to understand >why< this code behaves differently in the APP.
LPARAMETERS nKeyCode, nShiftAltCtrl

IF BETWEEN(nKeyCode, 48, 57)  && 0 - 9
   * Clear the other search fields

   This.Parent.txtUser.Value = ""
   This.Parent.txtScan.Value = ""

   * Force the event to occur first

   NODEFAULT
   DODEFAULT(nKeyCode, nShiftAltCtrl)

   * Do the search
 
   SELECT vidinfo
   LOCATE FOR ALLTRIM(vidinfo.vid_num) = ALLTRIM(This.Value)
   
   * Refresh the display

   This.Parent.grdScanList.Refresh()
   ThisForm.RefreshDetail()
ENDIF   
-Paul

RCS Solutions, Inc.
Blog
Twitter
Next
Reply
Map
View

Click here to load this message in the networking platform