How can I accomplish this?


Closed Thread
Results 1 to 3 of 3
  1. #1
    BertMan's Avatar
    BertMan Guest

    Default How can I accomplish this?

    How can I store typed data of any length with a break on enter. In other words, if I type:

    DEBUG "TYPE IN A NUMBER AND HIT ENTER"

    How can I capture all numbers typed before the enter key was pressed and store them in a variable?

  2. #2
    Join Date
    Mar 2003
    Location
    Commerce Michigan USA
    Posts
    1,166


    Did you find this post helpful? Yes | No

    Default

    BertMan, I usually dont use Debug or Hserin in my programs but this is what I have done in the past to solve the same problem. Size an array for the most characters you anticipate being entered then clear the array before use. Use the string ending modifier for Hserin command and make it a carriage return character. That way if the buffer gets filled OR the string modifier is found the entry will be complete. The timeout between charcters is 1 second and if it is exceeded the Hserin command will be aborted. After the array is filled just unload it untill you see a zero and back it up by 1. I hope this helps.....

    POINTER = 0 'clear pointer
    WHILE POINTER < 11 'set for maximum of 12 characters
    INDATA(POINTER) = 0 'clear array
    POINTER = POINTER + 1
    WEND
    HSERIN 1000,EXIT,[STR INDATA\12\13] 'WAIT 1000mS. BETWEEN CHARACTERS

    Dave Purola,
    N8NTA

  3. #3
    BertMan's Avatar
    BertMan Guest


    Did you find this post helpful? Yes | No

    Default

    Thanks for the reply. I am still working out other bugs and kindof left this part for later on, but I will use this method when I start making the menu.

Similar Threads

  1. Any ideas on how to accomplish this?
    By bartman in forum General
    Replies: 18
    Last Post: - 27th January 2007, 00:48

Members who have read this thread : 0

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts