Page 1 of 3
Which RDD Class should be used for DBF/DBZ/DBV
Posted: Wed Aug 17, 2022 7:04 am
by ArunBerlin
I've used classes DBFNTX and DBFCDX in VODBCreate. It produces DBF/DBT/DBZ and DBF/FPT/DBZ combinations.
DBV -Memo File
DBZ - Index File
But my requirement is DBF/DBV/DBZ.
The documentation doesn't provide any information regarding this.
Documentationhttps://www.xsharp.eu/runtimehelp/html/cat-RDD_Classes.htm class=""]Documentation[/url]
Let me know, if there are any options to create the DBF/DBV/DBZ combo.
Thank you
Which RDD Class should be used for DBF/DBZ/DBV
Posted: Wed Aug 17, 2022 8:44 am
by robert
Arun,
You would have to use DBFMEMO RDD.
But we have not implemented that yet.
It is not a lot of work to do that, since we have all the components already (the DBV is a FPT with another extension) but we have simply not found the time to do it.
Robert
Which RDD Class should be used for DBF/DBZ/DBV
Posted: Wed Aug 17, 2022 9:21 am
by ArunBerlin
Thank you for the info
Which RDD Class should be used for DBF/DBZ/DBV
Posted: Wed Aug 24, 2022 5:49 am
by ArunBerlin
Hi Robert,
When can I expect this option(DBV/DBZ/DBF) to be released.
It will be really helpful for my development, if an approximate date can be specified.
Thanks.
Which RDD Class should be used for DBF/DBZ/DBV
Posted: Wed Aug 24, 2022 7:05 am
by robert
Arun,
I will try to add this in the next build.
Please send me some example files so I can test it.
Robert
Which RDD Class should be used for DBF/DBZ/DBV
Posted: Wed Aug 24, 2022 11:08 am
by ArunBerlin
Thankyou Robert for considering the request.
I'm attaching a sample (DBF-DBZ-DBV Sample.zip) with this message.
Which RDD Class should be used for DBF/DBZ/DBV
Posted: Wed Aug 24, 2022 3:03 pm
by robert
Arun,
Can you show a piece of example code how you are working with the file ?
Robert
Which RDD Class should be used for DBF/DBZ/DBV
Posted: Thu Aug 25, 2022 7:30 am
by ArunBerlin
Hi Robert,
Functional flow - Create DBV/DBZ - > Open the file -> Replace(append) the DBV content with a 'Data String'
Code:
Code: Select all
FUNCTION _DictCreate(pszDictName AS PSZ) AS LONG PASCAL
LOCAL cFile AS STRING
LOCAL aStruc AS ARRAY
LOCAL strRDDList AS _RDDLIST
LOCAL nRet := 0 AS LONG
SetAnsi(FALSE)
SetCollation(#CLIPPER)
SetDateCountry(XSharp.Core.Functions.BRITISH)
SetCentury(TRUE)
cFile := Psz2String(pszDictName) + '.DBZ' // Index file
strRDDList := GetRDDList()
aStruc := {{"DATA","M",10,0}}
IF VODBCreate(cFile, aStruc, strRDDList, TRUE, "blob", NULL_STRING, FALSE, FALSE)
nRet := 1
ENDIF
RETURN nRet
INTERNAL FUNCTION GetRDDList() AS _RDDLIST
LOCAL strRDDList AS _RDDLIST
LOCAL DIM aRDDNames2[2] AS STRING
LOCAL DIM aRDDNames3[3] AS STRING
LOCAL dwRDDs AS DWORD
dwRDDs := iif(Empty(NULL_SYMBOL), 2, 3)
IF dwRDDs == 3
aRDDNames3[1] := "CAVODBF"
aRDDNames3[2] := #DBFNTX
aRDDNames3[3] := NULL_SYMBOL
strRDDList := _RDDList{aRDDNames3}
ELSE
aRDDNames2[1] := "CAVODBF"
aRDDNames2[2] := #DBFNTX
strRDDList := _RDDList{aRDDNames2}
ENDIF
RETURN strRDDList
FUNCTION _DictOpen(pszDictName AS STRING,nShare AS LONG,nRO AS LONG) AS LONG PASCAL
LOCAL cFile,cAlias AS STRING
LOCAL strRDDList AS _RDDLIST
LOCAL nRet := 0 AS LONG
SetAnsi(FALSE)
SetCollation(#CLIPPER)
SetDateCountry(XSharp.Core.Functions.BRITISH)
SetCentury(TRUE)
cFile := UPPER(pszDictName) + '.DBZ' // Index file
cAlias := "__" + Str(100000 + VODBSetSelect(0),6,0)
strRDDList := GetRDDList()
IF VODBUseArea(TRUE, strRDDlist, cFile, cAlias, TRUE, TRUE) .and. !NetErr()
nRet := (cAlias)->(VODBGetSelect())
ENDIF
RETURN nRet
FUNCTION _DictReplace(nArea AS LONG,pszBuffer AS PSZ,nSize AS LONG,nNew AS LONG) AS LONG PASCAL
LOCAL nRet := 1 AS LONG
LOCAL cData AS STRING
LOCAL wCh AS WORD
LOCAL sAsc AS SHORT
Local mess
Local mess2
LOCAL oErr AS USUAL
LOCAL ErrorStruct
IF nNew == 1
nRet := iif((nArea)->(VODBAppend(TRUE)) .and. !NetErr(),1,0)
ENDIF
IF nRet == 1
cData := Mem2String(pszBuffer,nSize)
FOR wCh := 1 UPTO SLen(cData)
sAsc := Asc(CharPos(cData, wCh))
IF sAsc >= 176
cData := Stuff(cData, wCh, 1, CHR(sAsc - 48))
ENDIF
NEXT
(nArea)->Data := cData
ENDIF
RETURN nRet
Which RDD Class should be used for DBF/DBZ/DBV
Posted: Thu Aug 25, 2022 1:29 pm
by robert
Arun,
This is X# code..
Can you show the original VO code that you used for this.
I first want to see if I can create and open this file in VO before I even attempt to do it in X#.
Robert
Which RDD Class should be used for DBF/DBZ/DBV
Posted: Fri Aug 26, 2022 10:45 am
by AlainC
Hi,
Here is a small class in VO to create and read a DBV file (see attachment).
Best regards
Alain