dbTalk Databases Forums  

Can't get procedure to work on VFP6

comp.databases.xbase.fox comp.databases.xbase.fox


Discuss Can't get procedure to work on VFP6 in the comp.databases.xbase.fox forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
bertle73@hotmail.com
 
Posts: n/a

Default Can't get procedure to work on VFP6 - 12-07-2006 , 11:22 PM






I am having a problem with a procedure after converting an application
from FoxPro2.5 to VFP6 the procedure no longer works so I asked for
help and was told to use ON KEY LABEL and to split this procedure in
two different procedures so I did I created a procedure which calls one
of the two procedures using ON KEY LABEL but this also doesn't work.
I'm posting the original procedure as Procedure X and the new one as
Procedure Y which calls either Procedure one or Procedure two depending
on which key is pressed. Please don't laugh I'm new to FoxPro. Can
someone please show me the correct way of doing this. Thanks any help
will be appreciated.

PROCEDURE X
DEFINE WINDOW inStruc FROM 15, 13 TO 17, 65 NOGROW NOFLOAT NOCLOSE ;
NOZOOM SHADOW TITLE '' DOUBLE COLOR SCHEME 5
ACTIVATE WINDOW NOSHOW inStruc
@ 0, 11 SAY 'F7 - Continue Esc - Exit'
SHOW WINDOW inStruc
ACTIVATE WINDOW faCtura
STORE 0 TO chOice
DO WHILE .T.
CLEAR GETS
IF maNdate
@ 04, 35 GET frEcord( 3) SIZE 1, 10 COLOR W+/BG
@ 05, 18 GET frEcord( 5) SIZE 1, 5 COLOR GR+/BG
@ 05, 56 GET frEcord( 4) SIZE 1, 10 COLOR GR+/BG
@ 06, 18 GET frEcord( 8) SIZE 1, 50 COLOR GR+/BG
READ
ELSE
@ 05, 18 GET frEcord( 5) SIZE 1, 5 COLOR GR+/BG
@ 05, 56 GET frEcord( 4) SIZE 1, 10 COLOR GR+/BG
@ 06, 18 GET frEcord( 8) SIZE 1, 50 COLOR GR+/BG
READ
ENDIF
IF LASTKEY()=27
STORE .T. TO mqUit
RELEASE WINDOW inStruc
IF WEXIST('shw1')
RELEASE WINDOW shW1
CLOSE MEMO ALL
ENDIF
RELEASE WINDOW faCtdet
RELEASE WINDOW faCtura
SELECT 6
IF frEcord(1)=neXtinvnum-1
REPLACE neXtinvnum WITH frEcord(1)
ENDIF
SELECT 3
RETURN
ELSE
IF LASTKEY()=-6
SELECT 3
IF neWinv
APPEND BLANK
ENDIF
DO p0Rlockn
GATHER FROM frEcord
UNLOCK
DEACTIVATE WINDOW inStruc
RELEASE WINDOW inStruc
RETURN
ENDIF
ENDIF
ENDDO





*
PROCEDURE Y
DEFINE WINDOW inStruc FROM 15, 13 TO 17, 65 NOGROW NOFLOAT NOCLOSE ;
NOZOOM SHADOW TITLE '' DOUBLE COLOR SCHEME 5
ACTIVATE WINDOW NOSHOW inStruc
@ 0, 11 SAY 'F7 - Continue Esc - Exit'
SHOW WINDOW inStruc
ACTIVATE WINDOW faCtura
STORE 0 TO chOice
DO WHILE .T.
CLEAR GETS
IF maNdate
@ 04, 35 GET frEcord( 3) SIZE 1, 10 COLOR W+/BG
@ 05, 18 GET frEcord( 5) SIZE 1, 5 COLOR GR+/BG
@ 05, 56 GET frEcord( 4) SIZE 1, 10 COLOR GR+/BG
@ 06, 18 GET frEcord( 8) SIZE 1, 50 COLOR GR+/BG
READ
ELSE
@ 05, 18 GET frEcord( 5) SIZE 1, 5 COLOR GR+/BG
@ 05, 56 GET frEcord( 4) SIZE 1, 10 COLOR GR+/BG
@ 06, 18 GET frEcord( 8) SIZE 1, 50 COLOR GR+/BG
READ

ENDIF
ENDDO

ON KEY LABEL ESC DO one
ON KEY LABEL F7 DO two

*


PROCEDURE one

STORE .T. TO mqUit
RELEASE WINDOW inStruc
IF WEXIST('shw1')
RELEASE WINDOW shW1
CLOSE MEMO ALL
ENDIF
RELEASE WINDOW faCtdet
RELEASE WINDOW faCtura
SELECT 6
IF frEcord(1)=neXtinvnum-1
REPLACE neXtinvnum WITH frEcord(1)
ENDIF
SELECT 3
RETURN


*
PROCEDURE two

SELECT 3
IF neWinv
APPEND BLANK
ENDIF
DO p0Rlockn
GATHER FROM frEcord
UNLOCK
DEACTIVATE WINDOW inStruc
RELEASE WINDOW inStruc
RETURN


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.