Announcement

Collapse
No announcement yet.

Filtering Comm characters

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

  • Filtering Comm characters

    I'm getting some strange results with my modem, a stray character here or there...

    I did a Msgbox Format$(Asc(mid$(g_szmdmInput,x,1))) in a for next loop for the length of the string.

    There was an Ascii 254 in there causing me some grief when it was put to a text box.

    Not to mention the $CRLF....

    Wasn't there a way to either filter these out, or am I thinking PB for Dos..
    Seems if you did a Print with a ";" to the screen it would filter those out.


    So question is, can PB/DLL do that? I'm doing a control set text to this textbox:

    Code:
    Control Add TextBox, hDlg, %IDTEXTCOMMSTATUS,"", 55,1,160,30, %ES_AUTOVSCROLL Or _
                               %ES_MULTILINE  Or %WS_TABSTOP, %WS_EX_CLIENTEDGE
    Anyway the 254 has to go, but the $CRLF I can live with and remove myself...


    Ideas what's causing this? I've seen it with USR modems before...not just here but in PB/Dos...

    Scott


    ------------------
    Scott
    mailto:[email protected][email protected]</A>
    Scott Turchin
    MCSE, MCP+I
    http://www.tngbbs.com
    ----------------------
    True Karate-do is this: that in daily life, one's mind and body be trained and developed in a spirit of humility; and that in critical times, one be devoted utterly to the cause of justice. -Gichin Funakoshi

  • #2
    PS, Subclassing is out of the question....or is it?
    This may be the way to go, just like I did with Bitswap to limit the characters to hex digits only being entered in...


    Scott

    ------------------
    Scott
    mailto:[email protected][email protected]</A>
    Scott Turchin
    MCSE, MCP+I
    http://www.tngbbs.com
    ----------------------
    True Karate-do is this: that in daily life, one's mind and body be trained and developed in a spirit of humility; and that in critical times, one be devoted utterly to the cause of justice. -Gichin Funakoshi

    Comment


    • #3
      See the REMOVE$ function.

      ------------------
      Tom Hanlin
      PowerBASIC Staff

      Comment


      • #4
        Yup that did it...

        Strange too, sometimes it's a Y with dots on top of it, sometimes it's a garbage character, it's always just ONE character tho, and I think it may just be on this one modem...

        How strange.. I wonder if I have the right .INF file loaded for it, maybe I'm using the 33.6 INF file with the 56k (Shouldn't matter THAT much, but I'll check).


        Thanks

        Scott

        ------------------
        Scott
        mailto:[email protected][email protected]</A>
        Scott Turchin
        MCSE, MCP+I
        http://www.tngbbs.com
        ----------------------
        True Karate-do is this: that in daily life, one's mind and body be trained and developed in a spirit of humility; and that in critical times, one be devoted utterly to the cause of justice. -Gichin Funakoshi

        Comment


        • #5
          The occasional garbage character may be due to line noise or such actions as changing the comm settings. It may also indicate that the hardware serial buffer is overflowing. Depending on the circumstances, it could be flow control characters or similar codes.


          ------------------
          Tom Hanlin
          PowerBASIC Staff

          Comment

          Working...
          X