Handling a lot of text data, any simple and practical ways?


Closed Thread
Results 1 to 20 of 20

Hybrid View

  1. #1
    Join Date
    May 2013
    Location
    australia
    Posts
    2,643


    Did you find this post helpful? Yes | No

    Default Re: Handling a lot of text data, any simple and practical ways?

    I suppose one of those should be CTEMP.lowbyte, right?
    ̶y̶e̶s̶ ̶,̶ ̶c̶o̶p̶y̶ ̶p̶a̶s̶t̶e̶ ̶t̶r̶a̶p̶ ̶f̶o̶r̶ ̶t̶h̶e̶ ̶i̶n̶o̶b̶s̶e̶r̶v̶a̶n̶t̶

    its a pity the the forum edit restraints are so limiting

    needs to be this , adding lowbyte breaks it
    if (CTEMP.highbyte==0) then
    Last edited by richard; - 13th September 2021 at 06:10.
    Warning I'm not a teacher

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


    Did you find this post helpful? Yes | No

    Default Re: Handling a lot of text data, any simple and practical ways?

    adding lowbyte breaks it
    i remember it now , if you really want to be sparing with flash space odd length strings must not have the ,0 termination
    the assembler adds the 0 for odd lengths automatically. the code then needs to check lowbyte for 0-ness

    if you add the ,0 you wind up with 3 nulls in a row to account for hence only a check of highbyte works
    Warning I'm not a teacher

  3. #3
    Join Date
    Feb 2013
    Posts
    1,124


    Did you find this post helpful? Yes | No

    Default Re: Handling a lot of text data, any simple and practical ways?

    And what if I add some special character to my data array, so when reading it, I do not no longer need to store length of each string? This should allow me to skip all that ASM things.
    And meanwhile, I have a little problem with usability.

    I have this routine for handling two buttons connected via ADC.

    Code:
    do
    adcin 0,cnt
    if CNT<900 then'if any button pressed, increase debounce variable
    dly=dly+1
    pause 1
    endif
    if CNT<100 and DLY>100 then 'if left is still pressed
    dly=0 'reset debounce counter
    task1:
    endif
    if CNT<900 and CNT>100 and DLY>100 then 'if right is still pressed
    dly=0 'reset debounce counter
    task2:
    endif
    loop
    It analyzes, whenever any button is pressed, and launches debouncer loop, to avoid accidental presses. That works fine. This code is repeated several times in sequence, according to menu items, with different task1/task2 -s inside.
    But the problem is, that if user keeps pressing the "left" button, he scrolls thru the all menu items, and I want to avoid this, so when he presses the left button and keeps it pressed, He does not advance to next item, until he releases the button and presses it again. I know, this feature is a part of BUTTON statement, but due to shortage of pins, I'm using ADC input, and BUTTON statement does not works there.

    any ideas?

  4. #4
    Join Date
    May 2013
    Location
    australia
    Posts
    2,643


    Did you find this post helpful? Yes | No

    Default Re: Handling a lot of text data, any simple and practical ways?

    And what if I add some special character to my data array, so when reading it, I do not no longer need to store length of each string? This should allow me to skip all that ASM things
    how do imagine that would that work ?

    And meanwhile, I have a little problem with usability.
    nothing that a state machine approach can't resolve

    http://www.picbasic.co.uk/forum/showthread.php?t=21109
    http://www.picbasic.co.uk/forum/showthread.php?t=23840
    Warning I'm not a teacher

  5. #5
    Join Date
    Feb 2013
    Posts
    1,124


    Did you find this post helpful? Yes | No

    Default Re: Handling a lot of text data, any simple and practical ways?

    Well say I add $FF to end of each string.
    So I need only to know start address of each sentence
    and start reading from there in loop, until inputchar=FF

    And for the input, I can't relate capacitive input or encoder handling with my task.
    These both are yes/no condition, and mine is analog reading...

  6. #6
    Join Date
    May 2013
    Location
    australia
    Posts
    2,643


    Did you find this post helpful? Yes | No

    Default Re: Handling a lot of text data, any simple and practical ways?

    Well say I add $FF to end of each string.
    So I need only to know start address of each sentence
    and start reading from there in loop, until inputchar=FF
    precisely what was offered except using the more useful and commonly accepted null in lieu of the FF

    And for the input, I can't relate capacitive input or encoder handling with my task.
    These both are yes/no condition, and mine is analog reading.
    its the overall concept of key/sw reading to observe, its a universal concept
    Warning I'm not a teacher

  7. #7
    Join Date
    Feb 2013
    Posts
    1,124


    Did you find this post helpful? Yes | No

    Default Re: Handling a lot of text data, any simple and practical ways?

    Well, my code has no ASM

    P.S. A big brother just arrived
    But can't make it work with PBP

    Name:  bigbrother.jpg
Views: 1030
Size:  509.9 KB

Similar Threads

  1. Any elegant way of text string handling?
    By CuriousOne in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 2nd November 2020, 16:21
  2. Replies: 11
    Last Post: - 9th March 2020, 12:37
  3. Serious Help Needed-Tried a Lot & Now I am Here
    By Megahertz in forum Schematics
    Replies: 3
    Last Post: - 17th December 2009, 12:12
  4. Serial problem with a lot of chips
    By The Master in forum Off Topic
    Replies: 1
    Last Post: - 20th October 2007, 12:55
  5. Writing serial data to text file
    By TurboLS in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 2nd March 2005, 22:09

Members who have read this thread : 0

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