Do you find this script useful?
Yes
No
Comments?
JScript
This script can be used to edit a text line that has been put/copied into a field and, as you save the record, insert an Entry Mark instead of “comma”, “semicolon”, "carriage return" or “line feed” in for example a KeyWord list. Could be altered/developed for other purposes.
Script Language: JavaScript For use with:
DB/TextWorks
// Use replace options to edit text boxes with unwanted text/appereance:
// replace(/; /g, "\u001F") replaces semicolon + space to Entry Mark Separator
// replace(/\, /g,"\u001F") replaces comma + space to Entry Mark Separator
// replace(/\r/g,"\u001F") replaces Line Feed (LF) to Entry Mark Separator
// to replace different signs at the same time put an paranthesis around the sign(s) you want to replace
// In the following jscript, semicolon + space, comma + space, semicolon, comma, carriage return and line feed are replaced with an Entry Mark Separator.

function onRecordSave()
{
  var KW1 = Form.boxes("KW").content;
  var KW2 = KW1.replace(/(; )|(\, )|(;)|(,)|(\r)|(\n)/g,"\u001F");
  Form.boxes("KW").content = KW2;
}
Notes:
Submitted by Nils-Erik Engström on 8/21/2007

Powered by DB/Text WebPublisher, from Inmagic WebPublisher PRO