Subject |
Re: ASC code for printable arrow up and arrow down keys |
From |
Akshat Kapoor <akshat.kapoor@kapoorsons.in> |
Date |
Tue, 9 Jul 2019 20:51:40 +0530 |
Newsgroups |
dbase.getting-started |
On 09/07/2019 17:40, Mervyn Bick wrote:
> On 2019-07-08 8:37 PM, Mustansir Ghor wrote:
>> Dear All
>>
>> Can anybody guide me how to print up arrow and down arrow in my text
>> file or in print out.
>
> If your program writes text to a plain text file you're out of luck. If
> you are using a report to create the printout then this should be possible.
>
> Internally dBASE allocates 2 bytes per character in a string. Both text
> and textlabel objects can display 2 byte uni-code characters but when
> dBASE for a language which doesn't use 2 byte uni-code writes to a text
> file it seems it only writes ? if it encounters a 2 byte character.
>
> To display an up or down arrow in a text object on a form or report you
> can change the font setting for an h (up arrow) or an i (down arrow) to
> wingdings 3. Unfortunately you can't change just one character in a
> string the way you can in, say, Word or a memofield in dBASE. In a text
> object it's all or nothing when you change the object's fontName property.
>
>
> The alternative is to set the high and low bytes for any character. That
> way it doesn't matter what font you are using.
>
> For an up arrow
>
> function TEXTLABEL1_onOpen()
> a = space(1)
> a.setbyte(0,145)
> a.setbyte(1,33)
> this.text = 'Up arrow '+a+' symbol'
> return
>
>
> For a down arrow
>
> function TEXTLABEL2_onOpen()
> a = space(1)
> a.setbyte(0,147)
> a.setbyte(1,33)
> this.text = 'Down arrow '+a+' symbol'
> return
>
> The attached example program prints the arrows in the result panel and
> then opens the text file in the source code editor so that you can see
> what was saved.
>
>
> Mervyn.
I had thought printing an arrow would be simple :-(
I tried the following
?"↓"
?asc("↓")
?chr(63)
The first printed a down arrow
The second gave an output of 63
And last gave an output of ?
The first option was obtained by pressing Alt + 2 5 of numeric key pad
(https://www.alt-codes.net/arrow_alt_codes.php has complete list of alt
codes)
I have tried ?"a↓b" and it gave the desired result.
Have not tried in report or form
Regards
Akshat
|
|