Jump to content

Rebol Programming/ascii?

From Wikibooks, open books for an open world

USAGE:

[edit | edit source]
ASCII? value 

DESCRIPTION:

[edit | edit source]

Returns TRUE if value or string is in ASCII character range (below 128).

ASCII? is a function value.

ARGUMENTS

[edit | edit source]
  • value -- (Type: string file email url tag issue char integer)

SOURCE CODE

[edit | edit source]
ascii?: func [
    {Returns TRUE if value or string is in ASCII character range (below 128).} 
    value [string! file! email! url! tag! issue! char! integer!] /local 
    ascii
][
    ascii: make bitset! #{
FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00000000000000000000000000000000
} 
    either any-string? value [parse/all/case value [any ascii]] [value < 128]
]