How about String Variables?


Closed Thread
Results 1 to 40 of 41

Hybrid View

  1. #1
    Join Date
    Jul 2008
    Posts
    38


    Did you find this post helpful? Yes | No

    Default

    U must have had the older version

    Quote Originally Posted by mackrackit View Post
    Wow! I did not know that GWbasic worked with the architecture of a MCU.

  2. #2
    Join Date
    Dec 2008
    Location
    Los Angeles, CA
    Posts
    156


    Did you find this post helpful? Yes | No

    Unhappy

    Strings are needed ALL THE TIME! I wish PBP would face the music and implement them! Every other compiler I see has them, why not PBP? (And No, I don't want to switch because I've got years and $ invested in this one.)

  3. #3
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by circuitpro View Post
    Strings are needed ALL THE TIME! I wish PBP would face the music and implement them! Every other compiler I see has them, why not PBP? (And No, I don't want to switch because I've got years and $ invested in this one.)
    Like I asked before, what type of project would you do that needs this?
    I am not trying to be difficult, I just have not had the need beyond what is already there.

    It might be fun/interesting to write a library/include to handle some of this stuff. If an example of it's usage was given I might give it a go...
    Dave
    Always wear safety glasses while programming.

  4. #4
    Join Date
    Dec 2008
    Location
    Los Angeles, CA
    Posts
    156


    Did you find this post helpful? Yes | No

    Red face

    Well, my last embedded project was a remote control for some specialty plasma monitors. The language used in the remotes uses exclusively strings for control. As I said before in another post, strings are a fact of life, get over it. Just as numbers, and variables, strings are used in everyday life and becoming more and more necessary for any kind of efficient programming. Rediculious little FOR...NEXT loops to parse out a string character by character are S T U P I D and a waste of time. IMO. Words are a fact of life. Adjust.

  5. #5
    Join Date
    Jul 2003
    Location
    Colorado Springs
    Posts
    4,959


    Did you find this post helpful? Yes | No

    Default

    Now that the "Warm Fuzzies" are flowing ...

    With PBP 2.60 ...
    The ARRAYREAD and ARRAYWRITE commands are quite useful for dealing with Strings.
    <br>
    DT

  6. #6
    Join Date
    Dec 2008
    Location
    Los Angeles, CA
    Posts
    156


    Did you find this post helpful? Yes | No

    Red face

    Sorry, I just feel so strongly about this and struggle every time a new project comes up because of these features lacking in PBP. I guess I'm a ranter! Sorry.

  7. #7
    Join Date
    Sep 2005
    Location
    Campbell, CA
    Posts
    1,107


    Did you find this post helpful? Yes | No

    Default

    I, too would like strings. I create extensive menus and text messages. Some of the same messages have to be output to

    1. Serial Port (uses HSEROUT
    2. Network Port (uses HSEROUT2)
    3. LCD

    Even with arrays, it is hard to output hundreds of different messages to each. Now, I duplicate the messages. Not code efficient.
    Charles Linquist

  8. #8
    Join Date
    Nov 2009
    Posts
    3


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by mackrackit View Post
    Like I asked before, what type of project would you do that needs this?
    I am not trying to be difficult, I just have not had the need beyond what is already there.

    It might be fun/interesting to write a library/include to handle some of this stuff. If an example of it's usage was given I might give it a go...
    Here's an example and something that I'm working on now. I am debugging a program that will read 3 axes of an accelerometer via A/D conversion. The sampled value is a number and I'd like to convert it to an array of text that I can send to the USB port. The pic is enumerating as a USB serial port so I can read it via a terminal program.

    Anybody know an efficient way to convert a 10-bit value to a number string?

  9. #9
    Join Date
    Jul 2003
    Location
    Colorado Springs
    Posts
    4,959


    Did you find this post helpful? Yes | No

    Default

    Anybody know an efficient way to convert a 10-bit value to a number string?
    Sure ... If you have PBP 2.60?
    Code:
    ARRAYWRITE MyArray,[DEC4 MyValue]
    Or for 3-axis ...
    Code:
    ARRAYWRITE MyArray,[DEC4 Xaxis, DEC4 Yaxis, DEC4 Zaxis]
    ____________
    DT

  10. #10
    Join Date
    Nov 2009
    Posts
    3


    Did you find this post helpful? Yes | No

    Default

    OK, cool.

    Looks like its a good time to pay my $25 and upgrade from 2.46. BTW, I used your interrupt based USB servicing include file. Works great. Thanks for sharing that.

  11. #11
    Join Date
    Jul 2003
    Location
    Colorado Springs
    Posts
    4,959


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by tr6coug View Post
    Looks like its a good time to pay my $25 and upgrade from 2.46.
    &nbsp; I should start charging meLabs a commission on upgrades.
    BTW, I used your interrupt based USB servicing include file. Works great. Thanks for sharing that.
    Excellent! You're Welcome! and thanks for the "User Review" ...

    Cheers,
    DT

  12. #12
    Join Date
    Nov 2009
    Location
    Wagoner, USA
    Posts
    52


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by mackrackit View Post
    Like I asked before, what type of project would you do that needs this?
    I am not trying to be difficult, I just have not had the need beyond what is already there.

    It might be fun/interesting to write a library/include to handle some of this stuff. If an example of it's usage was given I might give it a go...
    I send a lot of strings to LCD's and some of the "STD" basic string functions would be really handy. Of coarse strings suck up a bunch of memory but Constantly used strings can be stored in EEProm and called when needed.

  13. #13
    Join Date
    Jul 2011
    Posts
    35


    Did you find this post helpful? Yes | No

    Angry Re: How about String Variables?

    Only 2 years later and still no string commands. Left(2), Right(3), etc. I'm almost too old to code anymore... so much for waiting around.

  14. #14
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default Re: How about String Variables?

    I do understand what you mean, I can't argue against however...
    What's a string? A couple of consecutive character
    What's an Array? A couple of consecutive Byte
    A single Character = Byte
    Array are supported, therefore Strings are.

    ArrayWrite/ArrayRead, a spoon of creativity and you're all set. Sprinkle a macro in the equation (for ease of use) and VOILA!
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

  15. #15
    Join Date
    Jan 2005
    Location
    Montreal, Quebec, Canada
    Posts
    3,170


    Did you find this post helpful? Yes | No

    Default Re: How about String Variables?

    ARRAYREAD/WRITE, I guess it's time for me to upgrade as well.
    My Creality Ender 3 S1 Plus is a giant paperweight that can't even be used as a boat anchor, cause I'd be fined for polluting our waterways with electronic devices.

    Not as dumb as yesterday, but stupider than tomorrow!

Similar Threads

  1. How to convert HEX Value as formatted BIN String ?
    By Robson in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 19th August 2007, 02:16
  2. Visual Basic 6 & Access 2000
    By Demon in forum Off Topic
    Replies: 33
    Last Post: - 7th September 2006, 04:39
  3. Variables not appearing in Watch Window MPLabv7.3
    By jd76duke in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 16th June 2006, 14:36
  4. String Parsing
    By eoasap in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 18th February 2006, 17:20
  5. Message String Table using Readcode
    By mytekcontrols in forum Code Examples
    Replies: 2
    Last Post: - 10th July 2005, 23:17

Members who have read this thread : 1

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