Shop OBEX P1 Docs P2 Docs Learn Events
how can concat a numeric value onto a string — Parallax Forums

how can concat a numeric value onto a string

chris joneschris jones Posts: 391
edited 2010-06-25 23:18 in Propeller 1
Hello everyone

i have a project that i am working on and sending the data over RF i can send a string but i want to place a number at the end of that string·


exmpale
its 90' outside

the 90 oin the string would be a number from my sensor.i have not started to work on the sensor part of the code but i can send a string over RF.

Comments

  • StefanL38StefanL38 Posts: 2,292
    edited 2010-06-25 17:03
    object FullDuplexSerial method dec

    you don't have to concat it

    just code
      Serial.Str(string(""My Text")) 
      Serial.dec(MyVariable)
    
    



    the value will be send right after the last character of the string

    best regards

    Stefan
  • Bobb FwedBobb Fwed Posts: 1,119
    edited 2010-06-25 23:18
    obex.parallax.com/objects/543/ My string library has a concat function. But depending on your specific use, there may be easier ways to concat strings and integers (like above).
    BTW: my object does not have a way to convert integers to strings, but there are other objects that do that, such as Simple Numbers (included with your Propeller Tool).

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    April, 2008: when I discovered the answers to all my micro-computational-botherations!

    Some of my objects:
    MCP3X0X ADC Driver - Programmable Schmitt inputs, frequency reading, and more!
    Simple Propeller-based Database - Making life easier and more readable for all your EEPROM storage needs.
    String Manipulation Library - Don't allow strings to be the bane of the Propeller, bend them to your will!
    Fast Inter-Propeller Comm - Fast communication between two propellers (1.37MB/s @100MHz)!
Sign In or Register to comment.