Functions.VarPut 方法 |
命名空间: XSharp.RT
[NeedsAccessToLocalsAttribute(TRUE)] FUNCTION VarPut( cVarName AS STRING, uValue AS USUAL ) AS USUAL
[NeedsAccessToLocalsAttribute(true)] public static __Usual VarPut( string cVarName, __Usual uValue )
提示: |
---|
动态内存变量(PUBLIC、PRIVATE、PARAMETERS)仅在 X# 语言和运行时中用于兼容性。 在大多数情况下,类型可以和应该被替换为词法作用域变量,如 LOCAL 和 GLOBAL。 |
1LOCAL cFieldName 2cFieldName := "Address" 3VarPut(cFieldName, "Hollywood, Room 222")
1LOCAL cHasName 2cHasName := "cPrivate" 3// 使用以下代码替代 &cHasName := "new": 4VarPut(cHasName, "new") 5? cPrivate // new
1VarPut("cVar", "hi") 2? _MEMVAR->cVar // hi