Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Error:1924 FORMS is not an object.
Message
 
To
12/04/1998 13:38:44
Dragan Nedeljkovich (Online)
Now officially retired
Zrenjanin, Serbia
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00090869
Message ID:
00091520
Views:
26
>>>The for loop initial value is only evaluated first time into the loop, and you have to decrement through it because the forms array collapses itself down as forms go away. The loop counter was 2 in the post mortem dump that got delivered in my morning email.
>>>
>>>Sometimes I'll get stupid errors like Columns is not an object in a builder that's working on a currently instantiated grid, cancel and run it again and it works just fine. Ah VFP you gotta love it. *g*
>>>
>>I'm aware of the .FormCount collapsing on itself. That's why I don't like it in the FOR...ENDFOR structure. IMHO, the values in that type of iteration structure should never be subject to internal or external modification. I'd just do something like this:
>>i = _SCREEN.FormCount
>>DO WHILE i # 0
>> IF (_SCREEN.Forms[i].QueryUnload())
>> _SCREEN.Forms[i].Release()
>> i = i - 1
>> ELSE
>> _SCREEN.Forms[i].Activate()
>> ENDIF
>>ENDDO
>>That way at least you know nothing funny is going on there.
>
>Something else may be the issue, just if... well, if some of the forms is instantiated from another form, and the parent form gets released first - then the child form should vanish automatically, _screen.formcount should decrease by two. In David's example, the loop counter was two, and maybe there was only one form left. Let's try this:
>
>
>DO WHILE _SCREEN.FormCount # 0
> i=_SCREEN.FormCount
> IF (_SCREEN.Forms[i].QueryUnload())
> _SCREEN.Forms[i].Release()
> ELSE
> _SCREEN.Forms[i].Activate()
> ENDIF
>ENDDO
>
>Just a hunch. I have no time to test this.

Actually, Dragan, I like your approach better than mine. I must admit, however, that I don't use modeless child forms (modal dialogs, yes, but that wouldn't be a problem here.).
George

Ubi caritas et amor, deus ibi est
Previous
Reply
Map
View

Click here to load this message in the networking platform