Posted: Sun Aug 24, 2014 4:50 pm Post subject: Compiler issues. ___STRBUF
I have some weird issues going on in my program, and I think I have applicable frame/stack sizes.
So i decided to check the report and I have some weird things.
I have a ton of these:
Source string could be too big to fit into target string [SCRATCH2>___STRBUF] in line 2916
Source string could be too big to fit into target string [SCRATCH1>___STRBUF] in line 2925
Source string could be too big to fit into target string [SCRATCH1>___STRBUF] in line 2972
Source string could be too big to fit into target string [SCRATCH1>___STRBUF] in line 2976
Source string could be too big to fit into target string [SCRATCH1>___STRBUF] in line 2982
Source string could be too big to fit into target string [SCRATCH1>___STRBUF] in line 2985
Source string could be too big to fit into target string [SCRATCH1>___STRBUF] in line 3047
Source string could be too big to fit into target string [SCRATCH1>___STRBUF] in line 3054
Source string could be too big to fit into target string [SCRATCH1>___STRBUF] in line 3179
Source string could be too big to fit into target string [SCRATCH1>___STRBUF] in line 3203
Source string could be too big to fit into target string [SCRATCH1>___STRBUF] in line 3208
Source string could be too big to fit into target string [SCRATCH1>___STRBUF] in line 3211
Well all these lines correspond to this:
Scratch2 = Format(scratch2 , "00") -- 2916
Scratch1 = Format(scratch1 , "00") -- 2925
and on and on it goes.
Any reason why? my "scratch" variables are Strings at * 5 : Dim Scratch1 As String * 5
It's a warning not an error.
The problem is that you have the string variable scratch1 you do something with it and put it back in the same variable.
The risk could be that if you fill the variable scratch1 with is max length (5), do something with it can overflow. That's why the compiler warns you. The compiler can't know what you are gone do during runtime with the variable and can't therefore throw an error, only a warning.
Increasing the size of your scratch variable doesn't help because you use the same variable for in and output of the format function.
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You cannot download files in this forum