string cleaning

Alex Rice alex at
Mon Nov 10 19:47:20 EST 2003

Does this look safe for Windows and Mac funny characters? Those will 
always be > 126 ascii decimal correct?

function isPrint pChar
   set the useUnicode to false
   get charToNum(pChar)
   if (it < 32) or (it > 126) then return false
   return true
end isPrint

function printableCharString pString
  local tRes, c
  repeat for each character c in pString
    if isPrint(c) then put c after tRes
  end repeat
  return tRes
end printableCharString

Alex Rice <alex at> | Mindlube Software | 

what a waste of thumbs that are opposable
to make machines that are disposable  -Ani DiFranco

More information about the Use-livecode mailing list