KiXforms Forum Index KiXforms
The Forum for the KiXforms Community
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
 Quick Links 
Site News
Downloads
Documentation
Donations
Script Archive
Tracking Systems

Get info from cardreader

 
Post new topic   Reply to topic    KiXforms Forum Index -> Starters Code Clinic
View previous topic :: View next topic  
Author Message
mima500
KiXforms Regular
KiXforms Regular


Joined: 11 Dec 2003
Posts: 48
Location: Sweden

PostPosted: Wed May 16, 2007 3:10 pm    Post subject: Get info from cardreader Reply with quote

Hi

I have a simple kixforms program where I want to show in a textbox or labelbox the number from a card in a cardreader.
If I do it in Notepad I see the numbers, but how do I get in i kix to my for example label box ?
Back to top
View user's profile Send private message
mima500
KiXforms Regular
KiXforms Regular


Joined: 11 Dec 2003
Posts: 48
Location: Sweden

PostPosted: Wed May 16, 2007 8:51 pm    Post subject: Reply with quote

Well, I solved it my self. Made one Textbox outside the form, (exist but not visible for the user) and a timer.
Here is a bit of my code


Code:

$CardReader = $System.Textbox()
$CardReader.Height = 40
$CardReader.Left = 400
$CardReader.Top = 900 ; Hide field outside the forms range
$CardReader.Width = 184
$nul = $Tidman.Controls.Add($CardReader)

; Show date and time
$Timer = $System.Timer
$Timer.Interval = 500 ; msecs
$Timer.Tick = "Timer_Tick()"

$Tidman.Show
$Timer.Start

While $Tidman.Visible
   $Nul = Execute($Tidman.DoEvents())
   $DateClock.Text = "  " + @TIME + "  " + @DATE
   $Nul = ReadCard()
Loop
Exit 0

Function ReadCard()
 $CardReader.Focus()
 $CardText = $CardReader.Text
 $CardReader.Text = ""
 If $CardText <> "" ; The card has generated a string
  ? $CardText
 EndIf
EndFunction


Function Timer_Tick()

 $DateClock.Text = "  " + @TIME + "  " + @DATE

EndFunction
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    KiXforms Forum Index -> Starters Code Clinic All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group