Shop OBEX P1 Docs P2 Docs Learn Events
Begining BS2 Programming - Input Data — Parallax Forums

Begining BS2 Programming - Input Data

ArchiverArchiver Posts: 46,084
edited 2002-11-07 23:47 in General Discussion
Hi All:

I'm just getting into BS2 projects (granted I am challenged when it
comes to program writing and electronics but I am reading Scott
Edwards Programming the BASIC Stamp book) and I am working on an
application where I want to be able to do the following:

1) The program will ask me for inputs. For example "Please input the
number of waypoints". I want to be able to input a number and have
the BS2 program store the number for comparison at a later stage in
the program. How would I set this up and what commands should I use ?

2) I have tried to understand how to set up an array but don't get
it. From my old college days an array was a storage are for data (i.e
columns and rows). Is the BASIC BS2 definition the same as an array
as I know it ? Also, how would I set up an array to be able store (n)
number or rows and columns ?

If anyone can help me I sure would apperciate it ?

Thanks...JB

Comments

  • ArchiverArchiver Posts: 46,084
    edited 2002-11-07 21:07
    In a message dated 11/07/2002 16:01:22 Eastern Standard Time,
    JBRobertsman@a... writes:


    > ) The program will ask me for inputs. For example "Please input the
    > number of waypoints". I want to be able to input a number and have
    > the BS2 program store the number for comparison at a later stage in
    > the program. How would I set this up and what commands should I use ?
    >
    >

    For JB

    Write
    N9600 con 16468
    com bar byte

    serout 16, N9600, [noparse][[/noparse]"Enter number of waypoints", cr]

    Message will appear on debug screen

    serin 16, N9600, [noparse][[/noparse]com]

    From the keyboard, enter a number. It will be stored in the variable "com".
    Sid Weaver
    W4EKQ
    Port Richey, FL


    [noparse][[/noparse]Non-text portions of this message have been removed]
  • ArchiverArchiver Posts: 46,084
    edited 2002-11-07 21:11
    Sorry - typo.

    com var byte

    Sid


    [noparse][[/noparse]Non-text portions of this message have been removed]
  • ArchiverArchiver Posts: 46,084
    edited 2002-11-07 23:47
    Hi Sid:

    Thanks for replying to my question. It helped alot. I have a problem
    though. When I try to a store a digit with 2 digits...say 10 or 11 it
    only stores the 1 digit for the value COM. It then truncates the last
    digit...ANy ideas ? Thanks..JB

    --- In basicstamps@y..., Newzed@a... wrote:
    > Sorry - typo.
    >
    > com var byte
    >
    > Sid
    >
    >
    > [noparse][[/noparse]Non-text portions of this message have been removed]
Sign In or Register to comment.