Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Creating an object dynamically

Status
Not open for further replies.

Tentacle

Programmer
Nov 10, 2000
34
ZA
I'm using PB 6.5, and want to create an object or objects in a datawindow at runtime. In other words let's say I want to place 4 round rectangles on a datawindow (I have the x, y, height and width values of each) but they have to be created on the datawindow at run time and is not predefined on the datawindow cause next time I might only want to create 2 round rectangles. How will I go about doing this, if at all possible?!? I've looked at the create function but can't seem to get it to work, and I'm sure there has to be a way to create objects dynamically, instead of using the painters in PB. Thanx for any help in advance.

Tentacle
 
You can do it using the modify method as follows:

Create a string to hold the definition of the dynamic control. Let us say you want it in header band

ls_str = 'Create roundrectangle(band=header x="somthing" y="something" .....)'

dw_control.modify(ls_str)

Just make sure you are not missing out on any key property while defining dynamically.

I hope it helps.

RTewari
 
The DWSyntax utility (shipped with PB -- to ver 6.5 at least)is really useful for modify/describe. Also, you can make a datawindow resembling the one you'll be creating dynamically and then export the object to take a look at the 'create; syntax for it.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top