![]() |
Forum Index : Microcontroller and PC projects : MMBasic: special characters in a string
Author | Message | ||||
PilotPirx![]() Regular Member ![]() Joined: 03/11/2020 Location: GermanyPosts: 99 |
Hello, starting with MMBasic and graphics i got the problem to put special characters (f.e. >127) in a string. How to define a string with characters which are not on the keyboard? With the sinclair spectrum you could use caps shift and GRAPHICS to get these characters. |
||||
twofingers![]() Guru ![]() Joined: 02/06/2014 Location: GermanyPosts: 1576 |
special character=chr$(ascii) or inc special_character$,chr$(ascii) inc special_character$, STRING$( nbr, ascii ) ascii= 0 to 255 There are no keys for these characters in PicoMite. Michael Edited 2024-12-31 03:23 by twofingers causality ≠ correlation ≠ coincidence |
||||
JohnS Guru ![]() Joined: 18/11/2011 Location: United KingdomPosts: 4038 |
Such as: a = 128 b$ = chr$(a) You can get at the value again: c = asc(b$) (then a and c are the same) John |
||||
PilotPirx![]() Regular Member ![]() Joined: 03/11/2020 Location: GermanyPosts: 99 |
![]() Which means such kind of string is not possible? Only character=chr$(nbr)+chr$(nbr)+ and so on. |
||||
JohnS Guru ![]() Joined: 18/11/2011 Location: United KingdomPosts: 4038 |
Yes. Or use a loop. John |
||||
disco4now![]() Guru ![]() Joined: 18/12/2014 Location: AustraliaPosts: 1000 |
Also see Special Characters in Strings on page 23 of the manual. Using OPTION ESCAPE allows their entry in decimal escaped by a backslash. Latest F4 Latest H7 FotS |
||||
phil99![]() Guru ![]() Joined: 11/02/2018 Location: AustraliaPosts: 2611 |
and so:- > for n=128 to 138 : inc s$, chr$(n) : next > for n=1 to 11 : ? asc(mid$(s$,n,1)); : next 128 129 130 131 132 133 134 135 136 137 138 > |
||||
![]() |
![]() |
The Back Shed's forum code is written, and hosted, in Australia. | © JAQ Software 2025 |