固定字符串使用的内存会比整数少吗?
Public Type MyType
UserID As Integer 'All My User IDs are less than 7 integers in length
UserID As String * 7 ''Will a Fixed String use less memory than an Integer?
End Type
有没有办法在 VBA 过程中进行测试?
最佳答案
字符串将使用更多内存
整数(根据示例应为 Long)为 4 个字节,字符串至少为 8 个字节。
--根据评论进行编辑
关于string - 固定字符串 * 7 会比 =Len(7) 的整数使用更少的内存吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47086511/