1. The Down Arrow
- Posted by DonCole Oct 26, 2012
- 1369 views
Hello everybody,
How do you get a down arrow into a LText?
The up arrow (ascii 24) works fine.
setText(LText2,sprintf("%s",24))
But the down arrow (ascii 25) gives me the wrong symbol.
setText(LText2,sprintf("%s",25))
Try it.
Don Cole
2. Re: The Down Arrow
- Posted by CoJaBo2 Oct 26, 2012
- 1312 views
There are no ASCII characters below #32; those values are reserved for control codes. The displayed characters will be random.
You would need to use Unicode ↓ (though I'm actually not sure what the method to do that in Eu is)..
3. Re: The Down Arrow
- Posted by DonCole Oct 26, 2012
- 1298 views
There are no ASCII characters below #32; those values are reserved for control codes. The displayed characters will be random.
You would need to use Unicode ↓ (though I'm actually not sure what the method to do that in Eu is)..
Thank you CoJaBo2,
I get the same problem with down arrow (ascii 281) and up arrow (ascii 280).
Both above #32
Don Cole
4. Re: The Down Arrow
- Posted by CoJaBo2 Oct 26, 2012
- 1340 views
You would need to use Unicode functions to get symbols like that to display; its possible there aren't any in..win32lib.ew?, its been a long while since I've used Windows.. The documentation should say, but its not available online.
I get the same problem with down arrow (ascii 281) and up arrow (ascii 280).
Where are you getting these codes, btw? ASCII (actually, I think Windows uses Windows-1252) is 32-255 (with a few left out in the middle).
5. Re: The Down Arrow
- Posted by DonCole Oct 27, 2012
- 1342 views
You would need to use Unicode functions to get symbols like that to display; its possible there aren't any in..win32lib.ew?, its been a long while since I've used Windows.. The documentation should say, but its not available online.
I get the same problem with down arrow (ascii 281) and up arrow (ascii 280).
Where are you getting these codes, btw? ASCII (actually, I think Windows uses Windows-1252) is 32-255 (with a few left out in the middle).
I'm getting from this test program that I wrote:
include get.e integer c,i c=0 procedure print_out(integer c) for x=1 to 20 do puts(1, sprintf("x=%2d",x) &" ") puts(1, sprintf("c=%2d",c) &" ") puts(1, sprintf("c+x=%2d",x+c) &"=") puts(1, sprintf("%s",x+c) &" ") puts(1, sprintf("%2d",x+c+20) &"=") puts(1, sprintf("%s",x+c+20) &" ") puts(1, sprintf("%2d",x+c+40) &"=") puts(1, sprintf("%s",x+c+40) &" ") puts(1, sprintf("%2d",x+c+60) &"=") puts(1, sprintf("%s",x+c+60) &" ") puts(1, sprintf("%2d",x+c+80) &"=") puts(1, sprintf("%s",x+c+80) &" ") puts(1, sprintf("%2d",x+c+100) &"=") puts(1, sprintf("%s",x+c+100) &" ") puts(1, sprintf("%2d",x+c+120) &"=") puts(1, sprintf("%s",x+c+120) &" ") puts(1, sprintf("%2d",x+c+140) &"=") puts(1, sprintf("%s",x+c+140) &"\n") end for end procedure while 1 do print_out(c) puts(1, "hit any key\n") i=wait_key() c+=20 end while
Don Cole
6. Re: The Down Arrow
- Posted by CoJaBo2 Oct 27, 2012
- 1307 views
You would need to use Unicode functions to get symbols like that to display; its possible there aren't any in..win32lib.ew?, its been a long while since I've used Windows.. The documentation should say, but its not available online.
I get the same problem with down arrow (ascii 281) and up arrow (ascii 280).
Where are you getting these codes, btw? ASCII (actually, I think Windows uses Windows-1252) is 32-255 (with a few left out in the middle).
I'm getting from this test program that I wrote:
include get.e integer c,i c=0 procedure print_out(integer c) for x=1 to 20 do puts(1, sprintf("x=%2d",x) &" ") puts(1, sprintf("c=%2d",c) &" ") puts(1, sprintf("c+x=%2d",x+c) &"=") puts(1, sprintf("%s",x+c) &" ") puts(1, sprintf("%2d",x+c+20) &"=") puts(1, sprintf("%s",x+c+20) &" ") puts(1, sprintf("%2d",x+c+40) &"=") puts(1, sprintf("%s",x+c+40) &" ") puts(1, sprintf("%2d",x+c+60) &"=") puts(1, sprintf("%s",x+c+60) &" ") puts(1, sprintf("%2d",x+c+80) &"=") puts(1, sprintf("%s",x+c+80) &" ") puts(1, sprintf("%2d",x+c+100) &"=") puts(1, sprintf("%s",x+c+100) &" ") puts(1, sprintf("%2d",x+c+120) &"=") puts(1, sprintf("%s",x+c+120) &" ") puts(1, sprintf("%2d",x+c+140) &"=") puts(1, sprintf("%s",x+c+140) &"\n") end for end procedure while 1 do print_out(c) puts(1, "hit any key\n") i=wait_key() c+=20 end while
Don Cole
DOS (including command prompt, which emulates it) is completely different than Windows; DOS defines the control chars (1-31) and extended ASCII (128-255) to be block drawing elements and some other things. Anything above 255 most likely just wraps back around, since DOS and legacy Windows only supports character sets of at most 255 symbols (one byte) at a time. Unicode supports many, many more (including arrows, snowmen, hotels, monochrome blue hearts, etc), but my current understanding is that Eu has very limited support for it..
7. Re: The Down Arrow
- Posted by DonCole Oct 27, 2012
- 1304 views
Thank you CoJaBo2,
For your assistance.
I found the way to type that in a Windows program like Notepad is:
Hold down the Alt key and from the numbers keypad type 25.
↓↓↓ ↑↑↑
But I don't know how translate that to sprintf(}.
Don Cole
8. Re: The Down Arrow
- Posted by jimcbrown (admin) Oct 27, 2012
- 1274 views
You would need to use Unicode functions to get symbols like that to display; its possible there aren't any in..win32lib.ew?, its been a long while since I've used Windows.. The documentation should say, but its not available online.
On Linux/GNU, on my UTF-8 terminal, I just do this:
puts(1, {226,134,147})
Since Windoze is UTF-16, it's possible you could get away with this:
puts(1, {255,254,147,33,10})
I haven't tried this, however.
Alternatively, you could grab the raw bytes that make up the down arrow (you can get these from the text file you made with Notepad), poke them into memory along with a NUL terminator, and then wrap and call WriteConsoleOutputCharacterU from the w32api. That's a bit more work but guaranteed to work (assuming you do it right).
I get the same problem with down arrow (ascii 281) and up arrow (ascii 280).
Where are you getting these codes, btw? ASCII (actually, I think Windows uses Windows-1252) is 32-255 (with a few left out in the middle).
These extended non-ASCII keycodes are internal to EU, and are used to represent keys that don't return a single ASCII character or a single control character. (On a *nix, these are converted via some sort of table from the multi-character escape sequence.) Obviously, you can't use these values for drawing.
Unicode supports many, many more (including arrows, snowmen, hotels, monochrome blue hearts, etc), but my current understanding is that Eu has very limited support for it..
I've always felt the UTF-8 support on Linux/GNU was adaquate, even back in the 2.3 days! (But of course I've never had to convert to UTF-16 or UTF-32, etc.)