首页 > 解决方案 > How the undo option works on a VBS macro?

问题描述

Is it possible to explain how to use on a VBscript macro the DiscardUndo Property option? An example would be great.

EmEditor Help - DiscardUndo Property

Because I don't understand why there are two options for VBscript:

b = DiscardUndo

and

DiscardUndo = b

Does it mean that the replace code goes between them? Or what?

标签: vbscript

解决方案


您在这里谈论的是变量赋值,这是大多数编程语言中的基本概念。

在此示例中,该属性DiscardUndo包含一个标志,该标志确定是否应存储或丢弃撤消信息以提高性能。我不熟悉这个特定的库,但由于它是一个简单的开/关,我想该标志是一个布尔值(TrueFalse)。

将此属性值分配给您将使用的变量;

Dim IsUndoDiscarded
IsUndoDiscarded = DiscardUndo 'Retrieve the value of DiscardUndo (either True or False)

要为此属性分配一个值,您将使用;

DiscardUndo = True 'Discard undo information

或者;

DiscardUndo = False 'Keep undo information

推荐阅读