Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
INKEY error
Message
 
To
All
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
INKEY error
Environment versions
Visual FoxPro:
VFP 8 SP1
OS:
Windows XP SP2
Network:
Windows 2008 Server
Database:
Visual FoxPro
Application:
Desktop
Miscellaneous
Thread ID:
01458103
Message ID:
01458103
Views:
153
Hi Gang!

I am getting an error with the following line of code:

IF INKEY() = 27

The error is "Function argument value, type, or count is invalid" (Error 11)

How can I be passing an invalid argument when I am not passing any argument at all? This error is sporadic and not one that I can consistantly reproduce. In fact, exiting the program, reopening it and the repeating the function usually works without error.
LPARAMETERS lcFileName, llExitLoop2

LOCAL llFileExists
llFileExists = .F.
ltStart  = DATETIME()
llExitLoop2 = .F.

DO WHILE ((DATETIME() - ltStart) < 120) AND NOT llExitLoop2
*TMT 10/24/08 put this message on the frmseod form.
*        WAIT WINDOW "Waiting for response from CentralWarehouse - " + STR((DATETIME() - ltStart),3,0) + " seconds elapsed." NOWAIT
    WAIT "Waiting for file - " + UPPER(ALLTRIM(lcFileName)) + " - " + ;
		STR( 120 - (DATETIME() - ltStart)  ,3,0) + " seconds remaining." WINDOW NOWAIT 

    IF FILE('c:\temp\' + lcFileName)
        llFileExists = .T.
        WAIT CLEAR
        EXIT
    ENDIF
    IF INKEY() = 27	&& ESC pressed
		llExitLoop2 = .T.
        EXIT
    ENDIF
    DOEVENTS
ENDDO

IF NOT llFileExists AND NOT llExitLoop2
*TMT 10/24/08 put this message on the frmseod form.
	WAIT "Customer Extract - No acknowlegment returned from EZDW - '" + ALLTRIM(lcFileName) + "'." WINDOW TIMEOUT 5 
	DO centrack WITH "POSEZDW","Wait4EZDW", .F., 0, .T., .F., .F., "EZDW - No customer acknowledgment file returned - '" + ALLTRIM(lcFileName) + "'."
    RETURN .F.
ELSE
	IF NOT llFileExists AND llExitLoop2	&& We ESCAPED out
        RETURN .F.
    ENDIF
ENDIF

*TMT 08/05/08 Wait 1 second after the webservice has let go of the file before trying to open it with
*the FOPEN below.... else we may get a "File Access is Denied" error
ltStart  = DATETIME()
DO WHILE DATETIME() - ltStart < 1 &&	1 seconds to pass
ENDDO
*TMT
RETURN .T.
Any ideas??

Thanks!
Tommy Tillman A+ NetWork+ MCP
Next
Reply
Map
View

Click here to load this message in the networking platform