Home THE HYPERCARD CENTER

HyperTalk Reference
Home » HyperTalk Reference » Functions

Note: This is a work in progress and will be formatting errors. Read more about the project on the home page.

numToChar

the numToChar of posInteger  
Value returned: the character whose ASCII equivalent equals posInteger


Examples

the numToChar of 65
numToChar(65)

put charToNum(numToChar(65)) = 65

Demo Script

on nameUpperCase
  ask "Please enter your name:"
  if it is empty then exit nameUpperCase
  answer uppercase(it)
end nameUpperCase
function upperCase whatStr
  repeat with charNum = 1 to the number of chars in whatStr
    put charToNum(char charNum of whatStr) into thisChar
    if thisChar ≥ 97 AND thisChar ≤ 122
    then put numToChar(thisChar - 32) into char charNum of whatStr
  end repeat
  return whatStr
end upperCase

Placeholders

posInteger
An expression that evaluates to a positive integer.

For example:
3
67 mod 13
the number of bg fields
the number of backgrounds
the number of cards div 2
See also: background, bkgnd, button, card, chunk, field, menu, and menuItem

Related Topics

« number | HyperTalk Reference | offset »


Version 0.7b1 (March 24, 2022)

Made with Macintosh

Switch to Modern View

Home
The HyperCard Center
HyperTalk Reference
Home » HyperTalk Reference » Functions

Note: This is a work in progress and will be formatting errors. Read more about the project on the home page.

numToChar

the numToChar of posInteger  
Value returned: the character whose ASCII equivalent equals posInteger


Examples

the numToChar of 65
numToChar(65)

put charToNum(numToChar(65)) = 65

Demo Script

on nameUpperCase
  ask "Please enter your name:"
  if it is empty then exit nameUpperCase
  answer uppercase(it)
end nameUpperCase
function upperCase whatStr
  repeat with charNum = 1 to the number of chars in whatStr
    put charToNum(char charNum of whatStr) into thisChar
    if thisChar ≥ 97 AND thisChar ≤ 122
    then put numToChar(thisChar - 32) into char charNum of whatStr
  end repeat
  return whatStr
end upperCase

Placeholders

posInteger
An expression that evaluates to a positive integer.

For example:
3
67 mod 13
the number of bg fields
the number of backgrounds
the number of cards div 2
See also: background, bkgnd, button, card, chunk, field, menu, and menuItem

Related Topics

« number | HyperTalk Reference | offset »

Version 0.7b1 (March 24, 2022)

Made with Macintosh

Switch to Retro View