Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Missing Feature In VFP 7.0?
Message
From
06/09/2002 14:36:04
 
 
To
06/09/2002 14:21:04
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00697186
Message ID:
00697688
Views:
17
Different error message. _VFP doesn't have a 'forms' property.

Alan

>Does it work any differently if you use the _VFP object in lieu of _SCREEN?
>
>good luck
>
>
>>>>In VFP 6.0 SP5 (or SP3?) the following code worked:
>>>>
>>>>MODI FORM (myform) NOWAIT
>>>>
>>>>FOR ln = 1 TO _screen.FormCount
>>>> IF _screen.Forms(ln).Name = "form1"
>>>> lo = _screen.Forms(ln)
>>>> EXIT
>>>> ENDIF
>>>>ENDFOR
>>>>lo.Caption = "I can change the form's caption in developer mode!"
>>>>
>>>>I could run this code from within an APP, EXE or PRG and use it to modify the form in design mode. But in VFP 7.0 the form being modified is not shown in the _screen.Forms collection.
>>>>
>>>>Was this an undocumented feature that was taken out of VFP 7.0? Will it be in VFP 8.0? I was able to create several form builders using this technique and they have saved me hours.
>>>>
>>>>What happened to one of my favorite features of VFP?
>>>
>>>The Forms collection is 0-indexed, so that you should say either:
>>>
>>>
FOR ln = 0 to _Screen.FormCount-1
>>>
>>>or
>>>
>>>
FOR EACH lo OF _Screen.Forms
>>>
>>>and then check to make sure that you actually found a hit - the error you encounter occurs when you step beyond the domain of Items indexed in the Forms collection. The memvar lo is not an object if no hit occurs in the FOR loop.
>>
>>
>>I have VFP 6.0 SP5 and VFP 7.0 (no SP).
>>
>>When I open a form in design mode and enter into the command window:
>>
>>wait window _screen.forms[1].name
>>
>>In VFP 6.0 I get the name of the form "frmMyForm".
>>
>>In VFP 7.0 I get the error "FORMS is not an object".
>>
>>I tried this using a subscript of 0 and 1 in both versions.
>>
>>Subscript 0 returned "Subscript out of bounds" in both versions.
>>
>>As far as I can tell Microsoft added this ability in 6.0 SP3 or SP5, it does not work in my original 6.0 version. And it stopped working in 7.0. I also tested it on a friend's computer with 7.0 SP1 and it did not work on his computer either.
>>
>>Thanks for the help. Let me know if you have any other ideas.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform