Can you use a field named End with Class TDataBase ? yes!

Re: Can you use a field named End with Class TDataBase ? yes!

Postby wartiaga » Tue Feb 22, 2022 12:03 am

James Bott wrote:
Thanks for the explanation. I called it an "error" because in older versions of fivewin this problem doesn't occur. What changed in database.prg for this to happen?


Actually, it was a change that I suggested. Prior to that, all of FW's objects could be "destroyed" by calling the End() method--except the TDatabase class which used a Close() method, which is the old DBase command to close a file. However, when using objects it helps to use the same method names for similar processes, thus changing the method Close() to End() made data objects consistent with all the other types of objects--just like the New() method is used to create all new objects.

Thus it is not a good idea to try to use any method name as a fieldname in your code.


Thank you James! I changed all dbfs fields END to ENDE
wartiaga
 
Posts: 212
Joined: Wed May 25, 2016 1:04 am

Previous

Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot] and 87 guests