如何使用实时代码提供额外的 space

How to give extra space using live code

我有一个滚动字段。它包含一些文本和特殊字符,例如 (---,'',.,",) e.t.c。我想在每个特殊 characters.Is 之前添加一个 space 可能

我不知道你的文字有多长,但你可以:

  on mouseUp
get fld "yourField"
put "abcdefghijklmnopqrstuvwxyz" into normalChars
repeat for each char tChar in it
  if tChar is not in normalChars then put space & tChar after temp
  else put tChar after temp
end repeat
put temp into fld "yourOtherField"
end mouseUp

现在假设所有非字母字符都是 "special" 个字符。您可以修改处理程序以采用其他方式吗?也就是说,只识别某些字符,而不是识别所有非字母字符?

克雷格纽曼

是的。请使用此代码

replace "--" with " --" in field "yourField"
replace "---" with " ---" in field "yourField"