String functions


Closed Thread
Results 1 to 3 of 3
  1. #1
    Join Date
    Aug 2003
    Posts
    985

    Default String functions

    Hi Guys
    The most requested feature for PBP is string functions.
    A string is an array full of text with a zero at the end.
    Presto you now have string functions! The End













    Seriously though... What is actually meant when someone requests string functions?
    What exactly is the new ability achieved with them, and provide an example syntax.
    PBP commands such as LCDOUT and SERIN/OUT can already be likened to strings, so I’m curious to know.
    Cheers, Art.

  2. #2
    Join Date
    May 2013
    Location
    australia
    Posts
    2,383


    Did you find this post helpful? Yes | No

    Default Re: String functions

    yes, string functions can be implemented with pbp code blocks but just like in your "serout code space " thread
    what looks like a simple code block often turns out to be larger,slower,clunkier and having much less functionality than a properly integrated
    piece of code . unless its done in asm of course but thats no guarantee . asm code that takes full advantage of chip resources over the range
    of chips that pbp supports is not that simple to implement , with 8/16 bit fsr's , linear memory etc it gets complicated.
    i'm sure programers could integrate some handy equivlents of some useful C functions ,but a lot can be emulated anyway
    len() eg for j = 0 to len(mystr): do stuff : next
    equiv j=0: while mystr[j] : do stuff : j=j+1:wend
    strcat() eg newstr = oldstr+mystr (c strcat(newstr,oldstr); strcat(newstr,mystr) )
    equiv arraywrite newstr,[str oldstr,str mystr]
    atoi() eg int j = atoi(mystr)
    equiv arrayread mystr,[dec j]



    strok() missing in action
    Warning I'm not a teacher

  3. #3
    Join Date
    Aug 2003
    Posts
    985


    Did you find this post helpful? Yes | No

    Default Re: String functions

    That's pretty much what I think,
    hence I'd like to hear what native string handling is supposed to achieve.

    The most fun to write that I can think of right now is sprintf with format modifiers
    that would naturally extend the length of the original string,
    but then if you had the string with all the nice verbose numbers in it, what use would it be?
    Especially when the likes of lcdout and serout do the same thing.

Similar Threads

  1. String types and functions AND Functions with arguments
    By PickyBiker in forum PBP Wish List
    Replies: 3
    Last Post: - 1st January 2015, 10:00
  2. Replies: 3
    Last Post: - 3rd December 2011, 23:48
  3. How to send a string with another string inside it?
    By financecatalyst in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 13th May 2011, 18:11
  4. Where are the String Functions?
    By circuitpro in forum General
    Replies: 3
    Last Post: - 14th June 2009, 02:44
  5. A real String type & functions to match
    By Phil Moore in forum PBP Wish List
    Replies: 3
    Last Post: - 25th December 2008, 17:45

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