xbrowse - data nDataType

xbrowse - data nDataType

Postby nageswaragunupudi » Sun Dec 30, 2007 8:58 pm

In the constructor method ( New ) of xbrowse, nDataType is assigned a value of DATATYPE_RDD. Even the methods SetArray or SetADO do not change the nDataType. Therefore the nDataType always remains to be DATATYPE_RDD.

The Initiate method of xBrowse executes SetRDD, because nDataType is DATATYPE_RDD, though SetArray or SetADO is already used. Execution of SetRDD in such cases is not necessary and seems logically not so appropriate, though SetRDD does not disturb the existing assignments of codeblocks. The relevant part of the Initiate method is given below
Code: Select all  Expand view  RUN
   do case
   case ::nDataType == DATATYPE_RDD
      ::SetRDD()
   otherwise
      MsgStop("Data type not supported", "TXBrowse class")
   end case

I may be wrong, but it is possible that this was the code written in the initial stages of development before methods like SetArray / SetAdo were incorporated. Programmers can use xBrowse even for other data sources like TData / TDatabase or any data source for that matter.

Keeping this in view, it is suggested for consideration that the above lines in the initiate method may be changed as :
Code: Select all  Expand view  RUN
   if ::nDataType == DATATYPE_RDD
      ::SetRDD()
   endif

The defines for DATATYPE_RDD and DATATYPE_ARRAY already exist in the xbrowse.prg.
New defines :
#define DATATYPE_ADO 2
#define DATATYPE_USER 9
can be added and SetArray can assign ::nDataType := DATAYPE_ARRAY and SetAdo can assign ::nDataType := DATATYPE_ADO.

This will also help the application program to retrieve the value of ::nDataType for meaningful use as may be appropriate.
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10643
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Postby Biel EA6DD » Mon Dec 31, 2007 9:17 am

Hi NageswaraRao,thanks for the great job you are doing in the Class tXbrowse.

About the DATA nDataType, personally I find not mutch usefull, but you have reason, the methods SetArray and SetAdo must initialize it.
Personally, I thing the SetRdd is not necesarty to be called in the method Inititate, we usually (me allways) call the SetRDD,SetAdo or SetArray, before calling the CreateFrom... method.

Any way
Code: Select all  Expand view  RUN
if ::nDataType == DATATYPE_RDD
      ::SetRDD()
   endif

is more correct than the current.
Saludos desde Mallorca
Biel Maimó
http://bielsys.blogspot.com/
User avatar
Biel EA6DD
 
Posts: 682
Joined: Tue Feb 14, 2006 9:48 am
Location: Mallorca


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 60 guests