Home AMX User Forum NetLinx Studio

Degrees Symbol

You know the degrees symbol that goes after temperatures??

How can I get that into variable text string for G4 panels?

Thanks.

Comments

  • viningvining Posts: 4,368
    Although I haven't done it I believe you need to send unicode commands and in unicode hex c2 b0 is the degree sign.

    Look at the unicode commands WC_DECODE, WC_ENCODE and you can just covert existing ascii to unicode or use SEND_COMMAND dvTY,??^UNI-1,0,?,cString? just to send unicode directly.

    To date I've only modified some exisitng code that used these commands and never really got into the unicode itself. They do open the door to alot of symbols/languages that are not supported by ascii.
  • TurnipTruckTurnipTruck Posts: 1,485
    vining wrote: »
    Although I haven't done it I believe you need to send unicode commands and in unicode hex c2 b0 is the degree sign.

    Look at the unicode commands WC_DECODE, WC_ENCODE and you can just covert existing ascii to unicode or use SEND_COMMAND dvTY,??^UNI-1,0,?,cString? just to send unicode directly.

    To date I've only modified some exisitng code that used these commands and never really got into the unicode itself. They do open the door to alot of symbols/languages that are not supported by ascii.

    Thanks Vining. I got it. I added a "$B0" to my text string and it worked.

    Cheers.
  • ericmedleyericmedley Posts: 4,177
    Thanks Vining. I got it. I added a "$B0" to my text string and it worked.

    Cheers.

    You can use almost all these symbols like degrees, pound (UK currency) etc...

    A great way to find out what they are is to use the CHAR map that is part of windows. call it up, it'll give you the hex char number, send it raw to the panel and it works fine.
  • DHawthorneDHawthorne Posts: 4,584
    A decimal 171 (ie., "'70 ',171" - note the single quotes do not enclose the 171) works in most cases too ... but keep in mind, it's font specific ... the font needs to have the actual glyph, after all.
  • a_riot42a_riot42 Posts: 1,624
    DHawthorne wrote: »
    A decimal 171 (ie., "'70 ',171" - note the single quotes do not enclose the 171) works in most cases too ... but keep in mind, it's font specific ... the font needs to have the actual glyph, after all.

    Can't you just append ° to the end of your string?

    ie:

    char cnDegree = '°'
    "itoa(level.value),cnDegree"


    Always worked for me. You guys always do things the hard way.
    Paul
  • ericmedleyericmedley Posts: 4,177
    a_riot42 wrote: »
    Can't you just append ° to the end of your string?

    ie:

    char cnDegree = '°'
    "itoa(level.value),cnDegree"


    Always worked for me. You guys always do things the hard way.
    Paul



    "itoa(level.value),$B0"
    is harder than
    char cnDegree = '°'
    "itoa(level.value),cnDegree"
    ???
Sign In or Register to comment.