* Function: Abreviate * * Assumes: table called Abrev with columns: long, short * * Example: update tablename set tablename.fieldname = * abreviate(tablename.fieldname) function abreviate (tcInputString) local lcWorkString, lcWord, lcResultString, i, lcSetAnsi, ; lnSetMemoWidth local array laResults[1] lcWorkString = strtran(tcInputString, " ", chr(13)) lcResultString = "" * The number of lines in a memo field is determined by the current value of SET MEMOWIDTH. lnSetMemoWidth = set("MemoWidth") set MemoWidth to 80 lcSetAnsi = set("ANSI") set ANSI on for i = 1 to memlines(lcWorkString) lcWord = mline(lcWorkString, i) select Abrev.Short ; from Abrev ; where Abrev.Long = lcWord ; into array laResults if _tally > 0 lcResultString = lcResultString + laResults[1] + " " else lcResultString = lcResultString + lcWord + " " endif endfor set ANSI &lcSetAnsi set MemoWidth to lnSetMemoWidth return lcResultString