Add a function of judging the existence of memory variables

zhaozj2021-02-16  51

The author has written a function exist () that determines the memory variable in the development application system, which is very convenient and practical, introduced to everyone here. Design Idea: First assume that the memory variable exists, then assign a time to be judged to a temporary variable. If the memory variable does not exist, it will be wrong when the memory variable does not exist. When the error will be wrong, the ON Error statement will be executed, as long as in ON Error Processing The flag is modified in the function or not. In order not to affect the error handling of the calling program, the versatility of the function must be saved and restored before and after the function execution. The source program is as follows: *** EXISTPRG *** Para memovari private mexist, temp, olderror mexist = .t.  Assume that the memory variable exists in OldError = on ('error') Save the calling program error handling on Error Do Errhandle Temp = Memovari On Error Olderror Recovery Call Processing Retu Mexist Returns the presence flag proc errhandle mexist = .f. Error set the standard for .f.

转载请注明原文地址:https://www.9cbs.com/read-24942.html

New Post(0)