This forum is for eXpress++ general support.
-
rdonnay
- Site Admin
- Posts: 4813
- Joined: Wed Jan 27, 2010 6:58 pm
- Location: Boise, Idaho USA
-
Contact:
#1
Post
by rdonnay »
There are 9 new methods in a DC_DbRecord() object
::RecNo()
::Deleted()
::Alias()
::Scatter()
::Gather()
::IsEmpty()
::Trim()
::asArray()
::clear()
Copy _DCFUNCT.PRG to your ..\source\dclipx folder and run BUILD19_SL1.BAT or BUILD20.BAT.
Example:
Code: Select all
USE customer
oRecord := CUSTOMER->(DC_DbRecord():new())
oRecord:scatter()
oRecord:bill_name := 'New Name'
oRecord:gather()
oRecord:clear()
? oRecord:isEmpty()
TRUE
oRecord:Trim()
aData := oRecord:asArray()
? o:RecNo()
123
? o:Deleted()
FALSE
? o:Alias()
CUSTOMER
-
Attachments
-
- _dcfunct.zip
- (44.73 KiB) Downloaded 758 times
The eXpress train is coming - and it has more cars.
-
Wolfgang Ciriack
- Posts: 484
- Joined: Wed Jan 27, 2010 10:25 pm
- Location: Berlin Germany
#2
Post
by Wolfgang Ciriack »
Hi Roger,
very nice. What is the best way to get an empty record object ?
Code: Select all
oRecord := CUSTOMER->(DC_DbRecord():new())
oRecord:scatter()
oRecord:clear()
oRecord:RecNo:=0
Or is there a better way ? Nice would be
for an empty record object.
_______________________
Best Regards
Wolfgang
-
rdonnay
- Site Admin
- Posts: 4813
- Joined: Wed Jan 27, 2010 6:58 pm
- Location: Boise, Idaho USA
-
Contact:
#3
Post
by rdonnay »
What is the best way to get an empty record object ?
oRecord := DC_DbRecord():new():clear()
The eXpress train is coming - and it has more cars.
-
Wolfgang Ciriack
- Posts: 484
- Joined: Wed Jan 27, 2010 10:25 pm
- Location: Berlin Germany
#4
Post
by Wolfgang Ciriack »
Perfect, thank you.
Do you plan to add a ::Save method (if :RecNo=0 append otherwise replace) ?
_______________________
Best Regards
Wolfgang
-
rdonnay
- Site Admin
- Posts: 4813
- Joined: Wed Jan 27, 2010 6:58 pm
- Location: Boise, Idaho USA
-
Contact:
#5
Post
by rdonnay »
Do you plan to add a ::Save method (if :RecNo=0 append otherwise replace) ?
:Gather() will take care of that.
I need to update it to automatically add a new record if ::recno() is empty.
I will give a fix for that.
The eXpress train is coming - and it has more cars.
-
bobvolz
- Posts: 117
- Joined: Sun Jan 31, 2010 11:25 am
#6
Post
by bobvolz »
Hi Roger;
Thanks for the great time in Boise. I got a lot accomplished. The banquet was a lot of fun as well.
I use the following code to create a blank record object. Is this OK?
oRecord:=BDCOPER->(DC_DBRECORD():NEW())
BDCOPER->(DB_INIT(oRecord))
Strangely enough I have this craving for asparagus!
Bob Volz
-
rdonnay
- Site Admin
- Posts: 4813
- Joined: Wed Jan 27, 2010 6:58 pm
- Location: Boise, Idaho USA
-
Contact:
#7
Post
by rdonnay »
I use the following code to create a blank record object. Is this OK?
oRecord:=BDCOPER->(DC_DBRECORD():NEW())
BDCOPER->(DB_INIT(oRecord))
Everything will still work as before.
These new methods only make it easier to use.
DB_INIT() is not an eXpress++ function.
I thinks it's from Bobby's library.
The eXpress train is coming - and it has more cars.
-
bobvolz
- Posts: 117
- Joined: Sun Jan 31, 2010 11:25 am
#8
Post
by bobvolz »
Your probably right, I thought it was xBase Tools. I'll try the clear method next time.
BV