-
Apr 15th, 2017, 04:25 PM
#1
Thread Starter
Frenzied Member
-
Apr 15th, 2017, 05:00 PM
#2
Re: How is this possible? (array copy fails)
Do you have an "On Error Resume Next" in this part of your code?
-
Apr 15th, 2017, 05:22 PM
#3
Re: How is this possible? (array copy fails)
And can you show us how those two variables are declared? I'm guessing both as the same UDT structure, but better to ask as maybe one is variant? Maybe show us the UDT structure also.
-
Apr 15th, 2017, 05:55 PM
#4
Thread Starter
Frenzied Member
Re: How is this possible? (array copy fails)
Originally Posted by Arnoutdv
Do you have an "On Error Resume Next" in this part of your code?
I have an On Error goto [end of sub] with msgbox + erl, which shows a 'Object Variable or With block variable not set'
Originally Posted by LaVolpe
And can you show us how those two variables are declared? I'm guessing both as the same UDT structure, but better to ask as maybe one is variant? Maybe show us the UDT structure also.
No variants. Both are the same UDT. The idea was to avoid duplicating the same code twice, so I want to use a tmpData to take over.
I must admit, the UDT is a lil complex, but this works %90 of the time. Only on certain occasions 'which I'm yet to trace', does this happen.
_____________________________________________________________________
----If this post has helped you. Please take time to Rate it.
----If you've solved your problem, then please mark it as RESOLVED from Thread Tools.
-
Apr 15th, 2017, 05:57 PM
#5
Re: How is this possible? (array copy fails)
I'll bet this is a VB6 bug I found a while back. When copying UDT arrays, it'll perform the copy even when the two UDTs aren't declared the same. And then, you can get into big trouble, possibly writing into memory areas you shouldn't be writing into.
If the two UDT arrays are declared the same, then it's something different.
I'll try and find the original thread and then come back and edit this post. Here it is, the original thread where this bug was documented.
EDIT: some1uk03, you were posting when I was, but be sure to stare hard at the declaration of tmpData, dB, and db_Merge, making sure they're definitely declared with the same UDT Type declaration. The compiler (nor the IDE in p-code) won't catch it if they're not.
Last edited by Elroy; Apr 15th, 2017 at 06:04 PM.
Any software I post in these forums written by me is provided "AS IS" without warranty of any kind, expressed or implied, and permission is hereby granted, free of charge and without restriction, to any person obtaining a copy. To all, peace and happiness.
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|