CHR$: Difference between revisions

From Macros Wiki
Jump to navigationJump to search
ConnerO (talk | contribs)
New page: {{Command|syntax=CHR$ <n> |description=*DESCRPTION* |param1=<n>|param1_desc={{n}} }} ===Example=== :- CHR$ Category:Internal_Macro_Functions
 
CatoH (talk | contribs)
No edit summary
 
(5 intermediate revisions by 2 users not shown)
Line 1: Line 1:
{{Command|syntax=CHR$ <n>
[[:Category:Internal_Macro_Functions|{{Up}}]]
|description=*DESCRPTION*


|param1=<n>|param1_desc={{n}}
{{Command|syntax=[[Image:chr$.png|right|CHR$]]CHR$ <n>
|description=:Returns the character represented by the given ASCII value.
 
|param1=<n>|param1_desc=ASCII value.
}}
}}


===Example===
===Example===
:- CHR$
:B$ = CHR$(65)
 
:B$ = CHR$(d1)
 
:B$ = CHR$(ABS(d1*w1))
 
===Example 2===
:To use special characters in dialogs and message windows, they need to be converted from ASCII codes :
<pre>
 
! Ø = asciicode 216
diametersign$ = CHR$(216)
drilldia=10
message "Selected drill is "+diametersign$+"%drilldia mm"
 
</pre>
:Outputs 'Selected drill is Ø10 mm' to message window


[[Category:Internal_Macro_Functions]]
[[Category:Internal_Macro_Functions]]

Latest revision as of 18:31, 20 April 2025

Up

Command

CHR$
CHR$
CHR$ <n>


Returns the character represented by the given ASCII value.

Parameters

<n>
ASCII value.

Example

B$ = CHR$(65)
B$ = CHR$(d1)
B$ = CHR$(ABS(d1*w1))

Example 2

To use special characters in dialogs and message windows, they need to be converted from ASCII codes :

! Ø = asciicode 216
diametersign$ = CHR$(216)
drilldia=10
message "Selected drill is "+diametersign$+"%drilldia mm"

Outputs 'Selected drill is Ø10 mm' to message window