Announcement

Collapse
No announcement yet.

Any known issues with Less Than? Strange Issue.

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • FlyMario
    started a topic Any known issues with Less Than? Strange Issue.

    Any known issues with Less Than? Strange Issue.

    Mode: Designer
    Module: uVGA-III

    So I am coding attempting to make a simple vt100 ish interpreter for a Z80 CP/M computer I have (RC2014).

    Everything seems to be going fine until I start trying to filter the characters. I wrote this function to make sure the character I get is an actual character.

    func printChr(var ch)
    // if ((ch >= 32) && (ch < 127))
    if (ch > 32 )
    if (ch < 127)
    print([CHR] ch);
    endif
    endif
    endfunc

    Now the first part works "if (ch >=32)" but the second part does not work at all "if (ch < 127)".

    For information, I am only trying to print from the program... no external devices. Without the second part I can print any text out without any issue at all.

    Do any of you have an idea what is going wrong?

    Peter J. Fischel

  • bernadette
    replied
    Hello Peter,

    Your welcome, if you have more questions you can always reach our forum.

    Best Regards,
    Bern

    Leave a comment:


  • FlyMario
    replied
    I copied that function into another program and it worked. I can only imagine I am running past the end of an array, writing into, Memory Leak.

    We get so used to high-level languages these days that protect us from our own stupidity.

    The module is working as it should.

    Thanks for your help.

    Leave a comment:


  • bernadette
    replied
    Hello,

    I test your code and its perfectly working on my end. It's possible that the error came from the parameter that has being pass on your printChr() function.
    You can try to use this code to your printChr() function.

    func printChr(var ch)
    print(ch);// for debugging purposes, this will print the numerical value of the character that you want to print, for you to be sure that it is within the range of your selected parameter
    if (ch > 32 )
    if (ch < 127)
    print([CHR] ch);
    endif
    endif
    endfunc

    Hope it helps,
    Bern

    Leave a comment:

Working...
X