Hi DAW,
The DataFlex OOP language structure seems, in my opinion, very long-winded and needs to keep up with mainstream language structures if it wants to break into new markets and, more importantly, users.
I’m suggesting a rather small change, that might even be at the FMAC level rather than the compiler, which might give DataFlex a more mainstream feel and also provide the Studio with better code sense and suggestions – in both instances providing better support for new developers.
I suggest removing the need to use the “of/to” keywords to refer to objects, rather using the dot/period character much like how Fields are associated with Tables.
For example:
Current:
Code:
Get Value of oTextField to sValue
Set Enabled_State of oButtonOK to (Length(sValue)=MAGSTRIPE_LEN)
New:
Code:
Get oTextField.Value to sValue
Set oButtonOK.Enabled_State to (Length(sValue)=MAGSTRIPE_LEN)
Currently, If you were to type the following and press Ctrl+Space:
Code:
Set peRequestFindMode of oDBCJGrid to
All available enum values are listed rather than just the valid ones (see image above), that because the Studio does not know which object the property/method/event is for
Changing it to:
Code:
Set oDBCJGrid.peRequestFindMode to
Should in theory provide the studio the ability to:
- Zoom in and display the enum values for this property.
- Better predict the property/method/event at the object level, just by typing "Set oDBCJGrid.pe" should predict peRequestFindMode, the much like how it predicts the field name for tables.
A classic example would be if you type: "Send Find" the studio suggests 3 possible find methods, having the object name in play eliminates the need to guess.
In the DD:
Current:
Code:
Send Clear to DDO_Customer
Repeat
Send Find to DDO_Customer GT 1
If (Found) Begin
Set Field_RememberedValue of DDO_Customer Field Customer.Customer_Number to Customer.Customer_Number
Send Clear // Orderhea
...
End
Until (not(Found))
New:
Code:
Send DDO_Customer.Clear
Repeat
Send DDO_Customer.Find GT 1
If (Found) Begin
Set DDO_Customer.Field_RememberedValue Field Customer.Customer_Number to Customer.Customer_Number
Send Self.Clear // Or just Clear
...
End
Until (not(Found))
If the above is possible, why not take it to the next level, introduce a WITH command:
Code:
With DDO_Customer
Set Field_Changed_Value Field Customer.Name to "Hello World"
...
Set Field_Changed_Value Field Customer.Remarks to "Hello World Remark"
Send Request_Save
End
The logic of the WITH would be rather be simple, just delegate all sends/gets/sets to the object defined in the WITH command.