Notice. New forum software under development. It's going to miss a few functions and look a bit ugly for a while, but I'm working on it full time now as the old forum was too unstable. Couple days, all good. If you notice any issues, please contact me.
|
Forum Index : Microcontroller and PC projects : MMBasic: special characters in a string
Author | Message | ||||
PilotPirx Regular Member Joined: 03/11/2020 Location: GermanyPosts: 71 |
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: 1333 |
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: 3831 |
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: 71 |
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: 3831 |
Yes. Or use a loop. John |
||||
disco4now Guru Joined: 18/12/2014 Location: AustraliaPosts: 923 |
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 |
||||
phil99 Guru Joined: 11/02/2018 Location: AustraliaPosts: 2200 |
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 > |
||||
Print this page |