Release objects using macro

Topic Specific Tutorials and Tips.

Moderator: Rathinagiri

Post Reply
raymanw
Posts: 25
Joined: Tue Mar 08, 2011 1:16 am

Release objects using macro

Post by raymanw »

Hi all,

I can create objects using macro substituion:
@ nRow, 140 LABEL &cGLabel ;

I tried release them using the same but failed. How should I do it?
cGLabel := 'Main.Label_'+AllTrim(Str(nI),1)+'.Release'
&cGLabel

Thanks.
User avatar
gfilatov
Posts: 1067
Joined: Fri Aug 01, 2008 5:42 am
Location: Ukraine
Contact:

Re: Release objects using macro

Post by gfilatov »

raymanw wrote:Hi all,

I can create objects using macro substituion:
@ nRow, 140 LABEL &cGLabel ;

I tried release them using the same but failed. How should I do it?
cGLabel := 'Main.Label_'+AllTrim(Str(nI),1)+'.Release'
&cGLabel
Hi,

Try
cForm := "Main"
cGLabel := "Label_"+AllTrim(Str(nI),1)

DoMethod(cForm, cGLabel, "Release")

Hope that helps :idea:
Kind Regards,
Grigory Filatov

"Everything should be made as simple as possible, but no simpler." Albert Einstein
User avatar
Rathinagiri
Posts: 5471
Joined: Tue Jul 29, 2008 6:30 pm
DBs Used: MariaDB, SQLite, SQLCipher and MySQL
Location: Sivakasi, India
Contact:

Re: Release objects using macro

Post by Rathinagiri »

Thanks Grigory.
East or West HMG is the Best.
South or North HMG is worth.
...the possibilities are endless.
raymanw
Posts: 25
Joined: Tue Mar 08, 2011 1:16 am

Re: Release objects using macro

Post by raymanw »

Hi gfilatov

It worked. Thanks.
raymanw
Posts: 25
Joined: Tue Mar 08, 2011 1:16 am

Re: Release objects using macro

Post by raymanw »

Hi,

How can I use the same to enable/disable an object?

Thanks.
User avatar
mol
Posts: 3720
Joined: Thu Sep 11, 2008 5:31 am
Location: Myszków, Poland
Contact:

Re: Release objects using macro

Post by mol »

I think, you can use Visible property:
SetProperty(cWindowName, cControlName, "VISIBLE", .f.)
raymanw
Posts: 25
Joined: Tue Mar 08, 2011 1:16 am

Re: Release objects using macro

Post by raymanw »

Hi mol,

Thanks for the solution.
Post Reply