Announcement

Collapse
No announcement yet.

Help With Reading A Maganetic Card

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Help With Reading A Maganetic Card

    I have a magnetic card reader and a magnetic card that am using to read in text into an input field; yet the problem am facing is that this card is encoded with 15 characters that are read into the input field separately - triggering 15 different on e_Key events. Is there a way that i can wait until all the 15 character a fully read before i can proceed with that captured data? Thank you.

  • #2
    Code:
    if(Input.GetText(this):len() >= 15)then 
    -- done?
    end
    Bas Groothedde
    Imagine Programming :: Blog

    AMS8 Plugins
    IMXLH Compiler

    Comment


    • #3
      Thank you Imagine Programming, that helps. Is the a way of making the same check without the use of the number 15, as to insure that the application is always compatible with a new batch of cards in case they have less or more character than the one i currently testing on. Thank you.

      Comment


      • #4
        In that case, perhaps an alternative approach could be using a timer. Each time a new e_Key event is fired, check if the timer is running, starting it if not active, or resetting a counter if already active. Once the time passed since the last entry exceeds a predefined time, stop the timer and run whatever code you want using the current contents of the Input field.
        In this manner you could have a variable amount of data in the Input, and the validation would always happen after a certain time of inactivity, when no new data is provided.

        Ulrich

        Comment


        • #5
          Thank you Ulrich.

          Comment


          • #6
            Originally posted by HLBterence View Post
            Thank you Ulrich.
            What card system are you using may I ask, I been looking at doing this myself for a few things I be intrested in a little how two of the hardware and software
            Plugins or Sources MokoX
            BunnyHop Here

            Comment

            Working...
            X
            😀
            🥰
            🤢
            😎
            😡
            👍
            👎