|
Forum Index : Microcontroller and PC projects : MMBasic: special characters in a string
| Author | Message | ||||
| PilotPirx Senior Member Joined: 03/11/2020 Location: GermanyPosts: 133 |
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: 1769 |
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 ‚My name is Ozymandias, king of kings Look on my works, ye Mighty, and despair!‘ Nothing beside remains. Round the decay Of that colossal wreck, boundless and bare The lone and ... |
||||
| JohnS Guru Joined: 18/11/2011 Location: United KingdomPosts: 4377 |
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 Senior Member Joined: 03/11/2020 Location: GermanyPosts: 133 |
![]() 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: 4377 |
Yes. Or use a loop. John |
||||
| disco4now Guru Joined: 18/12/2014 Location: AustraliaPosts: 1149 |
Also see Special Characters in Strings on page 23 of the manual. Using OPTION ESCAPE allows their entry in decimal escaped by a backslash. F4 H7FotSF4xGT |
||||
| phil99 Guru Joined: 11/02/2018 Location: AustraliaPosts: 3374 |
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 2026 |