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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Difference between destroy and destroy() 2

Status
Not open for further replies.

elnbado

Programmer
Oct 31, 2005
3
NL
I fairly new to Powerbuilder and I came across the following.
Whenever I create an object in a constructor, I destroy this in the destructor (or in beforeClose or whatever).
The point is: I occasionally used the reserved keyword destroy:
destroy myObject

On another occasion I used:
destroy (myObject)

When I noticed this I tried to find out what the difference bewteen the two of them is. No luck though.
Does anyone know the difference?

My guess: use destroy for non-visual objects and destroy() for visual objects or the other way around. But why??

Thanks in advance.
 
I'd say there is no difference between the two. Perhaps in some long ago version you needed the parenthesis and that syntax was preserved as newer versions came out.

Most datawindow methods can be scripted similar to:

dw.setitem(row,column,value) or setitem(dw,row,column,value)

but you don't see references to the second syntax in the help file.

Matt

"Nature forges everything on the anvil of time
 
Yup,

As mbalent says there is no difference between the two in fact there are not two things here at all.

Remember you can put brackects around any exprssion you want,

so you cold say
messageBox( ls_heading, ls_text)
or
messageBox( (ls_heading), (ls_text))

these are NOT two different forms they are the same.

Or, at the end of a function you could say:

return li_ret
or
return (li_ret)

this does not mean that there is a return amd return () that are two different things, there is only a return statement that may or may not be followed by an expression.

Basically all objects are much the same. The only difference between a visual object and a non-visual object is that the first one has a visual aspect as well as code. They do not have different functions for similar (or the same) operations.


Bill
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top