Fandom

武装突袭 Wiki

Config File

简体 | 繁體

4,827个页面创建
于此维基上
添加新页面
评论0 Share

您使用了广告屏蔽软件!


Wikia通过广告运营为用户提供免费的服务。我们对用户通过嵌入广告屏蔽软件访问网站进行了使用调整。

如果您使用了广告屏蔽软件,将无法使用我们的服务。请您移除广告屏蔽软件,以确保页面正常加载。

Description: A handle that is used in VBS1 to communicate with config files. The handle can represent either the whole config file (which can be saved or loaded into a disc file), or one class within it.


Saving to a file编辑

; get handle to new file
_file = newconfig

; write a value to the file
_file addvalue ["MyValue",2]

; write a class to the file
_class = _file addclass "MyClass"

; write a value to the class
_class addvalue ["AnotherValue",4]

; save the file
_file saveconfig "MyFile.txt"

The above code would create [vbs user directory]\users\[username]\config\MyFile.txt, and MyFile.txt would contain:

MyValue=2.000000;
class MyClass
{
   AnotherValue=4.000000;
};

Reading a file编辑

; get handle to existing file
_file = loadconfig "MyFile.txt"

; read a value
_myvalue = _file getvalue "MyValue" 

; open a class
_class = _file openclass "MyClass"

; read a value in the class
_anothervalue = _class getvalue "AnotherValue"

更多维基

随机维基