none
ASCII Codes in Small basic RRS feed

  • Question

  • (Put this orinally in the wrong forum so am re-posting.)

    I wish to convert the QBasic command CHR$(201) to an equivalent small basic command.

    Using the text.getcharacter(201) command does not produce the same character as CHR$(201). Presumably because getcharacter gets the Unicode text?

    Character 201 in the extended ASCII codes is a double line, top left, right angle bracket.

    Checked on the web and the suggestion was to use CHR(201) but this doesn't work, so any suggestions are welcome.

    Friday, June 7, 2013 2:59 AM

Answers

  • Franganistan,

    FYI

    24

     ↑   (CAN)

    Ascii code Chr24 is the code that was used in teletype days for cancel.  It's in the control character group (0 to 31).

    Glad you figured out the character map.  I knew it was there, but hadn't used it in the way you described.

    JR


    JR

    • Marked as answer by Franganistan Saturday, June 8, 2013 5:40 AM
    Friday, June 7, 2013 10:54 AM
    Answerer

All replies

  • May you show us with a screenshot how the character must look?

    I can't imagine which character you mean.

    Text.GetCharacter uses the Unicode.

    You can't use any QBasic commands in SmallBasic so CHR(201) will not work.

    You can get your Unicode number if you enter your needed character:

    read = TextWindow.Read()
    result = Text.GetCharacterCode(read)
    TextWindow.WriteLine(result)


    Greetings Timo

    Friday, June 7, 2013 7:45 AM
  • I think I have a workaround for this.

    In Windows go to All Programs\Accessories\System Tools\Character Map.  When the map comes up tick 'Advanced View', and in 'Group By:' select Unicode Subrange. A separate box will appear and in this select Box Drawings.  Click on the character you want and click on the select button and then Copy.

    Paste the resulting character into SB.  What I have is place each character into a variable and then Textwindow.Write each variable where the CHR$ command appears.

    CHR24 = " " ' Haven't figured out what chr 24 is yet.
    CHR43 = "+" 'QBasic CHR$(43)
    CHR186 = "║" ' etc
    CHR187 = "╗"
    CHR188 = "╝"
    CHR195 = "├"
    CHR197 = "┼"
    CHR200 = "╚"
    CHR201 = "╔"
    CHR205 = "═"

    Friday, June 7, 2013 8:44 AM
  • Franganistan,

    FYI

    24

     ↑   (CAN)

    Ascii code Chr24 is the code that was used in teletype days for cancel.  It's in the control character group (0 to 31).

    Glad you figured out the character map.  I knew it was there, but hadn't used it in the way you described.

    JR


    JR

    • Marked as answer by Franganistan Saturday, June 8, 2013 5:40 AM
    Friday, June 7, 2013 10:54 AM
    Answerer
  • JR,

    Thanks for info.  Using character map went to Arrows and found following which will do the job.

    CHR24 = "↑"

    FG

    Friday, June 7, 2013 10:29 PM
  • You can also enter characters in a SmallBasic program with :

    press and hold the alt key and enter the number on the numerical keypad, then release alt.

    e.g  char 253="²"

    This works on a desktop with numerical keypad. I don't know how to do it on a laptop.


    Jan [ WhTurner ] The Netherlands

    Sunday, June 9, 2013 2:19 PM
    Answerer
  • show QGL367


    Best Regards Martin

    Sunday, June 9, 2013 2:58 PM
  • Martin,

    Not clear to me what show QGL367 means.  Can you explain please.

    Sunday, June 9, 2013 9:57 PM
  • Start sb, click on the import icon. A new window open know. Put in the input field QGL367 and press the enter key. It import a sb program. Start the program and it show you all the character.


    Best Regards Martin


    • Edited by martmen Monday, June 10, 2013 5:34 PM
    Monday, June 10, 2013 5:33 PM