Page 15 of 70

Re: ADO RDD xHarbour

PostPosted: Tue Mar 31, 2015 9:24 am
by AHF
Antonio,

I dont have incremental search in my xbrowse.
Could email me only that function?

Re: ADO RDD xHarbour

PostPosted: Tue Mar 31, 2015 10:39 am
by lucasdebeltran
Antonio,

So APPEND BLANK and REPLACE FIELD WITH.. do not work already?.

Thank you.

Re: ADO RDD xHarbour

PostPosted: Tue Mar 31, 2015 10:44 am
by AHF
Lucas,

It might work but those functions were already written by others and not fully tested.

In our small trials it worked but i cant assure.

Append blank seems to work.

Re: ADO RDD xHarbour

PostPosted: Tue Mar 31, 2015 10:55 am
by Antonio Linares
Antonio,

I just sent an email to Rao asking him for the code to provide you

Re: ADO RDD xHarbour

PostPosted: Tue Mar 31, 2015 11:01 am
by lucasdebeltran
Antonio,

When trying to compile with Harbour 3.2.0dev (r1412151448), there are some errors:


lucas.prg(215) Warning W0001 Ambiguous reference 'CSTR'

lucas.prg(216) Warning W0001 Ambiguous reference 'CSTR'

lucas.prg(216) Warning W0001 Ambiguous reference 'CSTR'

lucas.prg(216) Warning W0001 Ambiguous reference 'CSTR'

lucas.prg(217) Warning W0001 Ambiguous reference 'CSTR'

lucas.prg(220) Warning W0001 Ambiguous reference 'CSTR'

lucas.prg(331) Warning W0001 Ambiguous reference 'UR_FI_FLAGS'

lucas.prg(332) Warning W0001 Ambiguous reference 'UR_FI_STEP'

lucas.prg(759) Warning W0001 Ambiguous reference 'N'

lucas.prg(760) Warning W0001 Ambiguous reference 'N'

lucas.prg(761) Warning W0001 Ambiguous reference 'N'

lucas.prg(932) Warning W0001 Ambiguous reference 'N'

lucas.prg(934) Warning W0001 Ambiguous reference 'N'

lucas.prg(937) Warning W0001 Ambiguous reference 'N'

lucas.prg(940) Warning W0001 Ambiguous reference 'N'

lucas.prg(947) Warning W0001 Ambiguous reference 'N'

lucas.prg(1092) Error E0030 Syntax error "syntax error at 'IN'"

lucas.prg(1108) Error E0030 Syntax error "syntax error at 'ENDIF'"

lucas.prg(1148) Error E0017 Unclosed control structure 'IF'

lucas.prg(1188) Error E0030 Syntax error "syntax error at 'IN'"

lucas.prg(1189) Warning W0001 Ambiguous reference 'Y'

lucas.prg(1191) Warning W0001 Ambiguous reference 'Y'

lucas.prg(1191) Warning W0001 Ambiguous reference 'Y'

lucas.prg(1194) Error E0030 Syntax error "syntax error at 'ELSE'"

lucas.prg(1198) Error E0030 Syntax error "syntax error at 'ENDIF'"

lucas.prg(1221) Error E0017 Unclosed control structure 'IF'

lucas.prg(1230) Warning W0001 Ambiguous reference 'WA_INDEXEFOR'

lucas.prg(1265) Warning W0001 Ambiguous reference 'CSQL'

lucas.prg(1266) Warning W0001 Ambiguous reference 'CSQL'

lucas.prg(1266) Warning W0001 Ambiguous reference 'CSQL'

lucas.prg(1268) Warning W0001 Ambiguous reference 'CSQL'

lucas.prg(1406) Warning W0001 Ambiguous reference 'YURETURN'

lucas.prg(1440) Warning W0001 Ambiguous reference 'URESULT'

lucas.prg(1444) Warning W0001 Ambiguous reference 'URESULT'

lucas.prg(1450) Warning W0001 Ambiguous reference 'URESULT'

lucas.prg(1452) Warning W0001 Ambiguous reference 'URESULT'

lucas.prg(1454) Warning W0001 Ambiguous reference 'URESULT'

lucas.prg(1488) Warning W0001 Ambiguous reference 'NLEN'

lucas.prg(1494) Warning W0001 Ambiguous reference 'NLEN'

lucas.prg(1501) Warning W0001 Ambiguous reference 'NLEN'

lucas.prg(1502) Warning W0001 Ambiguous reference 'NLEN'

lucas.prg(1506) Warning W0001 Ambiguous reference 'NLEN'

lucas.prg(1507) Warning W0001 Ambiguous reference 'NLEN'

lucas.prg(1517) Warning W0001 Ambiguous reference 'NLEN'

lucas.prg(1667) Warning W0001 Ambiguous reference 'HB_FT_DATETIME'

lucas.prg(1690) Error E0030 Syntax error "syntax error at 'IN'"

lucas.prg(1692) Error E0030 Syntax error "syntax error at 'ELSE'"

lucas.prg(1697) Error E0030 Syntax error "syntax error at 'ENDIF'"

lucas.prg(1705) Error E0017 Unclosed control structure 'IF'

Re: ADO RDD xHarbour

PostPosted: Tue Mar 31, 2015 11:28 am
by AHF
Lucas,

lucas.prg(331) Warning W0001 Ambiguous reference 'UR_FI_FLAGS'

lucas.prg(332) Warning W0001 Ambiguous reference 'UR_FI_STEP'


These in xHarbour must be added to hbusrrd.ch

Code: Select all  Expand view
#define UR_FI_FLAGS           6
#define UR_FI_STEP            7
#define UR_FI_SIZE            7 //eram 5 ahf
 


If in harbour they are not needed comment them in ado_open.

All others Im correcting code I ll post it later. Nevertheless you should be able to run like that.

Code: Select all  Expand view
IF UPPER(SUBSTR(cOrder,1,3)) IN aTempFiles .OR. UPPER(SUBSTR(cOrder,1,4)) IN aTempFiles

I dont know if its only in xHarbour

Re: ADO RDD xHarbour

PostPosted: Tue Mar 31, 2015 12:05 pm
by lucasdebeltran
Antonio,

IF UPPER(SUBSTR(cOrder,1,3)) IN aTempFiles .OR. UPPER(SUBSTR(cOrder,1,4)) IN aTempFiles

this only works with xHarbour.

I advise you not to code like this, as Harbour users, the majority, won´t be able to try and test it.

With your latest additions it only gives the above error.

Thank you.

Re: ADO RDD xHarbour

PostPosted: Tue Mar 31, 2015 12:36 pm
by Antonio Linares
Antonio,

Yes, please, code it compatible for both harbour and xharbour, thanks

Re: ADO RDD xHarbour

PostPosted: Tue Mar 31, 2015 1:08 pm
by Antonio Linares
Antonio,

I have emailed you the code you asked for :-)

Re: ADO RDD xHarbour

PostPosted: Tue Mar 31, 2015 1:40 pm
by AHF
You re right Ill do that.

Thanks for the code Antonio.

Re: ADO RDD xHarbour

PostPosted: Tue Mar 31, 2015 1:52 pm
by lucasdebeltran
Master Antonio Linares,

In order to help Antonio, what is the equivalent in Harbour for IF xxxx IN aTempFiles?.

Thanks.

Re: ADO RDD xHarbour

PostPosted: Tue Mar 31, 2015 2:16 pm
by AHF
Lucas,

ascan() > 0 but you have to inverse args

Re: ADO RDD xHarbour

PostPosted: Tue Mar 31, 2015 2:39 pm
by AHF
Antonio,

ORDSCOPE is always called in pairs 1st top 2nd bot.
Thus I think DBOI_SCOPESET and DBOI_SCOPECLEAR are never called.

In order to avoid build a query and open recordset one for TOP and another for BOT I only do that after DBOI_SCOPEBOTTOM is called.

Is this the correct behaviour to be compatible with dbf ordscope?
If one use SET SCOPE TO its ok but if use only one ordscope() to define top will go wrong! I think nobody does that but you never know.
If it comes with a codeblock can we do that?

What do you think about the code leave it like that?


Code: Select all  Expand view
STATIC FUNCTION ADOSCOPE(aWAdata, oRecordSet, aOrderInfo,nIndex)
 LOCAL y, cScopeExp :="", cSql :=""

   //[UR_ORI_NEWVAL] comes with actual scope top or bottom and returns the former active scope if any
   IF VALTYPE(aOrderInfo[ UR_ORI_NEWVAL ]) = "B"
      aOrderInfo[ UR_ORI_NEWVAL ] := EVAL(aOrderInfo[ UR_ORI_NEWVAL ])
   ENDIF
   
   IF EMPTY(aWAdata[WA_INDEXACTIVE]) .OR. aWAdata[WA_INDEXACTIVE] = 0 //NO INDEX NO SCOPE
      aOrderInfo[ UR_ORI_RESULT ] := NIL
      RETURN HB_FAILURE
   ENDIF
   
   y:=ASCAN( aWAData[ WA_SCOPES ], aWAData[WA_INDEXACTIVE]  )
   
   DO CASE
   CASE nIndex == DBOI_SCOPESET //never gets called noy tested might be completly wrong!
 
       IF y > 0
           aWAData[ WA_SCOPETOP ][y] := aOrderInfo[ UR_ORI_NEWVAL ]
           aWAData[ WA_SCOPEBOT ][y] := aOrderInfo[ UR_ORI_NEWVAL ]
        ELSE
           AADD( aWAData[ WA_SCOPES ],aWAData[ WA_INDEXACTIVE ])
           AADD(aWAData[ WA_SCOPETOP ],aOrderInfo[ UR_ORI_NEWVAL ])
           AADD(aWAData[ WA_SCOPEBOT ],aOrderInfo[ UR_ORI_NEWVAL ])
        ENDIF      
        aOrderInfo[ UR_ORI_RESULT ] := NIL

   CASE nIndex == DBOI_SCOPECLEAR //never gets called noy tested might be completly wrong!
   
        IF y > 0
           ADEL(aWAData[ WA_SCOPES ],y,.T.)
           ADEL(aWAData[ WA_SCOPETOP ],y,.T.)
           ADEL(aWAData[ WA_SCOPEBOT ],y,.T.)
        ENDIF      
        aOrderInfo[ UR_ORI_RESULT ] := NIL //RETURN ACUTAL SCOPETOP NIL IF NONE

   CASE nIndex == DBOI_SCOPETOP

        IF y > 0
           aOrderInfo[ UR_ORI_RESULT ] := aWAData[ WA_SCOPETOP ][y] //RETURN ACTUALSCOPE TOP
           aWAData[ WA_SCOPETOP ][y] := aOrderInfo[ UR_ORI_NEWVAL ]
           IF LEN(aWAData[ WA_SCOPEBOT ]) < y
              AADD(aWAData[ WA_SCOPEBOT ],SPACE(LEN(CVALTOCHAR(aWAData[ WA_SCOPETOP ][y])))) //THERE INST STILL A SCOPEBOT ARRAYS MUST HAVE  SAME LEN
           ENDIF     
        ELSE
           AADD(aWAData[ WA_SCOPETOP ],aOrderInfo[ UR_ORI_NEWVAL ])
           AADD(aWAData[ WA_SCOPEBOT ],SPACE(LEN(CVALTOCHAR(aWAData[ WA_SCOPETOP ][1])))) //THERE INST STILL A SCOPEBOT ARRAYS MUST HAVE  SAME LEN
           aOrderInfo[ UR_ORI_RESULT ] := ""
        ENDIF      
     
   CASE nIndex == DBOI_SCOPEBOTTOM

       IF y > 0
           aOrderInfo[ UR_ORI_RESULT ] := aWAData[ WA_SCOPEBOT ][y] //RETURN ACTUALSCOPE TOP
           aWAData[ WA_SCOPEBOT ][y] := aOrderInfo[ UR_ORI_NEWVAL ]
           IF LEN(aWAData[ WA_SCOPETOP ]) < y
              AADD(aWAData[ WA_SCOPETOP ],SPACE(LEN(CVALTOCHAR(aWAData[ WA_SCOPEBOT ][y])))) //THERE INST STILL A SCOPETOP ARRAYS MUST HAVE  SAME LEN
           ENDIF     
        ELSE
           AADD( aWAData[ WA_SCOPES ],aWAData[ WA_INDEXACTIVE ])
           AADD(aWAData[ WA_SCOPEBOT ],aOrderInfo[ UR_ORI_NEWVAL ])
           AADD(aWAData[ WA_SCOPETOP ],SPACE(LEN(CVALTOCHAR(aWAData[ WA_SCOPEBOT ][1])))) //THERE INST STILL A SCOPETOP ARRAYS MUST HAVE  SAME LEN
           aOrderInfo[ UR_ORI_RESULT ] := ""
        ENDIF      

   CASE nIndex == DBOI_SCOPETOPCLEAR
   
       IF y > 0
           aOrderInfo[ UR_ORI_RESULT ] := aWAData[ WA_SCOPETOP ][y] //RETURN ACTUALSCOPE TOP
           aWAData[ WA_SCOPETOP ][y] := SPACE(LEN(CVALTOCHAR(aWAData[ WA_SCOPEBOT ][y])))
        ELSE
           aOrderInfo[ UR_ORI_RESULT ] := "" //RETURN ACTUALSCOPE TOP IF NONE
        ENDIF      
       
   CASE nIndex == DBOI_SCOPEBOTTOMCLEAR
   
       IF y > 0
           aOrderInfo[ UR_ORI_RESULT ] := aWAData[ WA_SCOPEBOT ][y] //RETURN ACTUALSCOPE TOP
           aWAData[ WA_SCOPEBOT ][y] := SPACE(LEN(CVALTOCHAR(aWAData[ WA_SCOPETOP ][y])))
        ELSE
           aOrderInfo[ UR_ORI_RESULT ] := "" //RETURN ACTUALSCOPE TOP IF NONE
        ENDIF      

   ENDCASE

   //ONLY BUILDS QUERY AFTER ALL DONE ASSUME THAT ALWAYS CLLED IN PAIRS OTHERWISE WILL GET ERROR  
   IF nIndex = DBOI_SCOPEBOTTOM  .OR. nIndex = DBOI_SCOPEBOTTOMCLEAR .OR. nIndex = DBOI_SCOPETOPCLEAR
   
      IF y = 0  //IF DIDNT FOUND ANY ITS THE FIRST ONE THAT JUST BEEN ADD
         y := 1
      ENDIF 
     
      IF LEN(ALLTRIM(aWAData[ WA_SCOPETOP ][y]+aWAData[ WA_SCOPEBOT ][y])) > 0
        cScopeEXp := ADOPSEUDOSEEK(aWAData[ WA_SCOPETOP ][y],aWAData,,.T.,aWAData[ WA_SCOPEBOT ][y])[2]
      ELSE
          cScopeExp :=""
      ENDIF   
     
      cSql := IndexBuildExp(aWAData[ WA_INDEXACTIVE ],aWAData,,cScopeExp)
      oRecordSet:Close()
      oRecordSet:open(cSql,aWAData[ WA_CONNECTION ])
     
   ENDIF
   
  RETURN HB_SUCCESS
 

Re: ADO RDD xHarbour

PostPosted: Tue Mar 31, 2015 3:21 pm
by AHF
New adordd with scopes and Harbour syntax https://github.com/AHFERREIRA/adordd.git

Re: ADO RDD xHarbour

PostPosted: Tue Mar 31, 2015 5:15 pm
by Antonio Linares
Antonio,

Excellent! Great work :-)

Now we need feedback from users. How is your app behaving with it ?