I need help with a decision on whether to throw an error or not. Please see
discussion below.

 

2009-12-01 01:37 UTC-0800 Brian Hays <bhays/at/abacuslaw.com>

  * contrib\rdd_ads\ads1.c

    + Added support for ordDescend's 3rd arg to dynamically change

      the index direction between ascending / descending.

      ONLY supported in ADS 9 and later.

 

BEFORE, if you used ordDescend(,,.t.) (or any value in the 3rd arg),

it was silently ignored no matter what version of ADS you used.

 

This change now means that with ADS 9 or later the flag is implemented.

BUT if you have ADS 8 or earlier, now I throw an error to alert you that
that 

flag is not supported and your requested action would fail to do anything.

This may anger people who have been silently failing for years 

(perhaps with code that is shared with other platforms that DO support the
flag) 

I’m not very good at details with our Error throwing details. Here’s what I
coded:

//  Do we have a "Unsupported Option in this version" error?

               hb_errRT_DBCMD( EG_ARG, EDBCMD_DBINFOBADPARAMETER, "Dynamic
descend not supported in this version", HB_ERR_FUNCNAME );

 

SHOULD WE REMOVE THIS, and go back to ignoring it?  Or should the error msg
be standardized?

 

A second question:  AdsSetIndexDirection takes an unusual flag that EITHER
takes 0 to return

to the original state, or TRUE to "reverse the direction from the current
state"

IOW, they have the ability to “go back to normal” which IIUC
Clipper/(x)Harbour does NOT.

 

Am I missing something?  It would be nice to have a value to "return to
native state" in our syntax

instead of requiring a close/re-open of the file.  Note: Once the direction
has been

dynamically changed, ordDescend() is only capable of returning the CURRENT
state; there is no

api to get the Original direction setting.

 

In some COMIX functions, there was the difference between an explicit NIL
and an ignored parameter

to distinguish between intentions.  I never liked having to explain it to
people, BUT

this may be an instance where explicitly passing NIL as the third arg could
be the flag

to revert to the original state of the index.

Is there a good way to add the extended value/functionality of either
learning or setting

the original direction?  

 

Thanks!

 

--

Brian Hays

 

------------------------------------------------------------------------------
Join us December 9, 2009 for the Red Hat Virtual Experience,
a free event focused on virtualization and cloud computing. 
Attend in-depth sessions from your desk. Your couch. Anywhere.
http://p.sf.net/sfu/redhat-sfdev2dev
_______________________________________________
xHarbour-developers mailing list
xHarbour-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/xharbour-developers

Reply via email to