Object properties tutorial

tsdt

Active Member
Licensed User
Hi all,

I was searching high and low in this forum and the tutorial about the properties of an object.

I think I got confused with B4PObject(), and adding an object through Tools>Add Objects.

I also noticed that if I instantiate an object, I have to call the constructor New1(). Then, there is another one called CreateNew(). What does this actually do?? On top of that, there are object GetProperty(),SetProperty(),RunMethod() and a whole lot containing in the object container, which I cannot find any tutorial explaining how to use them.

Can any of the expert in B4PPC guide me on this? I am really interested in finding out all of these things.

Thanks.

:sign0089:
 

agraham

Expert
Licensed User
Longtime User
I presume that you are referring to a Door library Object. Those methods are used to access the underlying .NET methods and properties of a .NET object. Basic4ppc intrinsic objects, Textbox, Label etc. are inherited from .NET objects and using the Door library you can access the underlying .NET functionality of those objects which is not exposed within Basic4ppc. Similarly, but slightly differently, Basic4ppc libraries usually incorporate an underlying .NET object which is usually made available for use if required by a Value or ControlRef property.

Google for a primer on .NET Windows Forms programming as this will give you an idea of what it is all about.
 

tsdt

Active Member
Licensed User
Hi Agraham,

I think I can understand the .NET window forms, but, when I was looking at one of the sample code, written in B4PPC. I was a bit confused.

Sub App_Start
process.New1(False) --> initialize the process which is an object
' This is to create an instant of the object called "System.Diagnostics.Process...."
process.CreateNew("System.Diagnostics.Process" & process.System_NS)
' This is another object
StartInfo.New1(False)
StartInfo.Value = process.GetProperty("StartInfo") ---> ????? What is this doing??

....
End Sub

Sub ShellAndWait(File, Arguments)
' I pressume this is to set up a new property for the object "StartInfo"
StartInfo.SetProperty("FileName", File)
StartInfo.SetProperty("Arguments", Arguments)

' Q1) Where are these commands of execution defined??
' Q2) Why is it calling the object process instead of the object StartInfo?
' Q3) How can this "Start" manage to invoke the FileName property of StartInfo as well as the Arguments property??
process.RunMethod("Start")
process.RunMethod("WaitForExit")
process.RunMethod("Close")
End Sub

Hopefully, you can analyse this and I will be able to understand better.
 
Last edited:
Top