在我向VBA集合添加一些值之后,有没有办法保留所有键的列表?
例如
Dim coll as new Collection
Dim str1, str2, str3
str1="first string"
str2="second string"
str3="third string"
coll.add str1, "first key"
coll.add str2, "second key"
coll.add str3, "third key"
Run Code Online (Sandbox Code Playgroud)
我知道如何保留字符串列表:
first string
second string
third string
Run Code Online (Sandbox Code Playgroud)
再一次:有没有办法保留钥匙?
first key
second key
third key
Run Code Online (Sandbox Code Playgroud)
注意:我正在通过AutoCAD 2007使用VBA
你好.假设您有32位处理器.8位char
和16位short int
类型比原生32位慢int
吗?那么使用64位long long int
呢?
默认情况下硬件是否支持此数据类型,或者通过使用其他指令将它们全部转换为32位数据?
如果我必须存储少量的字符,将它们存储为整数是不是更快?
我知道,每个人都讨厌GOTO,没有人推荐它.但那不是重点.我只想知道,哪个代码最快:
该goto
环
int i=3;
loop:
printf("something");
if(--i) goto loop;
Run Code Online (Sandbox Code Playgroud)该while
环
int i=3;
while(i--) {
printf("something");
}
Run Code Online (Sandbox Code Playgroud)该for
环
for(int i=3; i; i--) {
printf("something");
}
Run Code Online (Sandbox Code Playgroud)我的代码有问题.
#include <iostream>
#include <stdexcept>
class MyException : public std::logic_error {
};
void myFunction1() throw (MyException) {
throw MyException("fatal error");
};
void myFunction2() throw (std::logic_error) {
throw std::logic_error("fatal error");
};
int main() {
try {
myFunction1();
//myFunction2();
}catch (std::exception &e) {
std::cout << "Error.\n"
<< "Type: " << typeid(e).name() << "\n"
<< "Message: " << e.what() << std::endl;
}
return 0;
}
Run Code Online (Sandbox Code Playgroud)
throw MyException("fatal error");
线不起作用.Microsoft Visual Studio 2012说:
error C2440: '<function-style-cast>' : cannot convert from 'const char [12]' to …
Run Code Online (Sandbox Code Playgroud) 我正在Autocad中开发一些VBA宏.内置编辑器已经过时,但我无法找到更好的方法来编辑.dvb
文件.
一个.dvb
文件包含许多其他源文件,到目前为止我认为Autocad是唯一可以解压缩它们的软件...
它似乎能够做到这一点的唯一方法是从.dvb
手动导出每个文件; 但由于我在那里有大约30个文件,所以看起来这不是一个很好的做事方式.
关于如何做得更好的任何想法?
c ×2
c++ ×2
vba ×2
autocad ×1
collections ×1
constructor ×1
editor ×1
exception ×1
goto ×1
inheritance ×1
loops ×1
oop ×1
performance ×1
processor ×1