Difference between revisions of "ASC (statement)"

From QB64 Wiki
Jump to navigation Jump to search
imported>Clippy
(Created page with 'The '''ASC''' statement allows a program to change a character at any position of a predefined {{KW|STRING}}. ''Syntax:'' ASC(string_expression$, position%) = code% * The …')
 
imported>Clippy
m
Line 1: Line 1:
The '''ASC''' statement allows a program to change a character at any position of a predefined {{KW|STRING}}.
+
The '''ASC''' statement allows a '''QB64''' program to change a character at any position of a predefined {{KW|STRING}}.
  
  

Revision as of 02:31, 17 June 2010

The ASC statement allows a QB64 program to change a character at any position of a predefined STRING.



Syntax: ASC(string_expression$, position%) = code%


  • The string expression must be predefined.
  • The position cannot be greater than the string's length(LEN) or an illegal function error will occur.
  • The ASCII code% value can be any value from 0 to 255.


Example:

a$ = "YZC" ASC(a$) = 65 ASC(a$, 2) = 66 PRINT a$ 'ABC ASC(a$, 2) = 0 PRINT a$

ABC A C


See also:

ASC (function), ASCII




Navigation:
Keyword Reference - Alphabetical
Keyword Reference - By Usage
Main Wiki Page