Shop OBEX P1 Docs P2 Docs Learn Events
ICCV7 STDIO Terminal Control Compatibility Problems — Parallax Forums

ICCV7 STDIO Terminal Control Compatibility Problems

TJHJTJHJ Posts: 243
edited 2009-04-02 18:51 in Propeller 1
Ok So I suspect that this might be from my own fault but if anyone has any suggestions or ideas.

I am having a hard time making any terminal program universal. Personally I like to use the PST terminal over the built in ICCv7 terminal, but in order to have it display correctly in one it shows up all messed up in the other.

Example.

putchar(0); // Clear the screen
printf("Some String %c", 13); // Some string followed by a CR
printf("Some more string %c", 13); // More stuff followed by a CR




Ok in the PST this comes out correctly, in the ICCv7 terminal the CR command does not seem to create a new line. It just prints all the lines on top of each other.


putchar(0); // Clear the screen
printf("Some String %c", '\n'); // Some string followed by a new line
printf("Some more string %c", '\n'); // More stuff followed by a new line





This code seems to make ICCv7 Show correctly but makes PST show up strange.

here is what I get in PST

Some String
                  Some More string
                                            The next new line starts printing here.






Any suggestions or ideas?

Thanks
TJ

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
I owe everyone here a bunch, So thanks again for answering my dumb questions.
Projects. RG500 ECU system. PropCopter. Prop CanSat. Prop Paste Gun.
Suzuki RG500 in a RGV 250 frame.
Bimota V-Due (Running on the fuel injection system)
Aprilia RS250

Comments

  • WNedWNed Posts: 157
    edited 2009-03-31 16:01
    The weird line run-on in PST is caused by the fact that what we think of as "Enter" (ASCII 13) is actually two control characters - \n (new line), and \r (carriage return). So both terminals are doing what they're told, but the "return" is lost in your translation...

    Try - printf("Some more string %c", '\n\r'); // More stuff followed by a new line plus carriage return

    Ned

    p.s. - To understand the logic behind the use of two control characters, you can visit a museum and watch an old Teletype in action. Moving the paper and moving the print head are two distinct tasks.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    "They may have computers, and other weapons of mass destruction." - Janet Reno

    Post Edited (WNed) : 3/31/2009 4:13:10 PM GMT
  • ImageCraftImageCraft Posts: 348
    edited 2009-03-31 18:42
    Tools->EnvOptions->Terminal

    You can set how the terminal should interpret LF or CR.
  • JoJo Posts: 55
    edited 2009-04-01 03:13
    Return being 2 control characters applies only to unwashed masses stuck with M$ technology.
    On Unix machines (and that includes Macs & Linux) it is just 1 character just like god intended smile.gif

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    ---
    Jo
  • WNedWNed Posts: 157
    edited 2009-04-01 03:55
    Au Contraire,
    Control codes date back to the days of PDP-11's and model 33 Teletype's. I've owned both and feel justified in my objection to being thrown in with the unwashed masses. I may be unclean, but that's a story for a different time. The point is to make the distinction between ASCII characters and control codes. In fact, the original Kernighan and Ritchie C used the same control codes, and they weren't thinking about how well it would run under Windows, since Bill Gates was just dropping out of college at the time.
    So come Sunday, you sit down and pray that god forgives you blaspheming about his control codes, and the sanctity of *nix. freaked.gif

    Ned

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    "They may have computers, and other weapons of mass destruction." - Janet Reno
  • shanghai_foolshanghai_fool Posts: 149
    edited 2009-04-01 03:57
    Sorry Jo
  • WNedWNed Posts: 157
    edited 2009-04-01 05:48
    Shanghai_fool,
    Saved all that paper tape so you could use it to punch out "Merry Christmas" and "Happy Birthday" streamers, didn't you... come on, at least once...

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    "They may have computers, and other weapons of mass destruction." - Janet Reno
  • shanghai_foolshanghai_fool Posts: 149
    edited 2009-04-01 06:59
    Yeah, but we could run them through magnets, jump up and down on them and still be able to read them. Punch cards also. The ones made from Mylar were practically industructable. They would melt, however, if heated enough.

    I remember having to "read" mag tape with a fluid of iron dust. No power. Just put the tape under the glass, wiggle it a little and presto, you could see the bit pattern.
    I'm not sure I would call them "the good old days" though. But a 3 platter 12" disk could hold a whopping 10 Megabytes. Thats actually quite a lot of raw text.
  • JoJo Posts: 55
    edited 2009-04-02 18:51
    LOL, agreed with all. I also used teletypes (though luckily for only 1 year) and completely missed out on the punch cards and paper tape
    by a hair's breath. Worked at TJ Watson for a while and the museum has some amazing mechanical contraptions to move paper tape
    faster than any kind of paper should ever move. Jaw dropping.
    But still think that in the age of crts and lcds, that is one useless character at the end of every line. But that's just when I want to
    tweak people about even just plain text files can look utterly different across different OSes

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    ---
    Jo
Sign In or Register to comment.