Home AMX User Forum AMX General Discussion

my memory is failing

How do I do a carriage return is ascii.

I'm trying to have a long string of text send to a panel and I need it almost in paragraph form.

Comments

  • a_riot42a_riot42 Posts: 1,624
    jazzwyld wrote: »
    How do I do a carriage return is ascii.

    I'm trying to have a long string of text send to a panel and I need it almost in paragraph form.

    I believe its the pipe character '|'.
    Paul
  • mpullinmpullin Posts: 949
    jazzwyld wrote: »
    How do I do a carriage return is ascii.

    I'm trying to have a long string of text send to a panel and I need it almost in paragraph form.
    Those are 2 different questions. A touchpanel will do a line break if it sees a pipe; a_riot is correct.

    The ASCII character for carriage return is 13 or $0D.
  • viningvining Posts: 4,368
    Don't forget the panel can only accept a 188 - 200 (not exactly sure) byte string at a time so you'll need to send chuncks using the ^BAT command to append your string into this paragraph.

    Now if you're doiing unicode the limit is around 40-50 bytes since they are widechars but there is no ^BAT type command for them so you can't easily append. The work around is multiple buttons of 40-50 characters each which isn't really a suitable workaround IMHO.
  • viningvining Posts: 4,368
    mpullin wrote:
    The ASCII character for carriage return is 13 or $0D.
    Say that again?? :confused::)
  • jazzwyld wrote: »
    How do I do a carriage return is ascii.

    "^M"
    jazzwyld wrote: »
    I'm trying to have a long string of text send to a panel and I need it almost in paragraph form.

    "|" (pipe),as has already been said
  • jazzwyldjazzwyld Posts: 199
    Thanks guys. I'll check on the # of characters and I was putting || two pipes and it wasn't working.
  • jjamesjjames Posts: 2,908
    jazzwyld wrote: »
    Thanks guys. I'll check on the # of characters and I was putting || two pipes and it wasn't working.

    You can always append your text. ;)

    http://www.amxforums.com/showthread.php?t=821
  • mpullinmpullin Posts: 949
    vining wrote: »
    Say that again?? :confused::)
    Err... yeah... well I'm glad the OP's question was answered anyway :)
  • DHawthorneDHawthorne Posts: 4,584
    Are you sending this text to a button? There is a word-wrap property in buttons that will make sending a CR unnecessary ... unless you just want to tweak it. I used to use the pipe character, but I seem to remember a few case (which, well that part, I don't remember) where it didn't work, so I just got in the habit of inserting a decimal 13 in the string where I needed a break: "'This part in single quotes', 13, 'the whole thing in double quotes, break between'" .

    The thing is, there is no type-able or print-able ASCII character for a carriage return. It's decimal 13, or a hex 0D ... anything else is just a shortcut understood by whatever you are using to represent it, and you can't guarantee that shortcut is universal. The pipe was used in TPD as a shortcut to add a line break within a button text, but just try it and an e-mail, and all you will get is the pipe. TPD3 allows you to hold the control key and hit enter to insert it. Some programs recognize a caret as a control key shortcut; I never tried a ^M in TPD or as part of a button text, so I don't know if it will work there or not ... but it will work in other contexts. Most Windows computers will let you hold down the ALT key and type 013 to get it ... but it's up for grabs whether your current application will insert a CR or hit your OK button when it sees it come in. So I simply got in th habit of building the string with the decimal value inserted, and I don't have to worry about it.
Sign In or Register to comment.