Shop OBEX P1 Docs P2 Docs Learn Events
Store ascii text like a variable — Parallax Forums

Store ascii text like a variable

Aaron WallAaron Wall Posts: 31
edited 2009-03-11 19:11 in BASIC Stamp
I have an application where it would be very handy to be able to store an ascii message (13 characters) under a variable name and recall that later in the program. Is there a good way of doing this?

I looked at declaring a 13 Byte array, but that eats up all my available variable space really fast.

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2009-03-11 03:37
    If the message changes infrequently, you can store the characters of the message using a DATA statement (which goes into EEPROM along with the program). Data in EEPROM can be read with the READ statement (and changed with the WRITE statement). Look in the Stamp Manual under those statements for examples and details.
  • JDJD Posts: 570
    edited 2009-03-11 18:51
    Aaron,

    As·Mike suggested, if you do not have the BASIC Stamp Syntax & Reference Manual, you can download a copy or purchase a hard copy from our web site. This will help in reviewing the commands.
    ·
    · BASIC Stamp Syntax & Reference Manual [noparse][[/noparse] hard copy ]:
    · http://www.parallax.com/Store/Books/BASICStamp/tabid/168/CategoryID/42/List/0/Level/a/ProductID/143/Default.aspx?SortField=ProductName%2cProductName
    ·
    · BASIC Stamp Syntax & Reference Manual [noparse][[/noparse] soft copy ]:
    · http://www.parallax.com/Portals/0/Downloads/docs/prod/stamps/web-BSM-v2.2.pdf


    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Respectfully,


    Joshua Donelson
    www.parallax.com
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2009-03-11 19:11
    Aaron,

    Another option is a BASIC Stamp 2p or higher model. These models have SPRAM that can be written to directly from a SERIN statement. But you can also store arbitrary string data here up to 126 characters long. This will not use up any variable space, but pipelining the data to another device will mean channeling it one byte at a time using a single byte variable. I hope this helps. Take care.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Engineering
Sign In or Register to comment.