Before anyone says it, I know this isn t the way it should be done, but it s the way it was done and I m trying to support it without rewriting it all.
I can assure you this isn t the worst bit by far.
The problem occurs when the application reads an entire file into a string variable. Normally this work OK because the files are small, but one user created a file of 107MB and that falls over.
intFreeFile = FreeFile
Open strFilename For Binary Access Read As intFreeFile
ReadFile = String(LOF(intFreeFile), " ")
Get intFreeFile, , ReadFile
Close intFreeFile
现在,它不会倒在绳子上
ReadFile = String(LOF(intFreeFile), " ")
但在
Get intFreeFile, , ReadFile
那么,这里发生了什么,String肯定已经完成了内存分配,那么为什么它会抱怨Get上的内存不足呢?