I've been having the most frustrating and headbanging fight today with DBP v1.074: it's been 'forgetting' variables.
It seems to have happened since my project got larger than 3500 lines. Take the code below:
function rmi_TurnVarNameIntoCode(VarName$ as string)
iTheVarNumber as integer
select VarName$
case "triggerdata1": iTheVarNumber = 1 : endcase
case "triggerdata2": iTheVarNumber = 2 : endcase
case "triggerdata3": iTheVarNumber = 3 : endcase
case "triggerdata4": iTheVarNumber = 4 : endcase
case "cmdreturn" : iTheVarNumber = 5 : endcase
case "cmdpass" : iTheVarNumber = 6 : endcase
<...etc...>
endselect
print VarName$
print iTheVarNumber
endfunction iTheVarNumber
Pretty simple, and worked OK. Until today, that is. Passing "cmdpass" and "cmdreturn" both give the result '6'. How can that be? I tried replacing the select..case statements with if..thens but this had the same effect.
Also, when the main prog called this function, and tried to do something with the result...
CommandList(iProgLineNo-1).IntParm2 = rmi_TurnVarNameIntoCode(Cmd$)
if (CommandList(iProgLineNo-1).IntParm2 = 0)
error$ = "Unknown variable in parameter x"
endif
...the IntParm2 var would reset to zero at the IF statement! (it wasn't zero before the IF - I printed it!)
I'm quite an old hand at this programming lark; I know what I'm doing; and to me there seems to be some sort of corruption going on behind the scenes.
I am jumping up and down with frustration while typing this
Aargh!
Does anyone have any advice on how to combat this problem? Is it a known issue? (I've searched the bug forum)... Eee, I dunno.
Thanks
James