General information
Category:
Forms & Form designer
Rip,
You should really avoid the use of _tally in this way anyway as it is a global var. For example a timer may fire and _tally will hold a different value to the result of your select statement. Much better to test the type and length of your array.
Mace
>I have a button within a pageframe that has a lot of code in it's click method. Including some rather lengthy select statments. The problem is when I try to trace through the code the debugger will only go so far then it will stop tracing. Every time I hit F8 in the debugger it continues to execute the next line it just won't show what line it's executing. This makes it really hard to debug.
>
>Another problem that I faced in this same code, perhaps related to the above I don't know, is this:
>
>I have a simple select statement towards the end of all this code that looks like this:
>
>Sele myfield ;
> from mytable ;
> into array laMyArray
>
>if _tally > 0
> do something
>endif
>
>VFP didn't seem to be filling the _tally variable correctly at this point. Although the select statement selected 0 records the _tally variable seemed to hold the value from the select statement above this one. Finally I added this to the line:
>
>if _tally>0 and type('laMyArray')='C'
>
>This fixed my problem but it was sure a pain to find.
>
>Any ideas why this happens? It sure sounds like a bug to me.
>
>FYI I tried everything I could to get VFP to recreate the object code in the scx. Because I thought the problem had to be that the object code wasn't getting refreshed. I'm pretty certain that wasn't the case.
Previous
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only