Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Convert this code to into a visual form
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Convert this code to into a visual form
Miscellaneous
Thread ID:
00945616
Message ID:
00945616
Views:
79
Can somebody help me to convert the code below into a visual form? The Form must not accept manual entry of any value into the card text box.

Here is my code in VFP (its lacking so please bear with my code), card number accepts manual entries, which should not be, it should only accept when swiping a credit card or Magnetic Cards to a card reader / inserting smart card to smart card reader :...

Note: The code is under testing with a verifone Terminal and a GemPlus Smart Card Reader. Some omission is been applied on the code between a CC Terminal & Smart Card Reader..

I have created a visual form but its not working as to my expectation.. So I decided to post my code for some help on this as im in a rush with this project...
*!*	SYSTEM DESCRIPTION AND AUTHOR
*!*	Application	: Human Resources Schedule System v1.02
*!*	Author's 	: Dalplus Technologies, Research & Development Team
*!*			      Jojo Dela Cuesta, Programmer
*!*	Date Created: Friday, 24th of September 2004
*!*	Project	Ref	: ??? HRD - Research & Development Section
*!* -------------------------------------------------------------------

*//&& Smart card reading using the GEMPLUS
&& Uses Verifone Omni 3750 for CC Reading

Set CPDIALOG OFF
SET DATE TO BRITISH
SET CENTURY ON
Save Screen wEntryScr                                                   
Define window Card from 10,30 to 20,70 TITLE "CREDIT CARD READER" CLOSE FLOAT GROW NOZOOM
Public cStaff_nbr,cTarget1,cTarget2,cCard_owner,lSeek

cStaff_nbr = SPACE(10)
cTARGET1 = Space(250)
cTARGET2 = Space(250)
cCARD_OWNER = SPACE(250)
lSeek = .F.

*#DEFINE BOX(08,20,20,60)
IF !used('Staff')
   USE DPHRM!Staff IN 0 order TAG STAFF_NBR SHARED 
ELSE
   SELECT("Staff")
   SET ORDER TO TAG STAFF_NBR
ENDIF
SELECT("Staff")
GO TOP

Activate Window Card

DO WHILE .T. 
@02,10 Say 'Current Date : '
@02,26 say DATE()
@03,04 Say 'Input Staff Number : ' Get cStaff_nbr pict '99999' valid !EMPTY(cStaff_nbr)
READ
IF !EMPTY(cStaff_nbr)
   SET EXACT ON
   SELECT("Staff")
   SET ORDER TO TAG STAFF_NBR
   IF SEEK(cStaff_nbr)
      m.cStaff_name = alltr(staff_name)
      If LastKey() = 27
        *Release Window Card  && Close for window during Testing
         Clear Gets
         RETURN 0
      ENDIF
     lSeek = .T.
		
  @04,10+(30-len(rtrim(cSTAFF_NAME)))/2 Say rtrim(cSTAFF_NAME)
  @06,02 say "Insert Smart Card to the Card Reader" 
  @07,07 Say 'Smart Card Number : ' Get cTARGET2 pict '@K!s1' valid !Empty(cTARGET2)  
  Read
  If LastKey() = 27
     Release Window Card
     Return &&1
  ENDIF
		
  @07,07 Say 'Smart Card Number : ' Get cTARGET1 pict '@K!s1' valid !Empty(cTARGET1)
  Read
  mCARD_NBR  = Substr(cTarget1,2,AT("=",cTarget1)-2)
  mCARD_OWNER = aLLTRIM(Substr(cTarget2,20,AT("^",cTarget2)-2))
		
  @08,09+(30-len(rtrim(mCARD_OWNER)))/2 Say rtrim(mCARD_OWNER)
  @07,07 Say 'Smart Card Number : '
  @07,27 Say mCARD_NBR Pict '@K!' &&Color 1
  Read
  If LastKey() = 27
    Release Window Card
    Return 1
  Endif
  Messagebox(mCARD_OWNER+'',0+64,'',3)
  */* Code block
  */* Record In & Out of Staff in TimeRecords Table
		
  cStaff_nbr = SPACE(10)
  @03,04 Say 'Input Staff Number : ' Get cStaff_nbr pict '99999' valid !EMPTY(cStaff_nbr)
  @04,10 Say SPACE(150)
  cTARGET1 = Space(250)
  cTARGET2 = Space(250)
  @07,27 Say mCARD_NBR Pict '@K!' 
ELSE
  @03,04 Say 'Input Staff Number : ' Get cStaff_nbr pict '99999' valid !EMPTY(cStaff_nbr)
  Messagebox("Staff Number "+ cStaff_nbr + " doesn't exist!",0+16,"Search  Staff",1900)
  READ
  LOOP
  ENDIF
ELSE
Messagebox("Please Input Staff Number!",0+64,"Emty Staff",1900)
ENDIF
ENDDO
TIA..
Jojo R. dela Cuesta, B.Sc.
eConsultant, Programmer
Dalplus Technologies
http://www.dalplus.com
Next
Reply
Map
View

Click here to load this message in the networking platform