Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
RemoveObject
Message
 
To
01/12/2017 12:50:31
General information
Forum:
Visual FoxPro
Category:
Classes - VCX
Title:
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows 10
Miscellaneous
Thread ID:
01655998
Message ID:
01656005
Views:
81
Yousfi,

Try run next code:
LOCAL ARRAY m.laTest(2)

m.laTest(1)="A"
m.laTest(2)="B"

?m.laTest(1), m.laTest(2)
=ADEL(m.laTest,1)
?m.laTest(1), m.laTest(2)



LOCAL m.loContainer
m.loContainer=CREATEOBJECT("container")
m.loContainer.AddObject("custom1","custom")
m.loContainer.AddObject("custom2","custom")

?m.loContainer.Controls(1).Name, m.loContainer.Controls(2).Name, m.loContainer.ControlCount
m.loContainer.RemoveObject("custom1")
?m.loContainer.Controls(1).Name, m.loContainer.ControlCount
MartinaJ

>Thank you Martina
>there is a small typo in your code
>
>with thisform
>For m.lii=.ControlCount TO 1 STEP -1
>     m.loObj=.Controls(m.lii)
>    =IIf(Lower(loObj.Class)=="ycnt",.RemoveObject(loObj.Name),.T.)
>Next
>endwith
>
>
>When use the [for i=1 to .controlcount]......i put a structure try/catch/endtry for avoiding error (there is always error) !
>you used [for i=.controlcount to 1 step -1] maybe have a real signification ? Is vfp stores containers by the last created ? there is a memory lost when using the other syntaxes?
"Navision is evil that needs to be erazed... to the ground"

Jabber: gorila@dione.zcu.cz
Jabber? Jabbim
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform