对于要实现实时的自动换行则需如下脚本:
event editChanged;
/***************************************************************************
解决自动换行时,新行不能实时显示的问题。
通过加上多个条件限制,使得 acceptText() 对有效性验证的影响最小
***************************************************************************/
try
    if Object.DataWindow.Detail.Height.AutoSize = "yes" &
    and dwo.type = "column" &
    and dwo.Edit.AutoVScroll = "yes" &
    and left(dwo.coltype, 4) = "char" then
        acceptText()
    end if
catch (runtimeError err)
end try
---------------------------
throws:exception(throwable)
exception ex
ex = Create exception
ex.setMessage("错误信息.")
--------------------------
在PB8以后增加了Throwable类,子类分为exception和runtimeerror,PB本身的错误会抛出对应的异常,同时也可以使用Throw方法来手工抛出异常,我觉得异常和以往的返回值判断进行联合应用能使程序稳定性和可读性更好

 

相关文章:

  • 2021-06-12
  • 2021-11-13
  • 2021-04-25
  • 2021-09-01
  • 2021-12-12
猜你喜欢
  • 2021-11-15
  • 2022-02-13
  • 2022-12-23
  • 2021-06-13
  • 2022-12-23
  • 2021-06-18
  • 2021-04-05
相关资源
相似解决方案