Shop Learn
DEBUG Titles/Text, can they be dynamic? — Parallax Forums

DEBUG Titles/Text, can they be dynamic?

@cgracey (and fellow P2 enthusiasts)

So far I haven't found the right incantation to allow the displaying of a text string that comes from a variable/constant when using the various DEBUG modes.
I want to be able to create generic reusable routines that contains DEBUG statements that accepts string pointers so that you can specify for example different Titles or Text to be displayed.
I've found numerous examples showing fixed strings, how do you specify the use of variable string pointer?

It is probably simple, I'm just having difficulty finding the solution...

Comments

  • cgraceycgracey Posts: 13,406
    edited 2021-02-15 08:46

    ZSTR_(address)
    LSTR_(address, length)

    Try these out.

  • Francis BauerFrancis Bauer Posts: 217
    edited 2021-02-15 09:39

    @cgracey said:
    ZSTR_(address)
    LSTR_(address, length)

    Try these out.

    @cgracey

    Thank you for the quick response.

    I did findDEBUG(LOGIC MyDisplay TITLE '#(v)') - Characters are output using `#(value) notation.
    The above works with variables, but only character by character.

    So far I've only been able to get debug(ZSTR_(string("help"))) to work, when I try to use a string pointer variable I just get gibberish.

    Do the above commands work with the various graphical output forms of DEBUG?

    Are there any examples you have of using these commands with variables?

    EDIT: I was finally able to get the simple DEBUG output to display correctly using a string pointer with ZSTR, but I still haven't been able to get it work with setting the Title or other text for DEBUG SCOPE statements.
    Time for bed, I will continue poking at it later during daylight hours...

  • cgraceycgracey Posts: 13,406

    Francis, I think you've got this working, but here is a program that makes ample use of dynamic strings in DEBUG statements, for anyone else who reads this thread and wonders:

  • @cgracey said:
    Francis, I think you've got this working, but here is a program that makes ample use of dynamic strings in DEBUG statements, for anyone else who reads this thread and wonders:

    Thank you, Chip. This is a great example for showing off dynamic strings in DEBUG statements.

Sign In or Register to comment.