topic
stringlengths 1
63
| text
stringlengths 1
577k
⌀ |
---|---|
to Nages: test for tdatabase | the tax office will take care of sending the daily fees directly to the Revenue Agency
ci penserà il registratore di cassa fiscale a inviare direttamente all'agenzia delle Entrate i corrispettivi giornalieri
Das Finanzamt sorgt dafür, dass die täglichen Gebühren direkt an die Finanzbehörde gesendet werden
La oficina de impuestos se encargará de enviar las tarifas diarias directamente a la Agencia de Impuestos.
In my program I have two types of prints: a non-tax receipt
and then I send the client what the customer has to pay to the cash register. The cash register, as I have already said, is already prepared to send daily fees to the revenue agency for the daily fees
In meinem Programm habe ich zwei Arten von Drucken: eine nicht steuerliche Quittung
und dann sende ich dem Kunden, was der Kunde an die Kasse zahlen muss. Wie bereits gesagt, ist die Kasse bereits bereit, Tagesgebühren für die Tagesgebühren an die Finanzbehörde zu senden
En mi programa tengo dos tipos de impresiones: un recibo no tributario
y luego le envío al cliente lo que el cliente tiene que pagar a la caja registradora. La caja registradora, como ya he dicho, ya está preparada para enviar tarifas diarias a la agencia de ingresos por las tarifas diarias |
to Nages: test for tdatabase | But I have to tell the truth that I find this whole system a little unpleasant, because I certainly can't use my old procedures and open files in share mode and save with lock / unlock
Making the customer archive I stopped because I don't know how to connect a customer to another archive: I have to enter the guests or family members that are hosted under the umbrella that the customer rents.
One more thing: I'd like to use a function to open archives and their indexes. For example, if in a program I only have to use a single archive in other systems, there are so many archives.
Then I have a window template with an explorer menu on the left and an xbrowse on the right and under the xbrowse a tab control where I insert the indexes.
You could not create a function that would give me the return of the archive and the loading of the its indexes in an array aIdx?
On this page I saw a function to open an archive with tdatabase [url:1xj6gls8]http://forums.fivetechsupport.com/viewtopic.php?f=3&t=37103&start=0[/url:1xj6gls8]
I used a system so long ago that it seems easier to me than James and Mr. Nages
also in this system the tdatabase class was used but the trecord was not used and there was a small class that served as trecord
I explain you the procedure give mr from Miguel_Angel_Cortés_Marchant many year ago
I tried the applicatin also on lan and it run okand it is very fast
[img:1xj6gls8]https://i.postimg.cc/KvvG08yY/m.png[/img:1xj6gls8]
the archives are opened through this easy function
[code=fw:1xj6gls8]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #00C800;">FUNCTION</span> Open_Dbf<span style="color: #000000;">(</span> cArchivo, aIdx <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">LOCAL</span> cAlias<br /> <span style="color: #00C800;">LOCAL</span> oDbf<br /> <span style="color: #00C800;">LOCAL</span> i<br /> <span style="color: #00C800;">STATIC</span> _Select_<br /> <span style="color: #00C800;">DEFAULT</span> _Select_ := <span style="color: #000000;">0</span><br /><br /> cAlias := <span style="color: #ff0000;">"TB"</span> + PADL<span style="color: #000000;">(</span> ++_Select_, <span style="color: #000000;">3</span>, <span style="color: #ff0000;">"0"</span> <span style="color: #000000;">)</span><br /><br /> DbUseArea<span style="color: #000000;">(</span> .T. ,, cArchivo, cAlias, .T. <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">IF</span> VALTYPE<span style="color: #000000;">(</span> aIdx <span style="color: #000000;">)</span> == <span style="color: #ff0000;">"A"</span><br /> <span style="color: #00C800;">FOR</span> i := <span style="color: #000000;">1</span> <span style="color: #0000ff;">TO</span> LEN<span style="color: #000000;">(</span> aIdx <span style="color: #000000;">)</span><br /> DBSETINDEX<span style="color: #000000;">(</span> aIdx<span style="color: #000000;">[</span> i <span style="color: #000000;">]</span> <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">NEXT</span><br /> <span style="color: #00C800;">ENDIF</span><br /><br /> oDbf := TDb<span style="color: #000000;">(</span><span style="color: #000000;">)</span>:<span style="color: #00C800;">New</span><span style="color: #000000;">(</span> cAlias <span style="color: #000000;">)</span><br /><br /><span style="color: #00C800;">RETURN</span> oDbf<br /> </div>[/code:1xj6gls8]
the tdb class is this
[code=fw:1xj6gls8]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><br /><span style="color: #00D7D7;">#INCLUDE</span> <span style="color: #ff0000;">"FIVEWIN.CH"</span><br /><span style="color: #00D7D7;">#define</span> _DbSkipper DbSkipper<br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><br /><span style="color: #00C800;">CLASS</span> TDb<br /><br /> <span style="color: #00C800;">DATA</span> nArea AS NUMERIC <span style="color: #0000ff;">INIT</span> <span style="color: #000000;">0</span><br /> <span style="color: #00C800;">DATA</span> lBuffer<br /> <span style="color: #00C800;">DATA</span> lShared AS LOGICAL <span style="color: #0000ff;">INIT</span> .t.<br /> <span style="color: #00C800;">DATA</span> aBuffer<br /> <span style="color: #00C800;">DATA</span> bBoF, bEoF, bNetError AS CODEBLOCK<br /> <span style="color: #00C800;">DATA</span> cAlias, cFile, cDriver AS String <span style="color: #0000ff;">INIT</span> <span style="color: #ff0000;">""</span><br /> <span style="color: #00C800;">DATA</span> lReadOnly AS LOGICAL <span style="color: #0000ff;">INIT</span> .f.<br /> <span style="color: #00C800;">DATA</span> lOemAnsi<br /> <span style="color: #00C800;">DATA</span> lTenChars AS LOGICAL <span style="color: #0000ff;">INIT</span> .t.<br /> <span style="color: #00C800;">DATA</span> aFldNames AS Array<br /> <span style="color: #00C800;">DATA</span> oBookMark AS OBJECT<br /> <span style="color: #00C800;">DATA</span> lBlank AS LOGICAL <span style="color: #0000ff;">INIT</span> .f.<br /><br /> <span style="color: #00C800;">METHOD</span> <span style="color: #00C800;">New</span><span style="color: #000000;">(</span> cAlias <span style="color: #000000;">)</span> CONSTRUCTOR<br /><br /> <span style="color: #00C800;">METHOD</span> <span style="color: #0000ff;">Activate</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /> <span style="color: #00C800;">METHOD</span> AddIndex<span style="color: #000000;">(</span> cFile, cTag <span style="color: #000000;">)</span> <span style="color: #00C800;">INLINE</span> <span style="color: #000000;">(</span> ::<span style="color: #000000;">nArea</span> <span style="color: #000000;">)</span>-><span style="color: #000000;">(</span> OrdListAdd<span style="color: #000000;">(</span> cFile, cTag <span style="color: #000000;">)</span> <span style="color: #000000;">)</span><br /> <span style="color: #0000ff;">MESSAGE</span> AnsiToOem <span style="color: #00C800;">METHOD</span> _AnsiToOem<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">METHOD</span> Append<span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #00C800;">INLINE</span> <span style="color: #000000;">(</span> ::<span style="color: #000000;">nArea</span> <span style="color: #000000;">)</span>-><span style="color: #000000;">(</span> DbAppend<span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">METHOD</span> Blank<span style="color: #000000;">(</span> nRecNo <span style="color: #000000;">)</span> <span style="color: #00C800;">INLINE</span> <span style="color: #000000;">(</span> ::<span style="color: #000000;">nArea</span> <span style="color: #000000;">)</span>-><span style="color: #000000;">(</span> nRecNo := RecNo<span style="color: #000000;">(</span><span style="color: #000000;">)</span>,;<br /> DBGoBottom<span style="color: #000000;">(</span><span style="color: #000000;">)</span>, ;<br /> DBSkip<span style="color: #000000;">(</span> <span style="color: #000000;">1</span> <span style="color: #000000;">)</span>, ;<br /> ::<span style="color: #000000;">Load</span><span style="color: #000000;">(</span>.t.<span style="color: #000000;">)</span>,;<br /> DBGoTo<span style="color: #000000;">(</span> nRecNo <span style="color: #000000;">)</span>,;<br /> ::<span style="color: #000000;">lBlank</span> := .t. <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">METHOD</span> Bof<span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #00C800;">INLINE</span> <span style="color: #000000;">(</span> ::<span style="color: #000000;">nArea</span> <span style="color: #000000;">)</span>-><span style="color: #000000;">(</span> BoF<span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">METHOD</span> Close<span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #00C800;">INLINE</span> <span style="color: #000000;">(</span> ::<span style="color: #000000;">nArea</span> <span style="color: #000000;">)</span>-><span style="color: #000000;">(</span> DbCloseArea<span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">METHOD</span> SetScope<span style="color: #000000;">(</span> n, xVar<span style="color: #000000;">)</span> <span style="color: #00C800;">INLINE</span> <span style="color: #000000;">(</span> ::<span style="color: #000000;">nArea</span> <span style="color: #000000;">)</span>-><span style="color: #000000;">(</span> OrdScope<span style="color: #000000;">(</span> n, xVar <span style="color: #000000;">)</span> <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">METHOD</span> OrdKeyNo<span style="color: #000000;">(</span> n, xVar<span style="color: #000000;">)</span> <span style="color: #00C800;">INLINE</span> <span style="color: #000000;">(</span> ::<span style="color: #000000;">nArea</span> <span style="color: #000000;">)</span>-><span style="color: #000000;">(</span> OrdKeyNo<span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">METHOD</span> ClrScope<span style="color: #000000;">(</span> n <span style="color: #000000;">)</span> <span style="color: #00C800;">INLINE</span> <span style="color: #000000;">(</span> ::<span style="color: #000000;">nArea</span> <span style="color: #000000;">)</span>-><span style="color: #000000;">(</span> OrdScope<span style="color: #000000;">(</span> n, <span style="color: #00C800;">NIL</span> <span style="color: #000000;">)</span> <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">METHOD</span> CloseIndex<span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #00C800;">INLINE</span> <span style="color: #000000;">(</span> ::<span style="color: #000000;">nArea</span> <span style="color: #000000;">)</span>-><span style="color: #000000;">(</span> OrdListClear<span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">METHOD</span> Commit<span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #00C800;">INLINE</span> <span style="color: #000000;">(</span> ::<span style="color: #000000;">nArea</span> <span style="color: #000000;">)</span>-><span style="color: #000000;">(</span> DBCommit<span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #000000;">)</span><br /><br /> <span style="color: #00C800;">METHOD</span> Create<span style="color: #000000;">(</span> cFile, aStruct, cDriver <span style="color: #000000;">)</span> ;<br /> <span style="color: #00C800;">INLINE</span> DbCreate<span style="color: #000000;">(</span> cFile, aStruct, cDriver <span style="color: #000000;">)</span><br /><br /> <span style="color: #00C800;">METHOD</span> CreateIndex<span style="color: #000000;">(</span> cFile, cTag, cKey, bKey, lUnique<span style="color: #000000;">)</span> <span style="color: #00C800;">INLINE</span> ;<br /> <span style="color: #000000;">(</span> ::<span style="color: #000000;">nArea</span> <span style="color: #000000;">)</span>-><span style="color: #000000;">(</span> OrdCreate<span style="color: #000000;">(</span> cFile, cTag, cKey, bKey, lUnique <span style="color: #000000;">)</span> <span style="color: #000000;">)</span><br /><br /> <span style="color: #00C800;">METHOD</span> ClearRelation<span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #00C800;">INLINE</span> <span style="color: #000000;">(</span> ::<span style="color: #000000;">nArea</span> <span style="color: #000000;">)</span>-><span style="color: #000000;">(</span> DbClearRelation<span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #000000;">)</span><br /><br /> <span style="color: #00C800;">METHOD</span> DbCreate<span style="color: #000000;">(</span> aStruct <span style="color: #000000;">)</span> <span style="color: #00C800;">INLINE</span> DbCreate<span style="color: #000000;">(</span> ::<span style="color: #000000;">cFile</span>, aStruct, ::<span style="color: #000000;">cDriver</span> <span style="color: #000000;">)</span><br /><br /> <span style="color: #00C800;">METHOD</span> Deactivate<span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #00C800;">INLINE</span> <span style="color: #000000;">(</span> ::<span style="color: #000000;">nArea</span> <span style="color: #000000;">)</span>-><span style="color: #000000;">(</span> DbCloseArea<span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #000000;">)</span>, ::<span style="color: #000000;">nArea</span> := <span style="color: #000000;">0</span><br /><br /> <span style="color: #00C800;">METHOD</span> Eval<span style="color: #000000;">(</span> bBlock, bFor, bWhile, nNext, nRecord, lRest <span style="color: #000000;">)</span> ;<br /> <span style="color: #00C800;">INLINE</span> <span style="color: #000000;">(</span> ::<span style="color: #000000;">nArea</span> <span style="color: #000000;">)</span>-><span style="color: #000000;">(</span> DBEval<span style="color: #000000;">(</span> bBlock, bFor, ;<br /> bWhile, nNext, nRecord, ;<br /> lRest <span style="color: #000000;">)</span> <span style="color: #000000;">)</span><br /><br /> <span style="color: #0000ff;">MESSAGE</span> Delete <span style="color: #00C800;">METHOD</span> _Delete<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">METHOD</span> Deleted<span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #00C800;">INLINE</span> <span style="color: #000000;">(</span> ::<span style="color: #000000;">nArea</span> <span style="color: #000000;">)</span>-><span style="color: #000000;">(</span> Deleted<span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #000000;">)</span><br /><br /> <span style="color: #00C800;">METHOD</span> DeleteIndex<span style="color: #000000;">(</span> cTag, cFile <span style="color: #000000;">)</span> <span style="color: #00C800;">INLINE</span> <span style="color: #000000;">(</span> ::<span style="color: #000000;">nArea</span> <span style="color: #000000;">)</span>-><span style="color: #000000;">(</span> OrdDestroy<span style="color: #000000;">(</span> cTag, cFile <span style="color: #000000;">)</span> <span style="color: #000000;">)</span><br /><br /> <span style="color: #00C800;">METHOD</span> Eof<span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #00C800;">INLINE</span> <span style="color: #000000;">(</span> ::<span style="color: #000000;">nArea</span> <span style="color: #000000;">)</span>-><span style="color: #000000;">(</span> EoF<span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #000000;">)</span><br /><br /> <span style="color: #00C800;">METHOD</span> FCount<span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #00C800;">INLINE</span> <span style="color: #000000;">(</span> ::<span style="color: #000000;">nArea</span> <span style="color: #000000;">)</span>-><span style="color: #000000;">(</span> FCount<span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #000000;">)</span><br /><br /> <span style="color: #0000ff;">MESSAGE</span> FieldGet <span style="color: #00C800;">METHOD</span> _FieldGet<span style="color: #000000;">(</span> nField <span style="color: #000000;">)</span><br /><br /> <span style="color: #00C800;">METHOD</span> FieldName<span style="color: #000000;">(</span> nField <span style="color: #000000;">)</span> <span style="color: #00C800;">INLINE</span> <span style="color: #000000;">(</span> ::<span style="color: #000000;">nArea</span> <span style="color: #000000;">)</span>-><span style="color: #000000;">(</span> FieldName<span style="color: #000000;">(</span> nField <span style="color: #000000;">)</span> <span style="color: #000000;">)</span><br /><br /> <span style="color: #00C800;">METHOD</span> FieldPos<span style="color: #000000;">(</span> cFieldName <span style="color: #000000;">)</span> <span style="color: #00C800;">INLINE</span> <span style="color: #000000;">(</span> ::<span style="color: #000000;">nArea</span> <span style="color: #000000;">)</span>-><span style="color: #000000;">(</span> FieldPos<span style="color: #000000;">(</span> cFieldName <span style="color: #000000;">)</span> <span style="color: #000000;">)</span><br /><br /> <span style="color: #0000ff;">MESSAGE</span> FieldPut <span style="color: #00C800;">METHOD</span> _FieldPut<span style="color: #000000;">(</span> nField, uVal <span style="color: #000000;">)</span><br /><br /> <span style="color: #00C800;">METHOD</span> Found<span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #00C800;">INLINE</span> <span style="color: #000000;">(</span> ::<span style="color: #000000;">nArea</span> <span style="color: #000000;">)</span>-><span style="color: #000000;">(</span> Found<span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #000000;">)</span><br /><br /> <span style="color: #00C800;">METHOD</span> GetBookMark<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /> <span style="color: #00C800;">METHOD</span> GoTo<span style="color: #000000;">(</span> nRecNo <span style="color: #000000;">)</span> <span style="color: #00C800;">INLINE</span> <span style="color: #000000;">(</span> ::<span style="color: #000000;">nArea</span> <span style="color: #000000;">)</span>-><span style="color: #000000;">(</span> DBGoTo<span style="color: #000000;">(</span> nRecNo <span style="color: #000000;">)</span> <span style="color: #000000;">)</span>,;<br /> <span style="color: #00C800;">If</span><span style="color: #000000;">(</span> ::<span style="color: #000000;">lBuffer</span>, ::<span style="color: #000000;">Load</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span>, <span style="color: #000000;">)</span><br /><br /> <span style="color: #00C800;">METHOD</span> GoTop<span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #00C800;">INLINE</span> <span style="color: #000000;">(</span> ::<span style="color: #000000;">nArea</span> <span style="color: #000000;">)</span>-><span style="color: #000000;">(</span> DBGoTop<span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #000000;">)</span>,;<br /> <span style="color: #00C800;">If</span><span style="color: #000000;">(</span> ::<span style="color: #000000;">lBuffer</span>, ::<span style="color: #000000;">Load</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span>, <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">METHOD</span> GoBottom<span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #00C800;">INLINE</span> <span style="color: #000000;">(</span> ::<span style="color: #000000;">nArea</span> <span style="color: #000000;">)</span>-><span style="color: #000000;">(</span> DBGoBottom<span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #000000;">)</span>,;<br /> <span style="color: #00C800;">If</span><span style="color: #000000;">(</span> ::<span style="color: #000000;">lBuffer</span>, ::<span style="color: #000000;">Load</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span>, <span style="color: #000000;">)</span><br /><br /> <span style="color: #00C800;">METHOD</span> IndexKey<span style="color: #000000;">(</span> ncTag, cFile <span style="color: #000000;">)</span> <span style="color: #00C800;">INLINE</span> <span style="color: #000000;">(</span> ::<span style="color: #000000;">nArea</span> <span style="color: #000000;">)</span>-><span style="color: #000000;">(</span> OrdKey<span style="color: #000000;">(</span> ncTag, cFile <span style="color: #000000;">)</span> <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">METHOD</span> IndexName<span style="color: #000000;">(</span> nTag, cFile <span style="color: #000000;">)</span> <span style="color: #00C800;">INLINE</span> <span style="color: #000000;">(</span> ::<span style="color: #000000;">nArea</span> <span style="color: #000000;">)</span>-><span style="color: #000000;">(</span> OrdName<span style="color: #000000;">(</span> nTag, cFile <span style="color: #000000;">)</span> <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">METHOD</span> IndexBagName<span style="color: #000000;">(</span> nInd <span style="color: #000000;">)</span> <span style="color: #00C800;">INLINE</span> <span style="color: #000000;">(</span> ::<span style="color: #000000;">nArea</span> <span style="color: #000000;">)</span>-><span style="color: #000000;">(</span> OrdBagName<span style="color: #000000;">(</span> nInd <span style="color: #000000;">)</span> <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">METHOD</span> IndexOrder<span style="color: #000000;">(</span> cTag, cFile <span style="color: #000000;">)</span> <span style="color: #00C800;">INLINE</span> <span style="color: #000000;">(</span> ::<span style="color: #000000;">nArea</span> <span style="color: #000000;">)</span>-><span style="color: #000000;">(</span> OrdNumber<span style="color: #000000;">(</span> cTag, cFile <span style="color: #000000;">)</span> <span style="color: #000000;">)</span><br /><br /> <span style="color: #00C800;">METHOD</span> LastRec<span style="color: #000000;">(</span> nRec <span style="color: #000000;">)</span> <span style="color: #00C800;">INLINE</span> <span style="color: #000000;">(</span> ::<span style="color: #000000;">nArea</span> <span style="color: #000000;">)</span>-><span style="color: #000000;">(</span> LastRec<span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #000000;">)</span><br /><br /> <span style="color: #00C800;">METHOD</span> Load<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /> <span style="color: #00C800;">METHOD</span> Lock<span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #00C800;">INLINE</span> <span style="color: #000000;">(</span> ::<span style="color: #000000;">nArea</span> <span style="color: #000000;">)</span>-><span style="color: #000000;">(</span> FLock<span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">METHOD</span> Modified<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /> <span style="color: #0000ff;">MESSAGE</span> OemToAnsi <span style="color: #00C800;">METHOD</span> _OemToAnsi<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">METHOD</span> Pack<span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #00C800;">INLINE</span> <span style="color: #000000;">(</span> ::<span style="color: #000000;">nArea</span> <span style="color: #000000;">)</span>-><span style="color: #000000;">(</span> DbPack<span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">METHOD</span> ReCall<span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #00C800;">INLINE</span> <span style="color: #000000;">(</span> ::<span style="color: #000000;">nArea</span> <span style="color: #000000;">)</span>-><span style="color: #000000;">(</span> DBRecall<span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #000000;">)</span><br /><br /> <span style="color: #00C800;">METHOD</span> RecCount<span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #00C800;">INLINE</span> <span style="color: #000000;">(</span> ::<span style="color: #000000;">nArea</span> <span style="color: #000000;">)</span>-><span style="color: #000000;">(</span> RecCount<span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">METHOD</span> RecLock<span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #00C800;">INLINE</span> <span style="color: #000000;">(</span> ::<span style="color: #000000;">nArea</span> <span style="color: #000000;">)</span>-><span style="color: #000000;">(</span> RLock<span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">METHOD</span> RecNo<span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #00C800;">INLINE</span> <span style="color: #000000;">(</span> ::<span style="color: #000000;">nArea</span> <span style="color: #000000;">)</span>-><span style="color: #000000;">(</span> RecNo<span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">METHOD</span> Save<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /> <span style="color: #00C800;">METHOD</span> SetBuffer<span style="color: #000000;">(</span> lOnOff <span style="color: #000000;">)</span><br /><br /> <span style="color: #00C800;">METHOD</span> SetBookMark<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /> <span style="color: #00C800;">METHOD</span> Seek<span style="color: #000000;">(</span> uExp, lSoft <span style="color: #000000;">)</span><br /><br /> <span style="color: #00C800;">METHOD</span> SetOrder<span style="color: #000000;">(</span> cnTag, cFile <span style="color: #000000;">)</span> <span style="color: #00C800;">INLINE</span> <span style="color: #000000;">(</span> <span style="color: #000000;">(</span> ::<span style="color: #000000;">nArea</span> <span style="color: #000000;">)</span>-><span style="color: #000000;">(</span> OrdSetFocus<span style="color: #000000;">(</span> cnTag, cFile <span style="color: #000000;">)</span> <span style="color: #000000;">)</span> <span style="color: #000000;">)</span><br /><br /> <span style="color: #00C800;">METHOD</span> SetRelation<span style="color: #000000;">(</span> ncArea, cExp <span style="color: #000000;">)</span> <span style="color: #00C800;">INLINE</span> ;<br /> <span style="color: #000000;">(</span> ::<span style="color: #000000;">nArea</span> <span style="color: #000000;">)</span>-><span style="color: #000000;">(</span> DbSetRelation<span style="color: #000000;">(</span> ncArea, Compile<span style="color: #000000;">(</span> cExp <span style="color: #000000;">)</span>, cExp <span style="color: #000000;">)</span> <span style="color: #000000;">)</span><br /><br /> <span style="color: #00C800;">METHOD</span> Skip<span style="color: #000000;">(</span> nRecords <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">METHOD</span> Skipper<span style="color: #000000;">(</span> nRecords <span style="color: #000000;">)</span><br /><br /> <span style="color: #00C800;">METHOD</span> UnLock<span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #00C800;">INLINE</span> <span style="color: #000000;">(</span> ::<span style="color: #000000;">nArea</span> <span style="color: #000000;">)</span>-><span style="color: #000000;">(</span> DBUnLock<span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #000000;">)</span><br /><br /> <span style="color: #00C800;">METHOD</span> Used<span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #00C800;">INLINE</span> <span style="color: #000000;">(</span> ::<span style="color: #000000;">nArea</span> <span style="color: #000000;">)</span>-><span style="color: #000000;">(</span> Used<span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">METHOD</span> Insert<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">METHOD</span> Zap<span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #00C800;">INLINE</span> <span style="color: #000000;">(</span> ::<span style="color: #000000;">nArea</span> <span style="color: #000000;">)</span>-><span style="color: #000000;">(</span> DbZap<span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #000000;">)</span><br /><br /> <span style="color: #00C800;">METHOD</span> Debug<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">METHOD</span> NewObj<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">METHOD</span> LoadObj<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">METHOD</span> SaveObj<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">METHOD</span> SetBrowse<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">METHOD</span> <span style="color: #0000ff;">Count</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #00C800;">INLINE</span> <span style="color: #000000;">(</span>::<span style="color: #000000;">nArea</span><span style="color: #000000;">)</span>-><span style="color: #000000;">(</span>RecCount<span style="color: #000000;">(</span><span style="color: #000000;">)</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">METHOD</span> Fin<span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #00C800;">INLINE</span> <span style="color: #000000;">(</span>::<span style="color: #000000;">nArea</span><span style="color: #000000;">)</span>-><span style="color: #000000;">(</span>DBCloseArea<span style="color: #000000;">(</span><span style="color: #000000;">)</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">METHOD</span> SetFocus<span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #00C800;">INLINE</span> <span style="color: #000000;">(</span><span style="color: #0000ff;">Select</span><span style="color: #000000;">(</span>::<span style="color: #000000;">cAlias</span><span style="color: #000000;">)</span><span style="color: #000000;">)</span><br /> ERROR HANDLER OnError<span style="color: #000000;">(</span> uParam1 <span style="color: #000000;">)</span><br /><br /><span style="color: #00C800;">ENDCLASS</span><br /><br /><span style="color: #B900B9;">//---------------------------------------------------------------------------//</span><br /><br /><span style="color: #00C800;">METHOD</span> <span style="color: #00C800;">New</span><span style="color: #000000;">(</span> cAlias <span style="color: #000000;">)</span> <span style="color: #00C800;">CLASS</span> TDb<br /> <span style="color: #00C800;">local</span> n, oClass, aDatas := <span style="color: #000000;">{</span><span style="color: #000000;">}</span>, aMethods := <span style="color: #000000;">{</span><span style="color: #000000;">}</span><br /> <span style="color: #00C800;">local</span> nWorkArea<br /><br /> nWorkArea := <span style="color: #0000ff;">Select</span><span style="color: #000000;">(</span> cAlias <span style="color: #000000;">)</span><br /><br /> ::<span style="color: #000000;">nArea</span> = nWorkArea<br /> ::<span style="color: #000000;">cAlias</span> = <span style="color: #0000ff;">Alias</span><span style="color: #000000;">(</span> nWorkArea <span style="color: #000000;">)</span><br /> ::<span style="color: #000000;">cFile</span> = <span style="color: #0000ff;">Alias</span><span style="color: #000000;">(</span> nWorkArea <span style="color: #000000;">)</span><br /> ::<span style="color: #000000;">cDriver</span> = <span style="color: #000000;">(</span> <span style="color: #0000ff;">Alias</span><span style="color: #000000;">(</span> nWorkArea <span style="color: #000000;">)</span> <span style="color: #000000;">)</span>-><span style="color: #000000;">(</span> DbSetDriver<span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #000000;">)</span><br /> ::<span style="color: #000000;">lShared</span> = .t.<br /> ::<span style="color: #000000;">lReadOnly</span> = .f.<br /> ::<span style="color: #000000;">lBuffer</span> = .t.<br /> ::<span style="color: #000000;">lOemAnsi</span> = .f.<br /><br /> ::<span style="color: #000000;">bNetError</span> = <span style="color: #000000;">{</span> || MsgStop<span style="color: #000000;">(</span> <span style="color: #ff0000;">"Record in use"</span>, <span style="color: #ff0000;">"Please, retry"</span> <span style="color: #000000;">)</span> <span style="color: #000000;">}</span><br /><br /> ::<span style="color: #000000;">aFldNames</span> = <span style="color: #000000;">{</span><span style="color: #000000;">}</span><br /> <span style="color: #00C800;">for</span> n = <span style="color: #000000;">1</span> <span style="color: #0000ff;">to</span> <span style="color: #000000;">(</span> ::<span style="color: #000000;">cAlias</span> <span style="color: #000000;">)</span>-><span style="color: #000000;">(</span> FCount<span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #000000;">)</span><br /> AAdd<span style="color: #000000;">(</span> ::<span style="color: #000000;">aFldNames</span>, <span style="color: #000000;">(</span> ::<span style="color: #000000;">cAlias</span> <span style="color: #000000;">)</span>-><span style="color: #000000;">(</span> FieldName<span style="color: #000000;">(</span> n <span style="color: #000000;">)</span> <span style="color: #000000;">)</span> <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">next</span><br /><br /> ::<span style="color: #000000;">Load</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">Self</span><br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><br /><span style="color: #00C800;">METHOD</span> <span style="color: #0000ff;">Activate</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #00C800;">CLASS</span> TDb<br /><br /> <span style="color: #00C800;">local</span> nOldArea:= <span style="color: #0000ff;">Select</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /> <span style="color: #0000ff;">Select</span> <span style="color: #000000;">(</span> ::<span style="color: #000000;">nArea</span> <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">if</span> ! Used<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> DbUseArea<span style="color: #000000;">(</span> .f., ::<span style="color: #000000;">cDriver</span>, ::<span style="color: #000000;">cFile</span>, ::<span style="color: #000000;">cAlias</span>, ::<span style="color: #000000;">lShared</span>, ::<span style="color: #000000;">lReadOnly</span> <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">endif</span><br /><br /> <span style="color: #0000ff;">Select</span> <span style="color: #000000;">(</span> nOldArea <span style="color: #000000;">)</span><br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><br /><span style="color: #00C800;">METHOD</span> _AnsiToOem<span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #00C800;">CLASS</span> TDb<br /><br /> <span style="color: #00C800;">local</span> n<br /><br /> <span style="color: #00C800;">for</span> n = <span style="color: #000000;">1</span> <span style="color: #0000ff;">to</span> Len<span style="color: #000000;">(</span> ::<span style="color: #000000;">aBuffer</span> <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">if</span> ValType<span style="color: #000000;">(</span> ::<span style="color: #000000;">aBuffer</span><span style="color: #000000;">[</span> n <span style="color: #000000;">]</span> <span style="color: #000000;">)</span> == <span style="color: #ff0000;">"C"</span><br /> ::<span style="color: #000000;">aBuffer</span><span style="color: #000000;">[</span> n <span style="color: #000000;">]</span> = AnsiToOem<span style="color: #000000;">(</span> ::<span style="color: #000000;">aBuffer</span><span style="color: #000000;">[</span> n <span style="color: #000000;">]</span> <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">endif</span><br /> <span style="color: #00C800;">next</span><br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><br /><span style="color: #00C800;">METHOD</span> _Delete<span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #00C800;">CLASS</span> TDb<br /><br /> <span style="color: #00C800;">if</span> ::<span style="color: #000000;">lShared</span><br /> <span style="color: #00C800;">if</span> ::<span style="color: #000000;">Lock</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> <span style="color: #000000;">(</span> ::<span style="color: #000000;">nArea</span> <span style="color: #000000;">)</span>-><span style="color: #000000;">(</span> DbDelete<span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #000000;">)</span><br /> ::<span style="color: #000000;">UnLock</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">else</span><br /> MsgAlert<span style="color: #000000;">(</span> <span style="color: #ff0000;">"DataBase in use"</span>, <span style="color: #ff0000;">"Please try again"</span> <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">endif</span><br /> <span style="color: #00C800;">else</span><br /> <span style="color: #000000;">(</span> ::<span style="color: #000000;">nArea</span> <span style="color: #000000;">)</span>-><span style="color: #000000;">(</span> DbDelete<span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">endif</span><br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /><br /><span style="color: #B900B9;">//---------------------------------------------------------------------------//</span><br /><br /><span style="color: #00C800;">METHOD</span> _FieldPut<span style="color: #000000;">(</span> nPos, uValue <span style="color: #000000;">)</span> <span style="color: #00C800;">CLASS</span> TDb<br /><br /> <span style="color: #00C800;">if</span> ::<span style="color: #000000;">lBuffer</span><br /> ::<span style="color: #000000;">aBuffer</span><span style="color: #000000;">[</span> nPos <span style="color: #000000;">]</span> := uValue<br /> <span style="color: #00C800;">else</span><br /> <span style="color: #00C800;">if</span> ::<span style="color: #000000;">lShared</span><br /> <span style="color: #00C800;">if</span> ::<span style="color: #000000;">RecLock</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> <span style="color: #000000;">(</span> ::<span style="color: #000000;">nArea</span> <span style="color: #000000;">)</span>-><span style="color: #000000;">(</span> FieldPut<span style="color: #000000;">(</span> nPos, uValue <span style="color: #000000;">)</span> <span style="color: #000000;">)</span><br /> ::<span style="color: #000000;">UnLock</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">else</span><br /> <span style="color: #00C800;">if</span> ! Empty<span style="color: #000000;">(</span> ::<span style="color: #000000;">bNetError</span> <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">return</span> Eval<span style="color: #000000;">(</span> ::<span style="color: #000000;">bNetError</span>, <span style="color: #00C800;">Self</span> <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">endif</span><br /> <span style="color: #00C800;">endif</span><br /> <span style="color: #00C800;">else</span><br /> <span style="color: #000000;">(</span> ::<span style="color: #000000;">nArea</span> <span style="color: #000000;">)</span>-><span style="color: #000000;">(</span> FieldPut<span style="color: #000000;">(</span> nPos, uValue <span style="color: #000000;">)</span> <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">endif</span><br /> <span style="color: #00C800;">endif</span><br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><br /><span style="color: #00C800;">METHOD</span> _FieldGet<span style="color: #000000;">(</span> nPos <span style="color: #000000;">)</span> <span style="color: #00C800;">CLASS</span> TDb<br /><br /> <span style="color: #00C800;">if</span> ::<span style="color: #000000;">lBuffer</span><br /> <span style="color: #00C800;">return</span> ::<span style="color: #000000;">aBuffer</span><span style="color: #000000;">[</span> nPos <span style="color: #000000;">]</span><br /> <span style="color: #00C800;">else</span><br /> <span style="color: #00C800;">return</span> <span style="color: #000000;">(</span> ::<span style="color: #000000;">nArea</span> <span style="color: #000000;">)</span>-><span style="color: #000000;">(</span> FieldGet<span style="color: #000000;">(</span> nPos <span style="color: #000000;">)</span> <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">endif</span><br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /><br /><span style="color: #B900B9;">//---------------------------------------------------------------------------//</span><br /><br /><span style="color: #00C800;">static</span> <span style="color: #00C800;">function</span> Compile<span style="color: #000000;">(</span> cExp <span style="color: #000000;">)</span><br /><span style="color: #00C800;">return</span> &<span style="color: #000000;">(</span> <span style="color: #ff0000;">"{||"</span> + cExp + <span style="color: #ff0000;">"}"</span> <span style="color: #000000;">)</span><br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><br /><span style="color: #00C800;">METHOD</span> Load<span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #00C800;">CLASS</span> TDb<br /> <span style="color: #00C800;">local</span> n<br /><br /> <span style="color: #00C800;">if</span> ::<span style="color: #000000;">lBuffer</span><br /> <span style="color: #00C800;">if</span> Empty<span style="color: #000000;">(</span> ::<span style="color: #000000;">aBuffer</span> <span style="color: #000000;">)</span><br /> ::<span style="color: #000000;">aBuffer</span> = Array<span style="color: #000000;">(</span> ::<span style="color: #000000;">FCount</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">endif</span><br /><br /> <span style="color: #00C800;">for</span> n = <span style="color: #000000;">1</span> <span style="color: #0000ff;">to</span> Len<span style="color: #000000;">(</span> ::<span style="color: #000000;">aBuffer</span> <span style="color: #000000;">)</span><br /> ::<span style="color: #000000;">aBuffer</span><span style="color: #000000;">[</span> n <span style="color: #000000;">]</span> = <span style="color: #000000;">(</span> ::<span style="color: #000000;">nArea</span> <span style="color: #000000;">)</span>-><span style="color: #000000;">(</span> FieldGet<span style="color: #000000;">(</span> n <span style="color: #000000;">)</span> <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">next</span><br /><br /> <span style="color: #00C800;">if</span> ::<span style="color: #000000;">lOemAnsi</span><br /> ::<span style="color: #000000;">OemToAnsi</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">endif</span><br /> <span style="color: #00C800;">endif</span><br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><br /><span style="color: #00C800;">METHOD</span> Modified<span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #00C800;">CLASS</span> TDb<br /><br /> <span style="color: #00C800;">local</span> cField, nFor<br /><br /> <span style="color: #00C800;">for</span> nFor := <span style="color: #000000;">1</span> <span style="color: #0000ff;">to</span> Len<span style="color: #000000;">(</span> ::<span style="color: #000000;">aFldNames</span> <span style="color: #000000;">)</span><br /><br /> cField = <span style="color: #000000;">(</span> ::<span style="color: #000000;">cAlias</span> <span style="color: #000000;">)</span>-><span style="color: #000000;">(</span> FieldName<span style="color: #000000;">(</span> nFor <span style="color: #000000;">)</span> <span style="color: #000000;">)</span><br /><br /> <span style="color: #00C800;">if</span> <span style="color: #000000;">(</span> ::<span style="color: #000000;">cAlias</span> <span style="color: #000000;">)</span>-><span style="color: #000000;">(</span> FieldGet<span style="color: #000000;">(</span> nFor <span style="color: #000000;">)</span> <span style="color: #000000;">)</span> != ::<span style="color: #000000;">aBuffer</span><span style="color: #000000;">[</span> nFor <span style="color: #000000;">]</span><br /> <span style="color: #00C800;">return</span> .t.<br /> <span style="color: #00C800;">endif</span><br /><br /> <span style="color: #00C800;">next</span><br /><br /><span style="color: #00C800;">return</span> .f.<br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><br /><span style="color: #00C800;">METHOD</span> _OemToAnsi<span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #00C800;">CLASS</span> TDb<br /><br /> <span style="color: #00C800;">local</span> n<br /><br /> <span style="color: #00C800;">for</span> n = <span style="color: #000000;">1</span> <span style="color: #0000ff;">to</span> Len<span style="color: #000000;">(</span> ::<span style="color: #000000;">aBuffer</span> <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">if</span> ValType<span style="color: #000000;">(</span> ::<span style="color: #000000;">aBuffer</span><span style="color: #000000;">[</span> n <span style="color: #000000;">]</span> <span style="color: #000000;">)</span> == <span style="color: #ff0000;">"C"</span><br /> ::<span style="color: #000000;">aBuffer</span><span style="color: #000000;">[</span> n <span style="color: #000000;">]</span> = OemToAnsi<span style="color: #000000;">(</span> ::<span style="color: #000000;">aBuffer</span><span style="color: #000000;">[</span> n <span style="color: #000000;">]</span> <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">endif</span><br /> <span style="color: #00C800;">next</span><br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><br /><span style="color: #00C800;">METHOD</span> OnError<span style="color: #000000;">(</span> uParam1 <span style="color: #000000;">)</span> <span style="color: #00C800;">CLASS</span> TDb<br /> <span style="color: #00C800;">local</span> cMsg := __GetMessage<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">local</span> nError := <span style="color: #00C800;">If</span><span style="color: #000000;">(</span> <span style="color: #0000ff;">SubStr</span><span style="color: #000000;">(</span> cMsg, <span style="color: #000000;">1</span>, <span style="color: #000000;">1</span> <span style="color: #000000;">)</span> == <span style="color: #ff0000;">"_"</span>, <span style="color: #000000;">1005</span>, <span style="color: #000000;">1004</span> <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">local</span> nField<br /><br /> <span style="color: #00C800;">if</span> ::<span style="color: #000000;">lTenChars</span> .and. Len<span style="color: #000000;">(</span> <span style="color: #0000ff;">SubStr</span><span style="color: #000000;">(</span> cMsg, <span style="color: #000000;">2</span> <span style="color: #000000;">)</span> <span style="color: #000000;">)</span> == <span style="color: #000000;">9</span><br /> cMsg = Upper<span style="color: #000000;">(</span> cMsg <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">if</span> <span style="color: #0000ff;">SubStr</span><span style="color: #000000;">(</span> cMsg, <span style="color: #000000;">1</span>, <span style="color: #000000;">1</span> <span style="color: #000000;">)</span> == <span style="color: #ff0000;">"_"</span><br /> <span style="color: #00C800;">if</span> <span style="color: #000000;">(</span> nField := AScan<span style="color: #000000;">(</span> ::<span style="color: #000000;">aFldNames</span>,;<br /> <span style="color: #000000;">{</span> | cField | <span style="color: #0000ff;">SubStr</span><span style="color: #000000;">(</span> cMsg, <span style="color: #000000;">2</span> <span style="color: #000000;">)</span> == ;<br /> RTrim<span style="color: #000000;">(</span> <span style="color: #0000ff;">SubStr</span><span style="color: #000000;">(</span> cField, <span style="color: #000000;">1</span>, <span style="color: #000000;">9</span> <span style="color: #000000;">)</span> <span style="color: #000000;">)</span> <span style="color: #000000;">}</span> <span style="color: #000000;">)</span> <span style="color: #000000;">)</span> != <span style="color: #000000;">0</span><br /> ::<span style="color: #000000;">FieldPut</span><span style="color: #000000;">(</span> nField, uParam1 <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">else</span><br /> _ClsSetError<span style="color: #000000;">(</span> _GenError<span style="color: #000000;">(</span> nError, ::<span style="color: #000000;">ClassName</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span>, <span style="color: #0000ff;">SubStr</span><span style="color: #000000;">(</span> cMsg, <span style="color: #000000;">2</span> <span style="color: #000000;">)</span> <span style="color: #000000;">)</span> <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">endif</span><br /> <span style="color: #00C800;">else</span><br /> <span style="color: #00C800;">if</span><span style="color: #000000;">(</span> <span style="color: #000000;">(</span> nField := ::<span style="color: #000000;">FieldPos</span><span style="color: #000000;">(</span> cMsg <span style="color: #000000;">)</span> <span style="color: #000000;">)</span> != <span style="color: #000000;">0</span> <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">return</span> ::<span style="color: #000000;">FieldGet</span><span style="color: #000000;">(</span> nField <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">else</span><br /> _ClsSetError<span style="color: #000000;">(</span> _GenError<span style="color: #000000;">(</span> nError, ::<span style="color: #000000;">ClassName</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span>, cMsg <span style="color: #000000;">)</span> <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">endif</span><br /> <span style="color: #00C800;">endif</span><br /> <span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /> <span style="color: #00C800;">endif</span><br /><br /> <span style="color: #00C800;">if</span> <span style="color: #0000ff;">SubStr</span><span style="color: #000000;">(</span> cMsg, <span style="color: #000000;">1</span>, <span style="color: #000000;">1</span> <span style="color: #000000;">)</span> == <span style="color: #ff0000;">"_"</span><br /> <span style="color: #00C800;">if</span><span style="color: #000000;">(</span> <span style="color: #000000;">(</span> nField := ::<span style="color: #000000;">FieldPos</span><span style="color: #000000;">(</span> <span style="color: #0000ff;">SubStr</span><span style="color: #000000;">(</span> cMsg, <span style="color: #000000;">2</span> <span style="color: #000000;">)</span> <span style="color: #000000;">)</span> <span style="color: #000000;">)</span> != <span style="color: #000000;">0</span> <span style="color: #000000;">)</span><br /> ::<span style="color: #000000;">FieldPut</span><span style="color: #000000;">(</span> nField, uParam1 <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">else</span><br /> _ClsSetError<span style="color: #000000;">(</span> _GenError<span style="color: #000000;">(</span> nError, ::<span style="color: #000000;">ClassName</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span>, <span style="color: #0000ff;">SubStr</span><span style="color: #000000;">(</span> cMsg, <span style="color: #000000;">2</span> <span style="color: #000000;">)</span> <span style="color: #000000;">)</span> <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">endif</span><br /> <span style="color: #00C800;">else</span><br /> <span style="color: #00C800;">if</span><span style="color: #000000;">(</span> <span style="color: #000000;">(</span> nField := ::<span style="color: #000000;">FieldPos</span><span style="color: #000000;">(</span> cMsg <span style="color: #000000;">)</span> <span style="color: #000000;">)</span> != <span style="color: #000000;">0</span> <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">return</span> ::<span style="color: #000000;">FieldGet</span><span style="color: #000000;">(</span> nField <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">else</span><br /> _ClsSetError<span style="color: #000000;">(</span> _GenError<span style="color: #000000;">(</span> nError, ::<span style="color: #000000;">ClassName</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span>, cMsg <span style="color: #000000;">)</span> <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">endif</span><br /> <span style="color: #00C800;">endif</span><br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><br /><span style="color: #00C800;">METHOD</span> Seek<span style="color: #000000;">(</span> uExpr, lSoft <span style="color: #000000;">)</span> <span style="color: #00C800;">CLASS</span> TDb<br /><br /> <span style="color: #00C800;">local</span> lFound<br /><br /> <span style="color: #00C800;">DEFAULT</span> lSoft := Set<span style="color: #000000;">(</span> _SET_SOFTSEEK <span style="color: #000000;">)</span><br /><br /> lFound = <span style="color: #000000;">(</span> ::<span style="color: #000000;">nArea</span> <span style="color: #000000;">)</span>-><span style="color: #000000;">(</span> DbSeek<span style="color: #000000;">(</span> uExpr, lSoft <span style="color: #000000;">)</span> <span style="color: #000000;">)</span><br /><br /> <span style="color: #00C800;">if</span> ::<span style="color: #000000;">lBuffer</span><br /> ::<span style="color: #000000;">Load</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">endif</span><br /><br /><span style="color: #00C800;">return</span> lFound<br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><br /><span style="color: #00C800;">METHOD</span> SetBuffer<span style="color: #000000;">(</span> lOnOff <span style="color: #000000;">)</span> <span style="color: #00C800;">CLASS</span> TDb<br /><br /> <span style="color: #00C800;">DEFAULT</span> lOnOff := .t.<br /><br /> <span style="color: #00C800;">if</span> lOnOff != <span style="color: #00C800;">nil</span><br /> ::<span style="color: #000000;">lBuffer</span> = lOnOff<br /> <span style="color: #00C800;">endif</span><br /><br /> <span style="color: #00C800;">if</span> ::<span style="color: #000000;">lBuffer</span><br /> ::<span style="color: #000000;">Load</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">else</span><br /> ::<span style="color: #000000;">aBuffer</span> := <span style="color: #00C800;">nil</span><br /> <span style="color: #00C800;">endif</span><br /><br /><span style="color: #00C800;">return</span> ::<span style="color: #000000;">lBuffer</span><br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><br /><span style="color: #00C800;">METHOD</span> Save<span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #00C800;">CLASS</span> TDb<br /><br /> <span style="color: #00C800;">local</span> n<br /><br /> <span style="color: #00C800;">if</span> ::<span style="color: #000000;">lBuffer</span><br /> <span style="color: #00C800;">if</span> ! <span style="color: #000000;">(</span> ::<span style="color: #000000;">nArea</span> <span style="color: #000000;">)</span>-><span style="color: #000000;">(</span> EoF<span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">if</span> ::<span style="color: #000000;">lShared</span><br /> <span style="color: #00C800;">if</span> ::<span style="color: #000000;">RecLock</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">for</span> n := <span style="color: #000000;">1</span> <span style="color: #0000ff;">to</span> Len<span style="color: #000000;">(</span> ::<span style="color: #000000;">aBuffer</span> <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">if</span> ::<span style="color: #000000;">lOemAnsi</span> .and. ValType<span style="color: #000000;">(</span> ::<span style="color: #000000;">aBuffer</span><span style="color: #000000;">[</span> n <span style="color: #000000;">]</span> <span style="color: #000000;">)</span> == <span style="color: #ff0000;">"C"</span><br /> <span style="color: #000000;">(</span> ::<span style="color: #000000;">nArea</span> <span style="color: #000000;">)</span>-><span style="color: #000000;">(</span> FieldPut<span style="color: #000000;">(</span> n, AnsiToOem<span style="color: #000000;">(</span> ::<span style="color: #000000;">aBuffer</span><span style="color: #000000;">[</span> n <span style="color: #000000;">]</span> <span style="color: #000000;">)</span> <span style="color: #000000;">)</span> <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">else</span><br /> <span style="color: #000000;">(</span> ::<span style="color: #000000;">nArea</span> <span style="color: #000000;">)</span>-><span style="color: #000000;">(</span> FieldPut<span style="color: #000000;">(</span> n, ::<span style="color: #000000;">aBuffer</span><span style="color: #000000;">[</span> n <span style="color: #000000;">]</span> <span style="color: #000000;">)</span> <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">endif</span><br /> <span style="color: #00C800;">next</span><br /> ::<span style="color: #000000;">UnLock</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">else</span><br /> <span style="color: #00C800;">if</span> ! Empty<span style="color: #000000;">(</span> ::<span style="color: #000000;">bNetError</span> <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">return</span> Eval<span style="color: #000000;">(</span> ::<span style="color: #000000;">bNetError</span>, <span style="color: #00C800;">Self</span> <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">else</span><br /> MsgAlert<span style="color: #000000;">(</span> <span style="color: #ff0000;">"Record in use"</span>, <span style="color: #ff0000;">"Please, retry"</span> <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">endif</span><br /> <span style="color: #00C800;">endif</span><br /> <span style="color: #00C800;">else</span><br /> <span style="color: #00C800;">for</span> n := <span style="color: #000000;">1</span> <span style="color: #0000ff;">to</span> Len<span style="color: #000000;">(</span> ::<span style="color: #000000;">aBuffer</span> <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">if</span> ::<span style="color: #000000;">lOemAnsi</span> .and. ValType<span style="color: #000000;">(</span> ::<span style="color: #000000;">aBuffer</span><span style="color: #000000;">[</span> n <span style="color: #000000;">]</span> <span style="color: #000000;">)</span> == <span style="color: #ff0000;">"C"</span><br /> <span style="color: #000000;">(</span> ::<span style="color: #000000;">nArea</span> <span style="color: #000000;">)</span>-><span style="color: #000000;">(</span> FieldPut<span style="color: #000000;">(</span> n, AnsiToOem<span style="color: #000000;">(</span> ::<span style="color: #000000;">aBuffer</span><span style="color: #000000;">[</span> n <span style="color: #000000;">]</span> <span style="color: #000000;">)</span> <span style="color: #000000;">)</span> <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">else</span><br /> <span style="color: #000000;">(</span> ::<span style="color: #000000;">nArea</span> <span style="color: #000000;">)</span>-><span style="color: #000000;">(</span> FieldPut<span style="color: #000000;">(</span> n, ::<span style="color: #000000;">aBuffer</span><span style="color: #000000;">[</span> n <span style="color: #000000;">]</span> <span style="color: #000000;">)</span> <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">endif</span><br /> <span style="color: #00C800;">next</span><br /> <span style="color: #00C800;">endif</span><br /> <span style="color: #00C800;">endif</span><br /> <span style="color: #00C800;">endif</span><br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><br /><span style="color: #00C800;">METHOD</span> Skip<span style="color: #000000;">(</span> nRecords <span style="color: #000000;">)</span> <span style="color: #00C800;">CLASS</span> TDb<br /><br /> <span style="color: #00C800;">local</span> n<br /><br /> <span style="color: #00C800;">DEFAULT</span> nRecords := <span style="color: #000000;">1</span><br /><br /> <span style="color: #000000;">(</span> ::<span style="color: #000000;">nArea</span> <span style="color: #000000;">)</span>-><span style="color: #000000;">(</span> DbSkip<span style="color: #000000;">(</span> nRecords <span style="color: #000000;">)</span> <span style="color: #000000;">)</span><br /><br /> <span style="color: #00C800;">if</span> ::<span style="color: #000000;">lBuffer</span><br /> ::<span style="color: #000000;">Load</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">endif</span><br /><br /> <span style="color: #00C800;">if</span> ::<span style="color: #000000;">Eof</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">if</span> ::<span style="color: #000000;">bEoF</span> != <span style="color: #00C800;">nil</span><br /> Eval<span style="color: #000000;">(</span> ::<span style="color: #000000;">bEoF</span>, <span style="color: #00C800;">Self</span> <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">endif</span><br /> <span style="color: #00C800;">endif</span><br /><br /> <span style="color: #00C800;">if</span> ::<span style="color: #000000;">BoF</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">if</span> ::<span style="color: #000000;">bBoF</span> != <span style="color: #00C800;">nil</span><br /> Eval<span style="color: #000000;">(</span> ::<span style="color: #000000;">bBoF</span>, <span style="color: #00C800;">Self</span> <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">endif</span><br /> <span style="color: #00C800;">endif</span><br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><br /><span style="color: #00C800;">METHOD</span> Skipper<span style="color: #000000;">(</span> nRecords <span style="color: #000000;">)</span> <span style="color: #00C800;">CLASS</span> TDb<br /><br /> <span style="color: #00C800;">local</span> nSkipped<br /><br /> <span style="color: #00C800;">DEFAULT</span> nRecords := <span style="color: #000000;">1</span><br /><br /> nSkipped = <span style="color: #000000;">(</span> ::<span style="color: #000000;">nArea</span> <span style="color: #000000;">)</span>-><span style="color: #000000;">(</span> _DbSkipper<span style="color: #000000;">(</span> nRecords <span style="color: #000000;">)</span> <span style="color: #000000;">)</span><br /><br /> <span style="color: #00C800;">if</span> ::<span style="color: #000000;">lBuffer</span><br /> ::<span style="color: #000000;">Load</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">endif</span><br /><br /><span style="color: #00C800;">return</span> nSkipped<br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><br /><span style="color: #00C800;">METHOD</span> SetBookMark<span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #00C800;">CLASS</span> TDb<br /> <span style="color: #B900B9;">//::Load()</span><br /> <span style="color: #B900B9;">//::Debug()</span><br /> ::<span style="color: #000000;">oBookMark</span> := TBookMark<span style="color: #000000;">(</span><span style="color: #000000;">)</span>:<span style="color: #00C800;">New</span><span style="color: #000000;">(</span> <span style="color: #00C800;">Self</span> <span style="color: #000000;">)</span><br /> ::<span style="color: #000000;">oBookMark</span>:<span style="color: #000000;">Set</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /><span style="color: #00C800;">RETURN</span> <span style="color: #00C800;">Self</span><br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><br /><span style="color: #00C800;">METHOD</span> GetBookMark<span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #00C800;">CLASS</span> TDb<br /><br /> ::<span style="color: #000000;">cAlias</span> := ::<span style="color: #000000;">oBookMark</span>:<span style="color: #000000;">cAlias</span><br /> ::<span style="color: #000000;">SetOrder</span><span style="color: #000000;">(</span> ::<span style="color: #000000;">oBookMark</span>:<span style="color: #000000;">cnIndex</span> <span style="color: #000000;">)</span><br /> ::<span style="color: #000000;">goto</span><span style="color: #000000;">(</span> ::<span style="color: #000000;">oBookMark</span>:<span style="color: #000000;">nRecno</span> <span style="color: #000000;">)</span><br /> ::<span style="color: #000000;">aBuffer</span> := AClone<span style="color: #000000;">(</span> ::<span style="color: #000000;">oBookMark</span>:<span style="color: #000000;">aBuffer</span> <span style="color: #000000;">)</span><br /><br /> <span style="color: #B900B9;">//Self := ::oBookMark:oDb</span><br /><br /><br /> <span style="color: #B900B9;">//::Debug()</span><br /><br /><span style="color: #00C800;">RETURN</span> <span style="color: #00C800;">Self</span><br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><br /><span style="color: #00C800;">METHOD</span> Debug<span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #00C800;">CLASS</span> TDb<br /> <span style="color: #00C800;">LOCAL</span> i, cText<br /> cText := <span style="color: #ff0000;">""</span><br /><br /> <span style="color: #00C800;">FOR</span> i := <span style="color: #000000;">1</span> <span style="color: #0000ff;">TO</span> LEN<span style="color: #000000;">(</span> ::<span style="color: #000000;">aBuffer</span> <span style="color: #000000;">)</span><br /> <span style="color: #B900B9;">//cText += xType( ::aBuffer[i] ) + CRLF</span><br /> <span style="color: #00C800;">NEXT</span> i<br /><br /> <span style="color: #0000ff;">MsgInfo</span><span style="color: #000000;">(</span> cText <span style="color: #000000;">)</span><br /><span style="color: #00C800;">RETURN</span> .T.<br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><br /><span style="color: #00C800;">METHOD</span> NewObj<span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #00C800;">CLASS</span> TDb<br /> ::<span style="color: #000000;">Blank</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> ::<span style="color: #000000;">SetBookMark</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><span style="color: #00C800;">RETURN</span> TObjDb<span style="color: #000000;">(</span><span style="color: #000000;">)</span>:<span style="color: #00C800;">New</span><span style="color: #000000;">(</span> <span style="color: #00C800;">Self</span>, .T. <span style="color: #000000;">)</span><br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><br /><span style="color: #00C800;">METHOD</span> LoadObj<span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #00C800;">CLASS</span> TDb<br /> ::<span style="color: #000000;">Load</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> ::<span style="color: #000000;">SetBookMark</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><span style="color: #00C800;">RETURN</span> TObjDb<span style="color: #000000;">(</span><span style="color: #000000;">)</span>:<span style="color: #00C800;">New</span><span style="color: #000000;">(</span> <span style="color: #00C800;">Self</span>, .F. <span style="color: #000000;">)</span><br /><br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><br /><span style="color: #00C800;">METHOD</span> SaveObj<span style="color: #000000;">(</span> oData <span style="color: #000000;">)</span> <span style="color: #00C800;">CLASS</span> TDb<br /> ::<span style="color: #000000;">GetBookMark</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> ::<span style="color: #000000;">aBuffer</span> := AClone<span style="color: #000000;">(</span> oData:<span style="color: #000000;">aBuffer</span> <span style="color: #000000;">)</span><br /><br /> <span style="color: #00C800;">IF</span> oData:<span style="color: #000000;">lNuevo</span><br /> ::<span style="color: #000000;">Append</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">ENDIF</span><br /><br /> ::<span style="color: #000000;">Save</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><span style="color: #00C800;">RETURN</span> <span style="color: #00C800;">NIL</span><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><span style="color: #00C800;">METHOD</span> SetBrowse<span style="color: #000000;">(</span>oLbx<span style="color: #000000;">)</span> <span style="color: #00C800;">CLASS</span> TDb<br /> oLbx:<span style="color: #000000;">bGotop</span> := <span style="color: #000000;">{</span> || ::<span style="color: #000000;">GoTop</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #000000;">}</span><br /> oLbx:<span style="color: #000000;">bGoBottom</span> := <span style="color: #000000;">{</span> || ::<span style="color: #000000;">GoBottom</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><span style="color: #000000;">}</span><br /> oLbx:<span style="color: #000000;">bSkip</span> := <span style="color: #000000;">{</span> |nRec| ::<span style="color: #000000;">Skipper</span><span style="color: #000000;">(</span> nRec <span style="color: #000000;">)</span> <span style="color: #000000;">}</span><br /> oLbx:<span style="color: #000000;">bLogicLen</span> := <span style="color: #000000;">{</span> || ::<span style="color: #000000;">RecCount</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #000000;">}</span><br /><span style="color: #B900B9;">// oLbx:nHeaderHeight := 20</span><br /><span style="color: #B900B9;">// oLbx:nLineHeight := 20</span><br /><span style="color: #00C800;">RETURN</span> oLbx<br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><span style="color: #00C800;">METHOD</span> Insert<span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #00C800;">CLASS</span> TDb<br /> <span style="color: #00C800;">LOCAL</span> lOk:=.f.<br /> <span style="color: #000000;">(</span>::<span style="color: #000000;">nArea</span><span style="color: #000000;">)</span>-><span style="color: #000000;">(</span>DBAppend<span style="color: #000000;">(</span><span style="color: #000000;">)</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">IF</span> !NetErr<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> ::<span style="color: #000000;">Save</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> lOk:=.t.<br /> <span style="color: #00C800;">ENDIF</span><br /><span style="color: #00C800;">RETURN</span> lOk<br /> </div>[/code:1xj6gls8]
there is another class ( the grandmother of trcord)
[code=fw:1xj6gls8]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><br /><span style="color: #00D7D7;">#INCLUDE</span> <span style="color: #ff0000;">"FIVEWIN.CH"</span><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><span style="color: #00C800;">CLASS</span> TObjDb<br /> <span style="color: #00C800;">DATA</span> aBuffer<br /> <span style="color: #00C800;">DATA</span> aFldNames<br /> <span style="color: #00C800;">DATA</span> lNuevo<br /> <span style="color: #00C800;">DATA</span> oDb<br /> <span style="color: #00C800;">METHOD</span> <span style="color: #00C800;">New</span><span style="color: #000000;">(</span> oDb, lNew<span style="color: #000000;">)</span> CONSTRUCTOR<br /> <span style="color: #00C800;">METHOD</span> Debug<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> ERROR HANDLER OnError<span style="color: #000000;">(</span> uParam1 <span style="color: #000000;">)</span><br /><span style="color: #00C800;">ENDCLASS</span><br /><span style="color: #B900B9;">//---------------------------------------------------------------------------//</span><br /><span style="color: #00C800;">METHOD</span> <span style="color: #00C800;">New</span><span style="color: #000000;">(</span> oDb, lNew <span style="color: #000000;">)</span> <span style="color: #00C800;">CLASS</span> TObjDb<br /> ::<span style="color: #000000;">aBuffer</span> := AClone<span style="color: #000000;">(</span> oDb:<span style="color: #000000;">aBuffer</span> <span style="color: #000000;">)</span><br /> ::<span style="color: #000000;">aFldNames</span> := AClone<span style="color: #000000;">(</span> oDb:<span style="color: #000000;">aFldNames</span> <span style="color: #000000;">)</span><br /> ::<span style="color: #000000;">lNuevo</span> := lNew<br /><span style="color: #00C800;">RETURN</span> <span style="color: #00C800;">Self</span><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><span style="color: #00C800;">METHOD</span> OnError<span style="color: #000000;">(</span> uParam1 <span style="color: #000000;">)</span> <span style="color: #00C800;">CLASS</span> TObjDb<br /> <span style="color: #00C800;">LOCAL</span> cMsg := __GetMessage<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">LOCAL</span> nError := IIF<span style="color: #000000;">(</span> <span style="color: #0000ff;">SubStr</span><span style="color: #000000;">(</span> cMsg, <span style="color: #000000;">1</span>, <span style="color: #000000;">1</span> <span style="color: #000000;">)</span> == <span style="color: #ff0000;">"_"</span>, <span style="color: #000000;">1005</span>, <span style="color: #000000;">1004</span> <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">LOCAL</span> nField<br /><br /> <span style="color: #00C800;">if</span> <span style="color: #0000ff;">SubStr</span><span style="color: #000000;">(</span> cMsg, <span style="color: #000000;">1</span>, <span style="color: #000000;">1</span> <span style="color: #000000;">)</span> == <span style="color: #ff0000;">"_"</span><br /> <span style="color: #00C800;">if</span><span style="color: #000000;">(</span><span style="color: #000000;">(</span> nField := AScan<span style="color: #000000;">(</span> ::<span style="color: #000000;">aFldNames</span>, <span style="color: #000000;">{</span> | cField | <span style="color: #0000ff;">SubStr</span><span style="color: #000000;">(</span> cMsg, <span style="color: #000000;">2</span> <span style="color: #000000;">)</span> == ;<br /> RTrim<span style="color: #000000;">(</span> <span style="color: #0000ff;">SubStr</span><span style="color: #000000;">(</span> cField, <span style="color: #000000;">1</span> <span style="color: #000000;">)</span> <span style="color: #000000;">)</span> <span style="color: #000000;">}</span> <span style="color: #000000;">)</span> <span style="color: #000000;">)</span> != <span style="color: #000000;">0</span> <span style="color: #000000;">)</span><br /> ::<span style="color: #000000;">aBuffer</span><span style="color: #000000;">[</span> nField <span style="color: #000000;">]</span> := uParam1<br /> <span style="color: #00C800;">else</span><br /> _ClsSetError<span style="color: #000000;">(</span> _GenError<span style="color: #000000;">(</span> nError, ::<span style="color: #000000;">ClassName</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span>, <span style="color: #0000ff;">SubStr</span><span style="color: #000000;">(</span> cMsg, <span style="color: #000000;">2</span> <span style="color: #000000;">)</span> <span style="color: #000000;">)</span> <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">endif</span><br /> <span style="color: #00C800;">else</span><br /> <span style="color: #00C800;">if</span><span style="color: #000000;">(</span> nField := AScan<span style="color: #000000;">(</span> ::<span style="color: #000000;">aFldNames</span>, <span style="color: #000000;">{</span> | cField | <span style="color: #0000ff;">SubStr</span><span style="color: #000000;">(</span> cMsg, <span style="color: #000000;">1</span> <span style="color: #000000;">)</span> == ;<br /> RTrim<span style="color: #000000;">(</span> cField <span style="color: #000000;">)</span> <span style="color: #000000;">}</span> <span style="color: #000000;">)</span> <span style="color: #000000;">)</span> != <span style="color: #000000;">0</span><br /> <span style="color: #00C800;">return</span> ::<span style="color: #000000;">aBuffer</span><span style="color: #000000;">[</span> nField <span style="color: #000000;">]</span><br /> <span style="color: #00C800;">ELSE</span><br /> _ClsSetError<span style="color: #000000;">(</span> _GenError<span style="color: #000000;">(</span> nError, ::<span style="color: #000000;">ClassName</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span>, cMsg <span style="color: #000000;">)</span> <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">endif</span><br /> <span style="color: #00C800;">endif</span><br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><br /><span style="color: #00C800;">METHOD</span> Debug<span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #00C800;">CLASS</span> TObjDb<br /> <span style="color: #00C800;">LOCAL</span> i, cText<br /> cText := <span style="color: #ff0000;">""</span><br /><br /> <span style="color: #00C800;">FOR</span> i := <span style="color: #000000;">1</span> <span style="color: #0000ff;">TO</span> LEN<span style="color: #000000;">(</span> ::<span style="color: #000000;">aBuffer</span> <span style="color: #000000;">)</span><br /><span style="color: #B900B9;">// cText += ::aFldNames[i] + ":" + xType( ::aBuffer[i] ) + CRLF</span><br /> <span style="color: #00C800;">NEXT</span> i<br /><br /> <span style="color: #0000ff;">MsgInfo</span><span style="color: #000000;">(</span> cText <span style="color: #000000;">)</span><br /><span style="color: #00C800;">RETURN</span> .T.<span style="color: #000000;">[</span>code<span style="color: #000000;">]</span><br /><br /><br /><br /><span style="color: #000000;">[</span>/code<span style="color: #000000;">]</span><br /><br /><span style="color: #0000ff;">to</span> open an archive the procedure made<br /><br /><span style="color: #000000;">[</span>code<span style="color: #000000;">]</span><br /><span style="color: #00C800;">METHOD</span> <span style="color: #00C800;">New</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #00C800;">CLASS</span> TPaciente<br /> <span style="color: #00C800;">LOCAL</span> oFont1<br /><br /> ::<span style="color: #000000;">oPaciente</span> := Abrir_Arc<span style="color: #000000;">(</span> <span style="color: #ff0000;">"paciente"</span>, <span style="color: #000000;">{</span> <span style="color: #ff0000;">"paciente"</span> <span style="color: #000000;">}</span> <span style="color: #000000;">)</span><br /> ::<span style="color: #000000;">oPaciente</span>:<span style="color: #000000;">SetOrder</span><span style="color: #000000;">(</span> <span style="color: #ff0000;">"NOMBRE"</span> <span style="color: #000000;">)</span><br /> ::<span style="color: #000000;">oPaciente</span>:<span style="color: #000000;">GoTop</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /><span style="color: #000000;">[</span>/code<span style="color: #000000;">]</span><br /><br /><span style="color: #0000ff;">to</span> add a <span style="color: #00C800;">new</span> customer it made this <br /><span style="color: #000000;">[</span>code<span style="color: #000000;">]</span><br /><br /><span style="color: #00C800;">METHOD</span> Editar<span style="color: #000000;">(</span> lNuevo <span style="color: #000000;">)</span> <span style="color: #00C800;">CLASS</span> TPaciente<br /> <span style="color: #00C800;">LOCAL</span> oDlg<br /> <span style="color: #00C800;">LOCAL</span> nEdad<br /> <span style="color: #00C800;">LOCAL</span> lGrabar := .F.<br /> <span style="color: #00C800;">LOCAL</span> cTitulo<br /> <span style="color: #00C800;">LOCAL</span> cCodigo<br /> <span style="color: #00C800;">LOCAL</span> oGet := Array<span style="color: #000000;">(</span><span style="color: #000000;">8</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">LOCAL</span> QSelf := <span style="color: #00C800;">Self</span><br /><br /><br /> <span style="color: #00C800;">DEFAULT</span> lNuevo := .F.<br /><br /> <span style="color: #00C800;">IF</span> lNuevo<br /> cCodigo := fCrearDoc<span style="color: #000000;">(</span> <span style="color: #ff0000;">"PACIENTES"</span> <span style="color: #000000;">)</span><br /><br /> cTitulo := <span style="color: #ff0000;">"Creación de pacientes"</span><br /> ::<span style="color: #000000;">oData</span> := ::<span style="color: #000000;">oPaciente</span>:<span style="color: #000000;">NewObj</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> <span style="color: #B900B9;">// -------------------------------- //</span><br /> ::<span style="color: #000000;">oData</span>:<span style="color: #000000;">Codigo</span> := cCodigo<br /> <span style="color: #00C800;">ELSE</span><br /><br /> <span style="color: #00C800;">IF</span> ::<span style="color: #000000;">oPaciente</span>:<span style="color: #000000;">Lastrec</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> == <span style="color: #000000;">0</span><br /> <span style="color: #0000ff;">MsgInfo</span><span style="color: #000000;">(</span> <span style="color: #ff0000;">"Hay informacion en el sistema"</span>, <span style="color: #ff0000;">"Edicion"</span> <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">RETURN</span> <span style="color: #00C800;">NIL</span><br /> <span style="color: #00C800;">ENDIF</span><br /><br /> ::<span style="color: #000000;">oData</span> := ::<span style="color: #000000;">oPaciente</span>:<span style="color: #000000;">LoadObj</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> cTitulo := <span style="color: #ff0000;">"Modificar Paciente"</span><br /> <span style="color: #00C800;">ENDIF</span><span style="color: #000000;">[</span>/code<span style="color: #000000;">]</span><br /><br /><span style="color: #0000ff;">to</span> create a <span style="color: #00C800;">new</span> code it use a <span style="color: #00C800;">function</span> and a control.dbf<br /><span style="color: #000000;">[</span>code<span style="color: #000000;">]</span><span style="color: #00C800;">FUNCTION</span> fCrearDoc<span style="color: #000000;">(</span> cTDoc <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">LOCAL</span> oControl<br /> <span style="color: #00C800;">LOCAL</span> cDoc<br /><br /> oControl := Abrir_Arc<span style="color: #000000;">(</span> <span style="color: #ff0000;">"Control"</span>, <span style="color: #000000;">{</span><span style="color: #000000;">}</span> <span style="color: #000000;">)</span><br /><br /> <span style="color: #00C800;">DO</span> <span style="color: #00C800;">CASE</span><br /> <span style="color: #00C800;">CASE</span> ALLTRIM<span style="color: #000000;">(</span> cTDoc <span style="color: #000000;">)</span> == <span style="color: #ff0000;">"PPTOS"</span> ; oControl:<span style="color: #000000;">GoTo</span><span style="color: #000000;">(</span> <span style="color: #000000;">1</span> <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">CASE</span> ALLTRIM<span style="color: #000000;">(</span> cTDoc <span style="color: #000000;">)</span> == <span style="color: #ff0000;">"TRATAMIENT"</span> ; oControl:<span style="color: #000000;">GoTo</span><span style="color: #000000;">(</span> <span style="color: #000000;">2</span> <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">CASE</span> ALLTRIM<span style="color: #000000;">(</span> cTDoc <span style="color: #000000;">)</span> == <span style="color: #ff0000;">"LABTORIO"</span> ; oControl:<span style="color: #000000;">GoTo</span><span style="color: #000000;">(</span> <span style="color: #000000;">3</span> <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">CASE</span> ALLTRIM<span style="color: #000000;">(</span> cTDoc <span style="color: #000000;">)</span> == <span style="color: #ff0000;">"ORDENES"</span> ; oControl:<span style="color: #000000;">GoTo</span><span style="color: #000000;">(</span> <span style="color: #000000;">4</span> <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">CASE</span> ALLTRIM<span style="color: #000000;">(</span> cTDoc <span style="color: #000000;">)</span> == <span style="color: #ff0000;">"INTERNO"</span> ; oControl:<span style="color: #000000;">GoTo</span><span style="color: #000000;">(</span> <span style="color: #000000;">5</span> <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">CASE</span> ALLTRIM<span style="color: #000000;">(</span> cTDoc <span style="color: #000000;">)</span> == <span style="color: #ff0000;">"PACIENTES"</span> ; oControl:<span style="color: #000000;">GoTo</span><span style="color: #000000;">(</span> <span style="color: #000000;">6</span> <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">CASE</span> ALLTRIM<span style="color: #000000;">(</span> cTDoc <span style="color: #000000;">)</span> == <span style="color: #ff0000;">"HISTORIAL"</span> ; oControl:<span style="color: #000000;">GoTo</span><span style="color: #000000;">(</span> <span style="color: #000000;">7</span> <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">ENDCASE</span><br /><br /> oControl:<span style="color: #000000;">Load</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /> <span style="color: #00C800;">IF</span> oControl:<span style="color: #000000;">RecLock</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> cDoc := PADL<span style="color: #000000;">(</span> <span style="color: #000000;">(</span> VAL<span style="color: #000000;">(</span> oControl:<span style="color: #000000;">documento</span> <span style="color: #000000;">)</span> + <span style="color: #000000;">1</span> <span style="color: #000000;">)</span>, oControl:<span style="color: #000000;">largo</span>, <span style="color: #ff0000;">"0"</span> <span style="color: #000000;">)</span><br /> oControl:<span style="color: #000000;">documento</span> := cDoc<br /> oControl:<span style="color: #000000;">Save</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">ELSE</span><br /> MsgStop<span style="color: #000000;">(</span> <span style="color: #ff0000;">"No se pudo crear el documento"</span>, cTDoc <span style="color: #000000;">)</span><br /> QUIT<br /> <span style="color: #00C800;">ENDIF</span><br /><br /> oControl:<span style="color: #000000;">Close</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /><span style="color: #00C800;">RETURN</span> cDoc<br /> </div>[/code:1xj6gls8]
the problem of this function is ( the same of james ) if I not save arecord it lose the code and the next code is ncode+1
But on this application first it use a code type 0000000001 and the the code of customer become , i not Know where,
another code for a sample "0019-04-91" I think the number of code 4 cr with the mounth and year |
to Nages: test for tdatabase | Silvio,
[i:7zgvssao]>But I have to tell the truth that I find this whole system a little unpleasant, because I certainly can't use my old procedures and open files in share mode and save with lock / unlock.[/i:7zgvssao]
Yes, it is uncomfortable to move ahead to better techniques. But the payoff is immense.
[i:7zgvssao]>Making the customer archive I stopped because I don't know how to connect a customer to another archive: I have to enter the guests or family members that are hosted under the umbrella that the customer rents.[/i:7zgvssao]
This is called a one-to-many relationship. Have you never done one before? This can be built into the database class. This is one reason for making a different class for each database.
All invoice classes require at least one, one-to-many relationship. Thus you have basic info like InvNo, date, customer, and then one or more line items. The line items are stored in a different database which is automatically opened when you open the invoice object. Then you can do:
oInvoice := Tinvoice:():New( cInvno ) // Actually opens two databases and establishes relationships, with one line of code. Simple!
msgInfo( oInvoice:aLineitem[1] ) // show the first line item
You can do something similar with guests. So you will have two, one-to-many relationships.
msgInfo( oInvoice:aGuest[1] ) // show the first guest.
[i:7zgvssao]>One more thing: I'd like to use a function to open archives and their indexes. For example, if in a program I only have to use a single archive in other systems, there are so many archives.[/i:7zgvssao]
This is how we used to do things 20 years ago. Unfortunately you use up lots of memory opening all the files at once and you have to keep track of workareas and database states, and all kinds of functions to manipulate the information. Using objects eliminates all that.
Then I have a window template with an explorer menu on the left and an xbrowse on the right and under the xbrowse a tab control where I insert the indexes.
You could not create a function that would give me the return of the archive and the loading of the its indexes in an array aIdx?
If you are using CDXs they are all opened automatically. And if you are using objects the database and indexes are opened automatically even if they aren’t CDXs.
[i:7zgvssao]>On this page I saw a function to open an archive with tdatabase <!-- l --><a class="postlink-local" href="http://forums.fivetechsupport.com/viewtopic.php?f=3&t=37103&start=0">viewtopic.php?f=3&t=37103&start=0</a><!-- l -->
I used a system so long ago that it seems easier to me than James and Mr. Nages.[/i:7zgvssao]
It only seems easier because you are used to it. But it is back to the dark ages–opening all the files at once and keeping track of workareas and database states. If you mess up tracking and restoring states then you have serious bugs which are very hard to find. With database objects all this goes away. Further you can pass entire objects around just like a single variable. It opens all kinds of new possibilities.
Regarding speed. Your old way of writing code took an order of magnitude more lines of code. Thus you can most likely reduce your code to 10 percent of the original size. These means the objects are usually much faster than procedural code. |
to Nages: test for tdatabase | James,
You use the example of an Invoice. Mine must track client, service item, parts, labor, recommendations, finances, and more. Plus I have to call other routines for history, deposits, pending needs, and outside services.
There has been a lot of discussion here on Filters, but I have the active index for all of these items using the invoice number in each database. Rather than a filter, which can be slow, I simply use the Scope method to show only those items related to the open invoice. It is incredibly fast. It is activated, of course, within the method for opening the database. This is another way to simplify code and improve performance.
Tim |
to Nages: test for tdatabase | To connect the guest archive to customers, I had thought of such a form
oGuest: = tdatabase():New(......
oGuest: SetScope (0, oClienti:IdCliente)
oGuest: SetScope (1, oClientiIdCliente)
oGuest: Gotop ()
It might work ?
Slowly, I convert my old program with the databases, I'm afraid I'll get to a point when I realize that I'm doing everything wrong, in the past few years I've lost the databases because they didn't work and now I'm very afraid, scared to start all over again other time and never get to the end of the conversion of my old application |
to Nages: test for tdatabase | James
"That's how we did things 20 years ago .." certainly but surely that little app still runs very well and there is a dentist here in my country who is using it, of course I changed it by changing and adding something but I stayed on that system that is in the way that Miguel_Angel_Cortés_Marchant had done it
If we analyze the Tdb class it is the same Tdatabase of 2005 and Miguel_Angel_Cortés_Marchant added the class TObjDb which is a real Trecord is indeed in the methods of the Tdb we find the calls to this class
[code=fw:2j7g4j2d]<div class="fw" id="{CB}" style="font-family: monospace;"> <span style="color: #00C800;">METHOD</span> NewObj <span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #00C800;">CLASS</span> TDb<br /> :: <span style="color: #000000;">Blank</span> <span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> :: <span style="color: #000000;">SetBookmark</span> <span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">RETURN</span> TObjDb <span style="color: #000000;">(</span><span style="color: #000000;">)</span>: <span style="color: #00C800;">New</span> <span style="color: #000000;">(</span><span style="color: #00C800;">Self</span>, .T.<span style="color: #000000;">)</span><br /><br /> <span style="color: #00C800;">METHOD</span> LoadObj <span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #00C800;">CLASS</span> TDb<br /> :: <span style="color: #000000;">Load</span> <span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> :: <span style="color: #000000;">SetBookmark</span> <span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">RETURN</span> TObjDb <span style="color: #000000;">(</span><span style="color: #000000;">)</span>: <span style="color: #00C800;">New</span> <span style="color: #000000;">(</span><span style="color: #00C800;">Self</span>, .F.<span style="color: #000000;">)</span><br /><br /> <span style="color: #00C800;">METHOD</span> SaveObj <span style="color: #000000;">(</span>oData<span style="color: #000000;">)</span> <span style="color: #00C800;">CLASS</span> TDb<br /> :: <span style="color: #000000;">GetBookmark</span> <span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> :: <span style="color: #000000;">aBuffer</span>: = AClone <span style="color: #000000;">(</span>oData: <span style="color: #000000;">aBuffer</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">IF</span> or <span style="color: #00C800;">Data</span>: <span style="color: #000000;">levo</span><br /> :: <span style="color: #000000;">Append</span> <span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">ENDIF</span><br /> :: <span style="color: #000000;">Save</span> <span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">RETURN</span> <span style="color: #00C800;">NIL</span></div>[/code:2j7g4j2d]
I think instead that the system is very simple and is similar to James's Tdata and Trecord
Of course the Tdb class still uses the listbox (wbrowse) but I think we can use the Xbrowse |
to Nages: test for tdatabase | Silvio,
[code=fw:7peaf79s]<div class="fw" id="{CB}" style="font-family: monospace;">oGuest: = tdatabase<span style="color: #000000;">(</span><span style="color: #000000;">)</span>:<span style="color: #00C800;">New</span><span style="color: #000000;">(</span>......<br />oGuest: <span style="color: #000000;">SetScope</span> <span style="color: #000000;">(</span><span style="color: #000000;">0</span>, oClienti:<span style="color: #000000;">IdCliente</span><span style="color: #000000;">)</span><br />oGuest: <span style="color: #000000;">SetScope</span> <span style="color: #000000;">(</span><span style="color: #000000;">1</span>, oClientiIdCliente<span style="color: #000000;">)</span><br />oGuest: <span style="color: #000000;">Gotop</span> <span style="color: #000000;">(</span><span style="color: #000000;">)</span></div>[/code:7peaf79s]
Objects can contain other objects.
First, make an oGuests (plural since it is a table) class, instead of using TDatabase directly. There are good reasons for doing this that we have discussed in the past. Then you can just do:
oInvoice := TInvoice():New( cInvNo )
Then you should make "oGuests" data of the TInvoice class. Now you can use it anywhere in the class as ::oGuests. And outside the invoice object too.
msgInfo( oInvoice:oGuests:name ) // shows the first guest
Now you will be able to just use it in your Print() method. And you will be able to use it in your invoice edit function.
Also, don't forget to close the oGuests object in the invoice class End() method. |
to Nages: test for tdatabase | Tim,
[quote:1sdyc7ju]You use the example of an Invoice. Mine must track client, service item, parts, labor, recommendations, finances, and more. Plus I have to call other routines for history, deposits, pending needs, and outside services. [/quote:1sdyc7ju]
Is that all inside your invoice class?
[quote:1sdyc7ju]There has been a lot of discussion here on Filters, but I have the active index for all of these items using the invoice number in each database. Rather than a filter, which can be slow, I simply use the Scope method to show only those items related to the open invoice. It is incredibly fast. It is activated, of course, within the method for opening the database. This is another way to simplify code and improve performance.[/quote:1sdyc7ju]
Yes, filters are normally way too slow, expecially on a network. They require that the entire database be sent across the network just to find a few records.
Scopes are much faster and even a SEEK then DO WHILE is about the same speed. Again, are you doing this inside the invoice object?
James |
to Nages: test for tdatabase | [quote="Silvio.Falconi":7u1kv4xu]To connect the guest archive to customers, I had thought of such a form
oGuest: = tdatabase():New(......
oGuest: SetScope (0, oClienti:IdCliente)
oGuest: SetScope (1, oClientiIdCliente)
oGuest: Gotop ()
It might work ?
Slowly, I convert my old program with the databases, I'm afraid I'll get to a point when I realize that I'm doing everything wrong, in the past few years I've lost the databases because they didn't work and now I'm very afraid, scared to start all over again other time and never get to the end of the conversion of my old application[/quote:7u1kv4xu]
Use scoped relations.
There have been a lot of improvements |
to Nages: test for tdatabase | James,
I use "workorders" to create estimates, invoices, counter sales, and technician worksheets. To open a workorder, I use this call:
[code=fw:x1v0bfet]<div class="fw" id="{CB}" style="font-family: monospace;"> oWorkorder := TWorkorder<span style="color: #000000;">(</span><span style="color: #000000;">)</span>:<span style="color: #00C800;">New</span><span style="color: #000000;">(</span> cWorkID <span style="color: #000000;">)</span></div>[/code:x1v0bfet]
WIthin that method, everything is handled. Each workorder has a unique ID, and that is used to link everthing to it, except customers are linked by their ID, and the serviced item by it's unique ID.
Everything is on one screen with folders which are automatically loaded with the appropriate data for speed. The Parts folder displays all the data in it's upper half, which is connected to the browse in the
lower half. The parts data is called with:
[code=fw:x1v0bfet]<div class="fw" id="{CB}" style="font-family: monospace;"> ::<span style="color: #000000;">oWorkParts</span> := TWorkParts<span style="color: #000000;">(</span><span style="color: #000000;">)</span>:<span style="color: #00C800;">New</span><span style="color: #000000;">(</span> ::<span style="color: #000000;">oCurrentOrder</span>:<span style="color: #000000;">wrkord</span> <span style="color: #000000;">)</span><br /> </div>[/code:x1v0bfet]
The other databases are opened as objects also. When opening the parts object, speed is important, so instead of filter, the Method automatically uses the scope so only the parts for that workorder are displayed:
[code=fw:x1v0bfet]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00C800;">Method</span> <span style="color: #00C800;">New</span><span style="color: #000000;">(</span> cWrkOrd <span style="color: #000000;">)</span> <span style="color: #00C800;">CLASS</span> TWorkParts <span style="color: #B900B9;">//Data</span><br /> ::<span style="color: #00C800;">super</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span>:<span style="color: #00C800;">new</span><span style="color: #000000;">(</span>,<span style="color: #ff0000;">"eprpar"</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">if</span> ::<span style="color: #000000;">use</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> ::<span style="color: #000000;">setOrder</span><span style="color: #000000;">(</span> <span style="color: #000000;">1</span> <span style="color: #000000;">)</span><br /> ::<span style="color: #000000;">setscopetop</span><span style="color: #000000;">(</span> cWrkord <span style="color: #000000;">)</span><br /> ::<span style="color: #000000;">setscopebottom</span><span style="color: #000000;">(</span> cWrkord <span style="color: #000000;">)</span><br /> ::<span style="color: #000000;">gotop</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">endif</span> <br /><span style="color: #00C800;">Return</span> <span style="color: #00C800;">self</span><br /> </div>[/code:x1v0bfet]
Of course there are many other processes that take place, and they are also optimized as Methods within the Workorder class. In one case, I found that I was using 5 different functions, in various places, when calculating totals. Thus, if I changed something in one, I had to modify the other 4 also, or have a calculation error. After working through this, I now have 1 totals method that applies everywhere, and a change in it will always work wherever it is applied.
Also, one word of caution: We often use :: to reference the object but this can sometimes result in conflicts with other classes.
[code=fw:x1v0bfet]<div class="fw" id="{CB}" style="font-family: monospace;"><br />A simple code:<br /> ::<span style="color: #000000;">InvoiceNo</span>:<span style="color: #000000;">WorkDate</span><br />within a <span style="color: #00C800;">method</span> would be better as:<br /> <span style="color: #00C800;">LOCAL</span> oOrder := <span style="color: #00C800;">self</span><br /> oOrder:<span style="color: #000000;">InvoiceNo</span>:<span style="color: #000000;">WorkDate</span><br /> </div>[/code:x1v0bfet]
This sample designates the date field for a workorder.
Of course the beauty of this is I can have multiple workorders open on various computers, or even the same one on multiple computers. All record locking is automatic and we never have data conflicts.
Finally, I use a dialog where all of the data fields are displayed ( edited ) in the upper half of the dialog, and the browse displays in the lower half. Thus when I'm moving up and down, the data in the upper half must be refreshed with the browse record in focus. When I open the parts database, for example, I also open tRecord for the part in focus, and it will fill all the fields appropriately. The data is all in buffers, and is only written back to the actual database with the Save() method. Thus system crashes, data entry errors, etc. are not a problem because the values are not committed to the database unless that button is pushed. The other advantage is that the display links to the data in the record buttons, so it's simple to handle updating as the browse is scrolled.
[code=fw:x1v0bfet]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #0000ff;">When</span> initializing the workorder, two calls are made <span style="color: #00C800;">for</span> parts:<br /> ::<span style="color: #000000;">oWorkParts</span> := TWorkParts<span style="color: #000000;">(</span><span style="color: #000000;">)</span>:<span style="color: #00C800;">New</span><span style="color: #000000;">(</span> oEditWork:<span style="color: #000000;">oCurrentOrder</span>:<span style="color: #000000;">wrkord</span> <span style="color: #000000;">)</span><br /> ::<span style="color: #000000;">oWorkPartsr</span> := TRecord<span style="color: #000000;">(</span><span style="color: #000000;">)</span>:<span style="color: #00C800;">new</span><span style="color: #000000;">(</span> oEditWork:<span style="color: #000000;">oWorkParts</span> <span style="color: #000000;">)</span><br /><br />Then, in the browse, <span style="color: #0000ff;">when</span> scrolling, I simply <span style="color: #00C800;">do</span>:<br /> ::<span style="color: #000000;">oWorkPartsr</span>:<span style="color: #000000;">Load</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> ::<span style="color: #000000;">oDlg</span>:<span style="color: #0000ff;">update</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> </div>[/code:x1v0bfet]
The amount of code saved is awesome. |
to Nages: test for tdatabase | [quote:j5121zpp]Yes, filters are normally way too slow, expecially on a network. They require that the entire database be sent across the network just to find a few records.
[/quote:j5121zpp]
This was a very old story till Foxpro introduced rush-more technology many many years ago. SIX and Loadstone's bitmapped filter technology brought fast filters for Clipper. Later Nantucket bought the technology from Loadstone and adopted for DBFCDX in Clipper 5.3. That is what we have now with (x)Harbour.
Filters are optimized using indexes and only the required records (not the entire database) are read from the server.
But to use this effectively, the programmer should first know that there is this kind of optimization available and then should understand how the optimization works and then should plan the indexes and construct the filter expressions to take full advantage of this optimization. |
to Nages: test for tdatabase | Nages,
[quote:2sx26zjj]Filters are optimized using indexes and only the required records (not the entire database) are read from the server. [/quote:2sx26zjj]
Hmm, I haven't used filters in many years. Are you saying that they are now as fast as scopes?
James |
to Nages: test for tdatabase | Tim,
[quote:2lqlfpm6]Also, one word of caution: We often use :: to reference the object but this can sometimes result in conflicts with other classes. [/quote:2lqlfpm6]
Hmm, I have never experienced this. Can you provide an example?
James |
to Nages: test for tdatabase | James,
I used to have issues with some of the FWH classes until Nages suggested I do it this way to be sure the code didn't confuse the class. I don't remember which ones created issues for me, but this is such an easy solution, and for the more complex classes, it's really a way to work within longer methods knowing the object you are referencing.
Tim |
to Nages: test for tdatabase | James, Tim, Nages
Maybe I did not say it clear enough .
for now I must not make an Invoice
After customer management.
When a customer takes an umbrella it generally takes up to 4 people, or La Palma takes it up to 10 people, generally the names and surnames of the people are not saved but my client has asked me to insert an archive where he could insert the names of the guests that are hosted in the umbrella or in the palms.
It is like when in a hotel the reception has to register all the guests room by room.
Until last year no one had asked me for something like this but this year it seems that everyone is asking me the same thing, namely to insert the names of the guests, an identification document and their cell phone.
So I have to enter the guest by taking the customer code, for example Falconi Silvio is the customer with code 0005 and topolino, pluto, and minni are Silvio's guests.
You talk to me about relational brooms but I've never done it and for me it's a difficult thing. in the single user version I simply did:
SELECT PA
PA -> (DbSetOrder (1))
PA -> (OrdScope (0, {|| alltrim ((cNumCli))}))
PA -> (OrdScope (1, {|| alltrim ((cNumCli))}))
PA -> (DbGoTop ())
xbrowse ... |
to Nages: test for tdatabase | Silvio,
[quote:2les8v5l]Maybe I did not say it clear enough .
for now I must not make an Invoice
After customer management.
When a customer takes an umbrella it generally takes up to 4 people, or La Palma takes it up to 10 people, generally the names and surnames of the people are not saved but my client has asked me to insert an archive where he could insert the names of the guests that are hosted in the umbrella or in the palms.
[/quote:2les8v5l]
Maybe "invoice" was the wrong term. A reservation is like a sales order, and sales orders get converted into invoices. Reservations get converted into bills--same thing.
[quote:2les8v5l]So I have to enter the guest by taking the customer code, for example Falconi Silvio is the customer with code 0005 and topolino, pluto, and minni are Silvio's guests.
[/quote:2les8v5l]
Logically the guests need to be attached to the reservation not the customer. The customer is the owner of the reservation. The same customer could get more than one reservation and thus have more than one group of guests. So the guests need to be connected to the reservation (which is connected to the customer).
So you just need a guests file with the reservation number, guest name, ID number, and cell phone number.
The reservation has to contain a single customer object, one or more item objects, and one or more guest objects.
[b:2les8v5l]Reservation object[/b:2les8v5l]
Customer: Silvio Falconi
Items: umbrella, chair, lounge - These need to be stored in an item file related by reservation ID
Guests: topolino, pluto, minni - These need to be stored in a guests file related by reservation ID
Later the reservation object will be used to create a bill object (invoice). The bill object is basically just a reservation printout. It may, or may not, contain all the info in the reservation object. |
to Nages: test for tdatabase | [quote:2m2s7tla]Logically the guests need to be attached to the reservation not the customer. [/quote:2m2s7tla]
the guest must be attached to the customer, I am a customer and rent umbrella number FIve
On my Umbrella I have my mother Edwige , my father Giuseppe, my friends ( Antonio Linares and James Bott)
a beautiful sunny day comes from America, [b:2m2s7tla]the wife of James,[/b:2m2s7tla] and asks the management of the beach [b:2m2s7tla] "Where is my husband?"[/b:2m2s7tla]
The management inserts "James Bott" on the search field, the procedure makes a search on all the umbrellas active on that day: the procedure goes to look first for the names of the customers who have rented the umbrellas that day and for each customer check if it is a friend (or relative) of the client
the procedure after much searching finds the nominative "James bott" under the friends of "Falconi Silvio" who is a customer and that day has booked the umbrella number 5.
The procedure makes a tooltip appear on the umbrella with the word "James Bott" or the procedure makes appear (if the application is windows 10) a desktopAlert at the bottom with the data of the umbrella where he looked for the nominative "James Bott". Nothing could be easier
[quote:2m2s7tla]Reservation object
Customer: Silvio Falconi
Items: umbrella, chair, lounge - These need to be stored in an item file related by reservation ID
Guests: topolino, pluto, minni - These need to be stored in a guests file related by reservation ID[/quote:2m2s7tla]
all right only this is wrong
[quote:2m2s7tla] Guests: topolino, pluto, minni - These need to be stored in a guests file related by reservation ID[/quote:2m2s7tla]
Guests: topolino, pluto, minni - These need to be stored in a guests file related [b:2m2s7tla]by Customer ID[/b:2m2s7tla]
[b:2m2s7tla]Because On Planning of the beach I show umbrellas and select the day or a Intervall of day[/b:2m2s7tla]
[img:2m2s7tla]https://i.postimg.cc/QCKpXVqy/gg.png[/img:2m2s7tla]
[b:2m2s7tla]Because if I link the guest on reservation id and that day I not have that reservation ( where is topolino guest) I cannot never found it !!!!![/b:2m2s7tla]
[quote:2m2s7tla]So you just need a guests file with the reservation number, guest name, ID number, and cell phone number.[/quote:2m2s7tla]
I need a guest archive as I built it:
[img:2m2s7tla]https://i.postimg.cc/BQL00sfP/hhee.jpg[/img:2m2s7tla]
for each guest I need Name,Surname, Type of guest (parent or friend) and 4 type of telephones (telephone, mobile, handheld, fax) and in future aldo the type of document and the number of document
[code=fw:2m2s7tla]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00C800;">Function</span> BuildDbf<span style="color: #000000;">(</span>cDir<span style="color: #000000;">)</span><br /><br /> FIELD NUMCLI,NOMEINTERO,CITTA,TIPO<br /><br /> <span style="color: #00C800;">local</span> oDbf,oDbf2,oDbf3<br /><br /> <span style="color: #00C800;">local</span> aCols := <span style="color: #000000;">{</span><span style="color: #000000;">{</span><span style="color: #ff0000;">'Numcli'</span> ,<span style="color: #ff0000;">'C'</span>,<span style="color: #000000;">4</span> ,<span style="color: #000000;">0</span> <span style="color: #000000;">}</span> ,;<br /> <span style="color: #000000;">{</span><span style="color: #ff0000;">'Cognome'</span>,<span style="color: #ff0000;">'C'</span>,<span style="color: #000000;">30</span> ,<span style="color: #000000;">0</span> <span style="color: #000000;">}</span> ,;<br /> <span style="color: #000000;">{</span><span style="color: #ff0000;">'Nome'</span>,<span style="color: #ff0000;">'C'</span>,<span style="color: #000000;">30</span> ,<span style="color: #000000;">0</span> <span style="color: #000000;">}</span> ,;<br /> <span style="color: #000000;">{</span><span style="color: #ff0000;">'Indirizzo'</span> ,<span style="color: #ff0000;">'C'</span>,<span style="color: #000000;">50</span> ,<span style="color: #000000;">0</span> <span style="color: #000000;">}</span> ,;<br /> <span style="color: #000000;">{</span><span style="color: #ff0000;">'Citta'</span> ,<span style="color: #ff0000;">'C'</span>,<span style="color: #000000;">30</span> ,<span style="color: #000000;">0</span> <span style="color: #000000;">}</span> ,;<br /> <span style="color: #000000;">{</span><span style="color: #ff0000;">'Provincia'</span> ,<span style="color: #ff0000;">'C'</span>,<span style="color: #000000;">2</span> ,<span style="color: #000000;">0</span> <span style="color: #000000;">}</span> ,;<br /> <span style="color: #000000;">{</span><span style="color: #ff0000;">'Cap'</span> ,<span style="color: #ff0000;">'C'</span>,<span style="color: #000000;">5</span> ,<span style="color: #000000;">0</span> <span style="color: #000000;">}</span> ,;<br /> <span style="color: #000000;">{</span><span style="color: #ff0000;">'Stato'</span> ,<span style="color: #ff0000;">'C'</span>,<span style="color: #000000;">30</span> ,<span style="color: #000000;">0</span> <span style="color: #000000;">}</span> ,;<br /> <span style="color: #000000;">{</span><span style="color: #ff0000;">'Email'</span> ,<span style="color: #ff0000;">'C'</span>,<span style="color: #000000;">50</span> ,<span style="color: #000000;">0</span> <span style="color: #000000;">}</span> ,;<br /> <span style="color: #000000;">{</span><span style="color: #ff0000;">'Codfiscale'</span>,<span style="color: #ff0000;">'C'</span>,<span style="color: #000000;">16</span> ,<span style="color: #000000;">0</span> <span style="color: #000000;">}</span> ,;<br /> <span style="color: #000000;">{</span><span style="color: #ff0000;">'Partiva'</span> ,<span style="color: #ff0000;">'C'</span>,<span style="color: #000000;">11</span> ,<span style="color: #000000;">0</span> <span style="color: #000000;">}</span> ,;<br /> <span style="color: #000000;">{</span><span style="color: #ff0000;">'Appunti'</span> ,<span style="color: #ff0000;">'C'</span>,<span style="color: #000000;">200</span>,<span style="color: #000000;">0</span> <span style="color: #000000;">}</span> ,;<br /> <span style="color: #000000;">{</span><span style="color: #ff0000;">'Telefono1'</span> ,<span style="color: #ff0000;">'C'</span>,<span style="color: #000000;">20</span> ,<span style="color: #000000;">0</span> <span style="color: #000000;">}</span> ,;<br /> <span style="color: #000000;">{</span><span style="color: #ff0000;">'Telefono2'</span> ,<span style="color: #ff0000;">'C'</span>,<span style="color: #000000;">20</span> ,<span style="color: #000000;">0</span> <span style="color: #000000;">}</span> ,;<br /> <span style="color: #000000;">{</span><span style="color: #ff0000;">'Telefono3'</span> ,<span style="color: #ff0000;">'C'</span>,<span style="color: #000000;">20</span> ,<span style="color: #000000;">0</span> <span style="color: #000000;">}</span> ,;<br /> <span style="color: #000000;">{</span><span style="color: #ff0000;">'Telefono4'</span> ,<span style="color: #ff0000;">'C'</span>,<span style="color: #000000;">20</span> ,<span style="color: #000000;">0</span> <span style="color: #000000;">}</span> ,;<br /> <span style="color: #000000;">{</span><span style="color: #ff0000;">'TeleTipo1'</span> ,<span style="color: #ff0000;">'C'</span>,<span style="color: #000000;">10</span> ,<span style="color: #000000;">0</span> <span style="color: #000000;">}</span> ,;<br /> <span style="color: #000000;">{</span><span style="color: #ff0000;">'Teletipo2'</span> ,<span style="color: #ff0000;">'C'</span>,<span style="color: #000000;">10</span> ,<span style="color: #000000;">0</span> <span style="color: #000000;">}</span> ,;<br /> <span style="color: #000000;">{</span><span style="color: #ff0000;">'Teletipo3'</span> ,<span style="color: #ff0000;">'C'</span>,<span style="color: #000000;">10</span> ,<span style="color: #000000;">0</span> <span style="color: #000000;">}</span> ,;<br /> <span style="color: #000000;">{</span><span style="color: #ff0000;">'Teletipo4'</span> ,<span style="color: #ff0000;">'C'</span>,<span style="color: #000000;">10</span> ,<span style="color: #000000;">0</span> <span style="color: #000000;">}</span> ,;<br /> <span style="color: #000000;">{</span><span style="color: #ff0000;">'TipoCli'</span> ,<span style="color: #ff0000;">'C'</span>,<span style="color: #000000;">25</span> ,<span style="color: #000000;">0</span> <span style="color: #000000;">}</span> ,;<br /> <span style="color: #000000;">{</span><span style="color: #ff0000;">'Islock'</span> ,<span style="color: #ff0000;">'L'</span>, <span style="color: #000000;">1</span> ,<span style="color: #000000;">0</span> <span style="color: #000000;">}</span> <span style="color: #000000;">}</span><br /><br /> <span style="color: #00C800;">local</span> aColsTipo := <span style="color: #000000;">{</span><span style="color: #000000;">{</span><span style="color: #ff0000;">'TipoCli'</span> ,<span style="color: #ff0000;">'C'</span>,<span style="color: #000000;">25</span> ,<span style="color: #000000;">0</span> <span style="color: #000000;">}</span> ,;<br /> <span style="color: #000000;">{</span><span style="color: #ff0000;">'ImgCli'</span> ,<span style="color: #ff0000;">'C'</span>, <span style="color: #000000;">120</span> ,<span style="color: #000000;">0</span> <span style="color: #000000;">}</span> <span style="color: #000000;">}</span><br /><br /><br /> <span style="color: #00C800;">local</span> aDataTipo:=<span style="color: #000000;">{</span><span style="color: #000000;">{</span><span style="color: #ff0000;">"Cliente abituale"</span>,<span style="color: #ff0000;">".<span style="color: #000000;">\b</span>itmaps<span style="color: #000000;">\h</span>at1.bmp"</span><span style="color: #000000;">}</span>,;<br /> <span style="color: #000000;">{</span><span style="color: #ff0000;">"Hotel"</span>, <span style="color: #ff0000;">".<span style="color: #000000;">\b</span>itmaps<span style="color: #000000;">\h</span>at2.bmp"</span><span style="color: #000000;">}</span>,;<br /> <span style="color: #000000;">{</span><span style="color: #ff0000;">"Convenzione"</span>, <span style="color: #ff0000;">".<span style="color: #000000;">\b</span>itmaps<span style="color: #000000;">\h</span>at3.bmp"</span><span style="color: #000000;">}</span>,;<br /> <span style="color: #000000;">{</span><span style="color: #ff0000;">"Altro"</span>, <span style="color: #ff0000;">".<span style="color: #000000;">\b</span>itmaps<span style="color: #000000;">\h</span>at4.bmp"</span> <span style="color: #000000;">}</span><span style="color: #000000;">}</span><br /><br /><br /><br /> <span style="color: #00C800;">local</span> aColsOspite := <span style="color: #000000;">{</span><span style="color: #000000;">{</span><span style="color: #ff0000;">'Numcli'</span> ,<span style="color: #ff0000;">'C'</span>,<span style="color: #000000;">4</span> ,<span style="color: #000000;">0</span> <span style="color: #000000;">}</span> ,;<br /> <span style="color: #000000;">{</span><span style="color: #ff0000;">'Cognome'</span>,<span style="color: #ff0000;">'C'</span>,<span style="color: #000000;">30</span> ,<span style="color: #000000;">0</span> <span style="color: #000000;">}</span> ,;<br /> <span style="color: #000000;">{</span><span style="color: #ff0000;">'Nome'</span>,<span style="color: #ff0000;">'C'</span>,<span style="color: #000000;">30</span> ,<span style="color: #000000;">0</span> <span style="color: #000000;">}</span> ,;<br /> <span style="color: #000000;">{</span><span style="color: #ff0000;">'TipoOspite'</span>,<span style="color: #ff0000;">'C'</span>,<span style="color: #000000;">20</span> ,<span style="color: #000000;">0</span> <span style="color: #000000;">}</span> ,;<br /> <span style="color: #000000;">{</span><span style="color: #ff0000;">'Telefono1'</span> ,<span style="color: #ff0000;">'C'</span>,<span style="color: #000000;">20</span> ,<span style="color: #000000;">0</span> <span style="color: #000000;">}</span> ,;<br /> <span style="color: #000000;">{</span><span style="color: #ff0000;">'Telefono2'</span> ,<span style="color: #ff0000;">'C'</span>,<span style="color: #000000;">20</span> ,<span style="color: #000000;">0</span> <span style="color: #000000;">}</span> ,;<br /> <span style="color: #000000;">{</span><span style="color: #ff0000;">'Telefono3'</span> ,<span style="color: #ff0000;">'C'</span>,<span style="color: #000000;">20</span> ,<span style="color: #000000;">0</span> <span style="color: #000000;">}</span> ,;<br /> <span style="color: #000000;">{</span><span style="color: #ff0000;">'Telefono4'</span> ,<span style="color: #ff0000;">'C'</span>,<span style="color: #000000;">20</span> ,<span style="color: #000000;">0</span> <span style="color: #000000;">}</span> ,;<br /> <span style="color: #000000;">{</span><span style="color: #ff0000;">'TeleTipo1'</span> ,<span style="color: #ff0000;">'C'</span>,<span style="color: #000000;">10</span> ,<span style="color: #000000;">0</span> <span style="color: #000000;">}</span> ,;<br /> <span style="color: #000000;">{</span><span style="color: #ff0000;">'Teletipo2'</span> ,<span style="color: #ff0000;">'C'</span>,<span style="color: #000000;">10</span> ,<span style="color: #000000;">0</span> <span style="color: #000000;">}</span> ,;<br /> <span style="color: #000000;">{</span><span style="color: #ff0000;">'Teletipo3'</span> ,<span style="color: #ff0000;">'C'</span>,<span style="color: #000000;">10</span> ,<span style="color: #000000;">0</span> <span style="color: #000000;">}</span> ,;<br /> <span style="color: #000000;">{</span><span style="color: #ff0000;">'Teletipo4'</span> ,<span style="color: #ff0000;">'C'</span>,<span style="color: #000000;">10</span> ,<span style="color: #000000;">0</span> <span style="color: #000000;">}</span> <span style="color: #000000;">}</span><br /><br /><br /><br /><br /> <span style="color: #00C800;">IF</span> !file<span style="color: #000000;">(</span>cDir+<span style="color: #ff0000;">"CLIENTI.DBF"</span><span style="color: #000000;">)</span><br /> oDbf := TDatabase<span style="color: #000000;">(</span><span style="color: #000000;">)</span>:<span style="color: #000000;">Create</span><span style="color: #000000;">(</span> cDir+<span style="color: #ff0000;">"CLIENTI.DBF"</span>, aCols, <span style="color: #ff0000;">"DBFCDX"</span> <span style="color: #000000;">)</span> <span style="color: #B900B9;">//"*"</span><br /> oDbf:<span style="color: #000000;">Append</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> oDbf:<span style="color: #000000;">numcli</span>:= <span style="color: #ff0000;">"0001"</span><br /> oDbf:<span style="color: #000000;">Cognome</span>:= <span style="color: #ff0000;">"<< Cliente Generico >>"</span><br /> oDbf:<span style="color: #000000;">Islock</span>:= .t.<br /> oDbf:<span style="color: #000000;">save</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /><br /><br /> <span style="color: #0000ff;">INDEX</span> <span style="color: #0000ff;">ON</span> NUMCLI TAG CL001 <span style="color: #00C800;">FOR</span> !Deleted<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> <span style="color: #0000ff;">INDEX</span> <span style="color: #0000ff;">ON</span> upper<span style="color: #000000;">(</span>COGNOME<span style="color: #000000;">)</span>+UPPER<span style="color: #000000;">(</span>NOME<span style="color: #000000;">)</span> TAG CL002 <span style="color: #00C800;">FOR</span> !Deleted<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> <span style="color: #0000ff;">INDEX</span> <span style="color: #0000ff;">ON</span> upper<span style="color: #000000;">(</span>TIPOCLI<span style="color: #000000;">)</span> TAG CL003 <span style="color: #00C800;">FOR</span> !Deleted<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> <span style="color: #0000ff;">INDEX</span> <span style="color: #0000ff;">ON</span> upper<span style="color: #000000;">(</span>CITTA<span style="color: #000000;">)</span> TAG CL004 <span style="color: #00C800;">FOR</span> !Deleted<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /> oDbf:<span style="color: #000000;">Close</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /> <span style="color: #00C800;">ENDIF</span><br /><br /> <span style="color: #B900B9;">//type of cliente</span><br /> <span style="color: #00C800;">IF</span> !file<span style="color: #000000;">(</span>cDir+<span style="color: #ff0000;">"TIPOCLI.DBF"</span><span style="color: #000000;">)</span><br /> oDbf2:= TDatabase<span style="color: #000000;">(</span><span style="color: #000000;">)</span>:<span style="color: #000000;">Create</span><span style="color: #000000;">(</span> cDir+<span style="color: #ff0000;">"TIPOCLI.DBF"</span>, aColsTipo, <span style="color: #ff0000;">"DBFCDX"</span> <span style="color: #000000;">)</span><br /> oDbf2:<span style="color: #000000;">ArrayToDbf</span><span style="color: #000000;">(</span>aDataTipo <span style="color: #000000;">)</span><br /> <span style="color: #0000ff;">INDEX</span> <span style="color: #0000ff;">ON</span> TIPOCLI TAG TC001 <span style="color: #00C800;">FOR</span> !Deleted<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> oDbf2:<span style="color: #000000;">Close</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">ENDIF</span><br /><br /><br /><br /> <span style="color: #00C800;">IF</span> !file<span style="color: #000000;">(</span>cDir+<span style="color: #ff0000;">"Ospiti.DBF"</span><span style="color: #000000;">)</span><br /> oDbf3:= TDatabase<span style="color: #000000;">(</span><span style="color: #000000;">)</span>:<span style="color: #000000;">Create</span><span style="color: #000000;">(</span> cDir+<span style="color: #ff0000;">"Ospiti.DBF"</span>, aColsOspite, <span style="color: #ff0000;">"DBFCDX"</span> <span style="color: #000000;">)</span><br /> <span style="color: #0000ff;">INDEX</span> <span style="color: #0000ff;">ON</span> NUMCLI TAG OS001 <span style="color: #00C800;">FOR</span> !Deleted<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> <span style="color: #0000ff;">INDEX</span> <span style="color: #0000ff;">ON</span> upper<span style="color: #000000;">(</span>COGNOME<span style="color: #000000;">)</span>+UPPER<span style="color: #000000;">(</span>NOME<span style="color: #000000;">)</span> TAG OS002 <span style="color: #00C800;">FOR</span> !Deleted<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> oDbf3:<span style="color: #000000;">Close</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">ENDIF</span><br /><br /><br /><br /><br /> <span style="color: #00C800;">RETURN</span> <span style="color: #00C800;">NIL</span><br /> </div>[/code:2m2s7tla] |
to Nages: test for tdatabase | on my test with tdatabase I made
oDDom:= TDatabase():Open( , cPath+"OSPITI", "DBFCDX", .T. )
oDDom:Seek(cCli)
xbrowse oBrd
oBrd:bGoTop :={|| GoToTop(oDDom,cCli)}
oBrd:bGoBottom:={|| GoToBot(oDDom,cCli)}
oBrd:bSkip :={|n| MovePtr(oDDom,cCli,n)}
[code=fw:26nd3pqe]<div class="fw" id="{CB}" style="font-family: monospace;"> <span style="color: #00C800;">FUNCTION</span> GoToTop<span style="color: #000000;">(</span>cAlias,cKey<span style="color: #000000;">)</span><br /> DbSelectArea<span style="color: #000000;">(</span>cAlias<span style="color: #000000;">)</span><br /> <span style="color: #000000;">(</span>cAlias<span style="color: #000000;">)</span>-><span style="color: #000000;">(</span>DbSeek<span style="color: #000000;">(</span>cKey<span style="color: #000000;">)</span><span style="color: #000000;">)</span><br /><span style="color: #00C800;">RETURN</span> <span style="color: #000000;">(</span><span style="color: #00C800;">NIL</span><span style="color: #000000;">)</span><br /><br /><span style="color: #00C800;">FUNCTION</span> GoToBot<span style="color: #000000;">(</span>cAlias,cKey<span style="color: #000000;">)</span><br /> <span style="color: #00C800;">LOCAL</span> cTem:=STUFF<span style="color: #000000;">(</span>cKey,Len<span style="color: #000000;">(</span>cKey<span style="color: #000000;">)</span>,<span style="color: #000000;">1</span>,Chr<span style="color: #000000;">(</span><span style="color: #0000ff;">Asc</span><span style="color: #000000;">(</span><span style="color: #0000ff;">Right</span><span style="color: #000000;">(</span>cKey,<span style="color: #000000;">1</span><span style="color: #000000;">)</span><span style="color: #000000;">)</span><span style="color: #000000;">+1</span><span style="color: #000000;">)</span><span style="color: #000000;">)</span><br /> DbSelectArea<span style="color: #000000;">(</span>cAlias<span style="color: #000000;">)</span><br /> <span style="color: #000000;">(</span>cAlias<span style="color: #000000;">)</span>-><span style="color: #000000;">(</span>DbSeek<span style="color: #000000;">(</span>cTem,.T.<span style="color: #000000;">)</span><span style="color: #000000;">)</span><br /> <span style="color: #000000;">(</span>cAlias<span style="color: #000000;">)</span>-><span style="color: #000000;">(</span>DbSkip<span style="color: #000000;">(</span><span style="color: #000000;">-1</span><span style="color: #000000;">)</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">IF</span> &<span style="color: #000000;">(</span><span style="color: #000000;">(</span>cAlias<span style="color: #000000;">)</span>-><span style="color: #000000;">(</span>IndexKey<span style="color: #000000;">(</span><span style="color: #000000;">0</span><span style="color: #000000;">)</span><span style="color: #000000;">)</span><span style="color: #000000;">)</span>=cKey<br /> <span style="color: #000000;">(</span>cAlias<span style="color: #000000;">)</span>-><span style="color: #000000;">(</span>DbSkip<span style="color: #000000;">(</span><span style="color: #000000;">0</span><span style="color: #000000;">)</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">ELSE</span><br /> <span style="color: #000000;">(</span>cAlias<span style="color: #000000;">)</span>-><span style="color: #000000;">(</span>DbSeek<span style="color: #000000;">(</span>cKey<span style="color: #000000;">)</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">ENDIF</span><br /><span style="color: #00C800;">RETURN</span> <span style="color: #000000;">(</span><span style="color: #00C800;">NIL</span><span style="color: #000000;">)</span><br /><br /><span style="color: #00C800;">FUNCTION</span> MovePtr<span style="color: #000000;">(</span>cAlias,cKey,nReg<span style="color: #000000;">)</span><br /> <span style="color: #00C800;">LOCAL</span> nNext:=<span style="color: #000000;">0</span><br /> DbSelectArea<span style="color: #000000;">(</span>cAlias<span style="color: #000000;">)</span><br /> <span style="color: #00C800;">IF</span> nReg=<span style="color: #000000;">0</span> .OR. <span style="color: #000000;">(</span>cAlias<span style="color: #000000;">)</span>-><span style="color: #000000;">(</span>LastRec<span style="color: #000000;">(</span><span style="color: #000000;">)</span><span style="color: #000000;">)</span>=<span style="color: #000000;">0</span> .OR. !<span style="color: #000000;">(</span>&<span style="color: #000000;">(</span><span style="color: #000000;">(</span>cAlias<span style="color: #000000;">)</span>-><span style="color: #000000;">(</span>IndexKey<span style="color: #000000;">(</span><span style="color: #000000;">0</span><span style="color: #000000;">)</span><span style="color: #000000;">)</span><span style="color: #000000;">)</span>=cKey<span style="color: #000000;">)</span><br /> <span style="color: #000000;">(</span>cAlias<span style="color: #000000;">)</span>-><span style="color: #000000;">(</span>DbSkip<span style="color: #000000;">(</span><span style="color: #000000;">0</span><span style="color: #000000;">)</span><span style="color: #000000;">)</span><br /> ELSEIF nReg><span style="color: #000000;">0</span> .AND. <span style="color: #000000;">(</span>cAlias<span style="color: #000000;">)</span>-><span style="color: #000000;">(</span>RecNo<span style="color: #000000;">(</span><span style="color: #000000;">)</span><span style="color: #000000;">)</span><><span style="color: #000000;">(</span>cAlias<span style="color: #000000;">)</span>-><span style="color: #000000;">(</span>LastRec<span style="color: #000000;">(</span><span style="color: #000000;">)</span><span style="color: #000000;">)</span><span style="color: #000000;">+1</span><br /> <span style="color: #00C800;">DO</span> <span style="color: #00C800;">WHILE</span> nNext<=nReg .AND. !<span style="color: #000000;">(</span>cAlias<span style="color: #000000;">)</span>-><span style="color: #000000;">(</span>EoF<span style="color: #000000;">(</span><span style="color: #000000;">)</span><span style="color: #000000;">)</span> .AND. &<span style="color: #000000;">(</span><span style="color: #000000;">(</span>cAlias<span style="color: #000000;">)</span>-><span style="color: #000000;">(</span>IndexKey<span style="color: #000000;">(</span><span style="color: #000000;">0</span><span style="color: #000000;">)</span><span style="color: #000000;">)</span><span style="color: #000000;">)</span>=cKey<br /> <span style="color: #000000;">(</span>cAlias<span style="color: #000000;">)</span>-><span style="color: #000000;">(</span>DbSkip<span style="color: #000000;">(</span><span style="color: #000000;">)</span><span style="color: #000000;">)</span><br /> nNext++<br /> <span style="color: #00C800;">ENDDO</span><br /> <span style="color: #000000;">(</span>cAlias<span style="color: #000000;">)</span>-><span style="color: #000000;">(</span>DbSkip<span style="color: #000000;">(</span><span style="color: #000000;">-1</span><span style="color: #000000;">)</span><span style="color: #000000;">)</span><br /> nNext--<br /> ELSEIF nReg<<span style="color: #000000;">0</span><br /> <span style="color: #00C800;">DO</span> <span style="color: #00C800;">WHILE</span> nNext>=nReg .AND. !<span style="color: #000000;">(</span>cAlias<span style="color: #000000;">)</span>-><span style="color: #000000;">(</span>BoF<span style="color: #000000;">(</span><span style="color: #000000;">)</span><span style="color: #000000;">)</span> .AND. &<span style="color: #000000;">(</span><span style="color: #000000;">(</span>cAlias<span style="color: #000000;">)</span>-><span style="color: #000000;">(</span>IndexKey<span style="color: #000000;">(</span><span style="color: #000000;">0</span><span style="color: #000000;">)</span><span style="color: #000000;">)</span><span style="color: #000000;">)</span>=cKey<br /> <span style="color: #000000;">(</span>cAlias<span style="color: #000000;">)</span>-><span style="color: #000000;">(</span>DbSkip<span style="color: #000000;">(</span><span style="color: #000000;">-1</span><span style="color: #000000;">)</span><span style="color: #000000;">)</span><br /> nNext--<br /> <span style="color: #00C800;">ENDDO</span><br /> <span style="color: #00C800;">IF</span> !<span style="color: #000000;">(</span>cAlias<span style="color: #000000;">)</span>-><span style="color: #000000;">(</span>BoF<span style="color: #000000;">(</span><span style="color: #000000;">)</span><span style="color: #000000;">)</span><br /> <span style="color: #000000;">(</span>cAlias<span style="color: #000000;">)</span>-><span style="color: #000000;">(</span>DbSkip<span style="color: #000000;">(</span><span style="color: #000000;">)</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">ENDIF</span><br /> nNext++<br /> <span style="color: #00C800;">ENDIF</span><br /><span style="color: #00C800;">RETURN</span> <span style="color: #000000;">(</span>nNext<span style="color: #000000;">)</span></div>[/code:26nd3pqe]
it seem to run ok here |
to Nages: test for tdatabase | [quote="nageswaragunupudi":2t1lvz09][quote="Silvio.Falconi":2t1lvz09]First of all I have to specify one thing:
For the management of customers, the system (the test) that Rao did as well for other archives is fine for me.
the only thing I asked for was to use only a control.dbf file for all the archives and to have different types of lengths for example 4-digit customers, 10-digit orders
[/quote:2t1lvz09]
[quote="Silvio.Falconi":2t1lvz09]Nages
on the test I add a new Method to duplicate a record ( seem run ok)
[/quote:2t1lvz09]
I have implemented your requirements. This is the program to test.
[code=fw:2t1lvz09]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"fivewin.ch"</span><br /><br />REQUEST DBFCDX<br /><br /><span style="color: #00C800;">static</span> cPath <span style="color: #B900B9;">// give here your path</span><br /><br /><span style="color: #00C800;">static</span> l3BtnStyle := .t.<br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><br /><span style="color: #00C800;">function</span> Main<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /> <span style="color: #00C800;">DEFAULT</span> cPath := cFilePath<span style="color: #000000;">(</span> ExeName<span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #000000;">)</span><br /><br /> TClients<span style="color: #000000;">(</span><span style="color: #000000;">)</span>:<span style="color: #00C800;">New</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span>:<span style="color: #000000;">Browse</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span>:<span style="color: #000000;">Close</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> TItems<span style="color: #000000;">(</span><span style="color: #000000;">)</span>:<span style="color: #00C800;">New</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span>:<span style="color: #000000;">Browse</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span>:<span style="color: #000000;">Close</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /> <span style="color: #B900B9;">// View Raw Tables</span><br /> SET DELETED OFF<br /> XBROWSER cPath + <span style="color: #ff0000;">"SCLIENTS.DBF"</span><br /> XBROWSER cPath + <span style="color: #ff0000;">"SITEMS.DBF"</span><br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><br /><span style="color: #0000ff;">INIT</span> PROCEDURE PrgInit<br /><br /> RDDSETDEFAULT<span style="color: #000000;">(</span> <span style="color: #ff0000;">"DBFCDX"</span> <span style="color: #000000;">)</span><br /> SET DELETED <span style="color: #0000ff;">ON</span><br /><br /> SET DATE ITALIAN<br /> SET CENTURY <span style="color: #0000ff;">ON</span><br /> SET TIME FORMAT <span style="color: #0000ff;">TO</span> <span style="color: #ff0000;">"HH:MM:SS"</span><br /><br /> FWNumFormat<span style="color: #000000;">(</span> <span style="color: #ff0000;">"E"</span>, .t. <span style="color: #000000;">)</span><br /> SetGetColorFocus<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /><span style="color: #00C800;">return</span><br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><span style="color: #B900B9;">// TCLIENTS CLASS DERIVED FROM TDATASEQ in TSEQ.PRG</span><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><br /><span style="color: #00C800;">CLASS</span> TClients <span style="color: #0000ff;">FROM</span> TDataSEQ<br /><br /> <span style="color: #00C800;">METHOD</span> <span style="color: #00C800;">New</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> CONSTRUCTOR<br /> <span style="color: #00C800;">METHOD</span> Browse<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">METHOD</span> EditDlg<span style="color: #000000;">(</span> oRec <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">METHOD</span> ValidRec<span style="color: #000000;">(</span> oRec <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">METHOD</span> CreateDBF<span style="color: #000000;">(</span> cName <span style="color: #000000;">)</span><br /><br /><span style="color: #00C800;">ENDCLASS</span><br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><br /><span style="color: #00C800;">METHOD</span> <span style="color: #00C800;">New</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #00C800;">CLASS</span> TClients<br /><br /> <span style="color: #00C800;">local</span> cDBF := cPath + <span style="color: #ff0000;">"SCLIENTS.DBF"</span><br /><br /> <span style="color: #00C800;">if</span> !File<span style="color: #000000;">(</span> cDbf <span style="color: #000000;">)</span>; ::<span style="color: #000000;">CreateDBF</span><span style="color: #000000;">(</span> cDbf <span style="color: #000000;">)</span>; <span style="color: #00C800;">endif</span><br /> ::<span style="color: #00C800;">Super</span>:<span style="color: #00C800;">New</span><span style="color: #000000;">(</span> cDBF, <span style="color: #ff0000;">"CLIENTID"</span> <span style="color: #000000;">)</span> <span style="color: #B900B9;">// dbfName, KeyField</span><br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">Self</span><br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><br /><span style="color: #00C800;">METHOD</span> Browse<span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #00C800;">CLASS</span> TClients<br /><br /> <span style="color: #00C800;">local</span> oSelf := <span style="color: #00C800;">Self</span><br /> <span style="color: #00C800;">local</span> oDlg, oFont, oBrw, oRec<br /><br /> <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">FONT</span> oFont <span style="color: #0000ff;">NAME</span> <span style="color: #ff0000;">"TAHOMA"</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">0</span>,<span style="color: #000000;">-14</span><br /> <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">700</span>,<span style="color: #000000;">500</span> <span style="color: #0000ff;">PIXEL</span> TRUEPIXEL <span style="color: #0000ff;">FONT</span> oFont <span style="color: #0000ff;">TITLE</span> <span style="color: #ff0000;">"Clients"</span><br /><br /> @ <span style="color: #000000;">60</span>,<span style="color: #000000;">20</span> <span style="color: #0000ff;">XBROWSE</span> oBrw <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">-20</span>,<span style="color: #000000;">-20</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">OF</span> oDlg DATASOURCE <span style="color: #00C800;">Self</span> ;<br /> COLUMNS <span style="color: #ff0000;">"ClientID"</span>, <span style="color: #ff0000;">"First"</span>, <span style="color: #ff0000;">"Last"</span>, <span style="color: #ff0000;">"City"</span> CELL LINES NOBORDER<br /><br /> oBrw:<span style="color: #000000;">CreateFromCode</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /> @ <span style="color: #000000;">20</span>, <span style="color: #000000;">20</span> <span style="color: #0000ff;">BTNBMP</span> <span style="color: #0000ff;">PROMPT</span> <span style="color: #ff0000;">"New"</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">100</span>,<span style="color: #000000;">35</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">OF</span> oDlg FLAT <span style="color: #0000ff;">ACTION</span> oBrw:<span style="color: #000000;">EditSource</span><span style="color: #000000;">(</span> .T. <span style="color: #000000;">)</span><br /> @ <span style="color: #000000;">20</span>,<span style="color: #000000;">140</span> <span style="color: #0000ff;">BTNBMP</span> <span style="color: #0000ff;">PROMPT</span> <span style="color: #ff0000;">"Edit"</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">100</span>,<span style="color: #000000;">35</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">OF</span> oDlg FLAT <span style="color: #0000ff;">ACTION</span> oBrw:<span style="color: #000000;">EditSource</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> @ <span style="color: #000000;">20</span>,<span style="color: #000000;">260</span> <span style="color: #0000ff;">BTNBMP</span> <span style="color: #0000ff;">PROMPT</span> <span style="color: #ff0000;">"Duplicate"</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">100</span>,<span style="color: #000000;">35</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">OF</span> oDlg FLAT ;<br /> <span style="color: #0000ff;">ACTION</span> <span style="color: #000000;">(</span> oRec := oSelf:<span style="color: #000000;">Record</span><span style="color: #000000;">(</span> .t. <span style="color: #000000;">)</span>, ;<br /> oRec:<span style="color: #000000;">Paste</span><span style="color: #000000;">(</span> oSelf:<span style="color: #000000;">Record</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #000000;">)</span>, ;<br /> oRec:<span style="color: #000000;">oBrw</span> := oBrw, ;<br /> oRec:<span style="color: #00C800;">Edit</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #000000;">)</span><br /> @ <span style="color: #000000;">20</span>,<span style="color: #000000;">380</span> <span style="color: #0000ff;">BTNBMP</span> <span style="color: #0000ff;">PROMPT</span> <span style="color: #ff0000;">"Delete"</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">100</span>,<span style="color: #000000;">35</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">OF</span> oDlg FLAT <span style="color: #0000ff;">ACTION</span> oBrw:<span style="color: #000000;">Delete</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /> <span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">CENTERED</span><br /> <span style="color: #0000ff;">RELEASE</span> <span style="color: #0000ff;">FONT</span> oFont<br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">Self</span><br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><br /><span style="color: #00C800;">METHOD</span> EditDlg<span style="color: #000000;">(</span> oRec <span style="color: #000000;">)</span> <span style="color: #00C800;">CLASS</span> TClients<br /><br /> <span style="color: #00C800;">local</span> oSelf := <span style="color: #00C800;">Self</span><br /> <span style="color: #00C800;">local</span> oDlg, oFont, oBmp, oBmp3, nID<br /> <span style="color: #00C800;">local</span> lExit := .f.<br /><br /> oRec:<span style="color: #000000;">bValid</span> := <span style="color: #000000;">{</span> |o| oSelf:<span style="color: #000000;">ValidRec</span><span style="color: #000000;">(</span> o <span style="color: #000000;">)</span> <span style="color: #000000;">}</span><br /><br /> <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">FONT</span> oFont <span style="color: #0000ff;">NAME</span> <span style="color: #ff0000;">"TAHOMA"</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">0</span>,<span style="color: #000000;">-14</span><br /> <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">400</span>,<span style="color: #000000;">240</span> <span style="color: #0000ff;">PIXEL</span> TRUEPIXEL <span style="color: #0000ff;">FONT</span> oFont ;<br /> <span style="color: #0000ff;">TITLE</span> <span style="color: #00C800;">If</span><span style="color: #000000;">(</span> oRec:<span style="color: #000000;">RecNo</span> == <span style="color: #000000;">0</span>, <span style="color: #ff0000;">"NEW CLIENT"</span>, <span style="color: #ff0000;">"EDIT CLIENT"</span> <span style="color: #000000;">)</span><br /><br /> @ <span style="color: #000000;">40</span>, <span style="color: #000000;">40</span> <span style="color: #0000ff;">SAY</span> <span style="color: #ff0000;">"ClientID :"</span> <span style="color: #0000ff;">GET</span> oRec:<span style="color: #000000;">ClientID</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">300</span>,<span style="color: #000000;">26</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">OF</span> oDlg <span style="color: #0000ff;">UPDATE</span> READONLY<br /> @ <span style="color: #000000;">70</span>, <span style="color: #000000;">40</span> <span style="color: #0000ff;">SAY</span> <span style="color: #ff0000;">"First :"</span> <span style="color: #0000ff;">GET</span> oRec:<span style="color: #000000;">First</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">300</span>,<span style="color: #000000;">26</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">OF</span> oDlg <span style="color: #0000ff;">UPDATE</span><br /> @ <span style="color: #000000;">100</span>, <span style="color: #000000;">40</span> <span style="color: #0000ff;">SAY</span> <span style="color: #ff0000;">"Last :"</span> <span style="color: #0000ff;">GET</span> oRec:<span style="color: #000000;">Last</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">300</span>,<span style="color: #000000;">26</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">OF</span> oDlg <span style="color: #0000ff;">UPDATE</span><br /> @ <span style="color: #000000;">130</span>, <span style="color: #000000;">40</span> <span style="color: #0000ff;">SAY</span> <span style="color: #ff0000;">"City :"</span> <span style="color: #0000ff;">GET</span> oRec:<span style="color: #000000;">City</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">300</span>,<span style="color: #000000;">26</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">OF</span> oDlg <span style="color: #0000ff;">UPDATE</span><br /><br /><span style="color: #00C800;">if</span> l3BtnStyle<br /> @ <span style="color: #000000;">180</span>, <span style="color: #000000;">40</span> <span style="color: #0000ff;">BTNBMP</span> oBmp <span style="color: #0000ff;">PROMPT</span> <span style="color: #ff0000;">"SAVE"</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">090</span>,<span style="color: #000000;">30</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">OF</span> oDlg FLAT <span style="color: #0000ff;">WHEN</span> oRec:<span style="color: #000000;">Modified</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> ;<br /> <span style="color: #0000ff;">ACTION</span> <span style="color: #000000;">(</span> oRec:<span style="color: #000000;">Save</span><span style="color: #000000;">(</span> .t. <span style="color: #000000;">)</span>, oDlg:<span style="color: #0000ff;">Update</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #000000;">)</span><br /><br /> @ <span style="color: #000000;">180</span>,<span style="color: #000000;">150</span> <span style="color: #0000ff;">BTNBMP</span> oBmp <span style="color: #0000ff;">PROMPT</span> <span style="color: #ff0000;">"UNDO"</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">090</span>,<span style="color: #000000;">30</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">OF</span> oDlg FLAT <span style="color: #0000ff;">WHEN</span> oRec:<span style="color: #000000;">Modified</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> ;<br /> <span style="color: #0000ff;">ACTION</span> <span style="color: #000000;">(</span> oRec:<span style="color: #000000;">Undo</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span>, oDlg:<span style="color: #0000ff;">Update</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #000000;">)</span><br /><br /> @ <span style="color: #000000;">180</span>,<span style="color: #000000;">260</span> <span style="color: #0000ff;">BTNBMP</span> oBmp3 <span style="color: #0000ff;">PROMPT</span> <span style="color: #000000;">{</span> || <span style="color: #00C800;">If</span><span style="color: #000000;">(</span> oRec:<span style="color: #000000;">Modified</span>, <span style="color: #ff0000;">"CANCEL"</span>, <span style="color: #ff0000;">"CLOSE"</span> <span style="color: #000000;">)</span> <span style="color: #000000;">}</span> ;<br /> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">090</span>,<span style="color: #000000;">30</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">OF</span> oDlg FLAT <span style="color: #0000ff;">UPDATE</span> ;<br /> <span style="color: #0000ff;">WHEN</span> <span style="color: #000000;">(</span> oBmp3:<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span>, .t. <span style="color: #000000;">)</span> ;<br /> <span style="color: #0000ff;">ACTION</span> <span style="color: #000000;">(</span> <span style="color: #00C800;">If</span><span style="color: #000000;">(</span> oRec:<span style="color: #000000;">RecNo</span> == <span style="color: #000000;">0</span>, oSelf:<span style="color: #000000;">ResetID</span><span style="color: #000000;">(</span> Val<span style="color: #000000;">(</span> oRec:<span style="color: #000000;">ClientID</span> <span style="color: #000000;">)</span> <span style="color: #000000;">)</span>, <span style="color: #000000;">)</span>, ;<br /> lExit := .t., oDlg:<span style="color: #000000;">End</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #000000;">)</span><br /> oBmp:<span style="color: #000000;">lCancel</span> := .t.<br /><span style="color: #00C800;">else</span><br /> @ <span style="color: #000000;">180</span>, <span style="color: #000000;">40</span> <span style="color: #0000ff;">BTNBMP</span> oBmp <span style="color: #0000ff;">PROMPT</span> <span style="color: #ff0000;">"SAVE"</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">100</span>,<span style="color: #000000;">35</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">OF</span> oDlg FLAT <span style="color: #0000ff;">WHEN</span> oRec:<span style="color: #000000;">Modified</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> ;<br /> <span style="color: #0000ff;">ACTION</span> <span style="color: #00C800;">If</span><span style="color: #000000;">(</span> oRec:<span style="color: #000000;">Save</span><span style="color: #000000;">(</span> .t. <span style="color: #000000;">)</span>, <span style="color: #000000;">(</span> lExit := .t., oDlg:<span style="color: #000000;">End</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #000000;">)</span>, <span style="color: #00C800;">nil</span> <span style="color: #000000;">)</span><br /><br /> @ <span style="color: #000000;">180</span>,<span style="color: #000000;">260</span> <span style="color: #0000ff;">BTNBMP</span> oBmp <span style="color: #0000ff;">PROMPT</span> <span style="color: #ff0000;">"CANCEL"</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">100</span>,<span style="color: #000000;">35</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">OF</span> oDlg FLAT ;<br /> <span style="color: #0000ff;">ACTION</span> <span style="color: #000000;">(</span> <span style="color: #00C800;">If</span><span style="color: #000000;">(</span> oRec:<span style="color: #000000;">RecNo</span> == <span style="color: #000000;">0</span>, oSelf:<span style="color: #000000;">ResetID</span><span style="color: #000000;">(</span> Val<span style="color: #000000;">(</span> oRec:<span style="color: #000000;">ClientID</span> <span style="color: #000000;">)</span> <span style="color: #000000;">)</span>, <span style="color: #000000;">)</span>, ;<br /> lExit := .t., oDlg:<span style="color: #000000;">End</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #000000;">)</span><br /> oBmp:<span style="color: #000000;">lCancel</span> := .t.<br /><span style="color: #00C800;">endif</span><br /><br /> <span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">CENTERED</span> <span style="color: #0000ff;">VALID</span> <span style="color: #000000;">(</span> lExit <span style="color: #000000;">)</span><br /> <span style="color: #0000ff;">RELEASE</span> <span style="color: #0000ff;">FONT</span> oFont<br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><br /><span style="color: #00C800;">METHOD</span> ValidRec<span style="color: #000000;">(</span> oRec <span style="color: #000000;">)</span> <span style="color: #00C800;">CLASS</span> TClients<br /><br /> <span style="color: #00C800;">if</span> Empty<span style="color: #000000;">(</span> oRec:<span style="color: #000000;">First</span> <span style="color: #000000;">)</span> .or. Empty<span style="color: #000000;">(</span> oRec:<span style="color: #000000;">Last</span> <span style="color: #000000;">)</span> .or. Empty<span style="color: #000000;">(</span> oRec:<span style="color: #000000;">City</span> <span style="color: #000000;">)</span><br /> MsgAlert<span style="color: #000000;">(</span> <span style="color: #ff0000;">"First, Last, City can not be empty"</span>, <span style="color: #ff0000;">"INVALID RECORD"</span> <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">return</span> .f.<br /> <span style="color: #00C800;">endif</span><br /><br /><span style="color: #00C800;">return</span> ::<span style="color: #000000;">UniqueValue</span><span style="color: #000000;">(</span> oRec:<span style="color: #000000;">First</span> -<span style="color: #ff0000;">"|"</span>- oRec:<span style="color: #000000;">Last</span>, <span style="color: #ff0000;">"FIRSTLAST"</span>, oRec:<span style="color: #000000;">RecNo</span>, .t. <span style="color: #000000;">)</span><br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><br /><span style="color: #00C800;">METHOD</span> CreateDBF<span style="color: #000000;">(</span> cName <span style="color: #000000;">)</span> <span style="color: #00C800;">CLASS</span> TClients<br /><br /> field FIRST,LAST<br /> <span style="color: #00C800;">local</span> aStruct := <span style="color: #000000;">{</span> ;<br /> <span style="color: #000000;">{</span> <span style="color: #ff0000;">"ROWID"</span>, <span style="color: #ff0000;">"+"</span>, <span style="color: #000000;">6</span>, <span style="color: #000000;">0</span> <span style="color: #000000;">}</span>, ;<br /> <span style="color: #000000;">{</span> <span style="color: #ff0000;">"CREATEDT"</span>, <span style="color: #ff0000;">"T"</span>, <span style="color: #000000;">8</span>, <span style="color: #000000;">0</span> <span style="color: #000000;">}</span>, ;<br /> <span style="color: #000000;">{</span> <span style="color: #ff0000;">"UPDATEDT"</span>, <span style="color: #ff0000;">"="</span>, <span style="color: #000000;">8</span>, <span style="color: #000000;">0</span> <span style="color: #000000;">}</span>, ;<br /> <span style="color: #000000;">{</span> <span style="color: #ff0000;">"CLIENTID"</span>, <span style="color: #ff0000;">"C"</span>, <span style="color: #000000;">4</span>, <span style="color: #000000;">0</span> <span style="color: #000000;">}</span>, ;<br /> <span style="color: #000000;">{</span> <span style="color: #ff0000;">"FIRST"</span>, <span style="color: #ff0000;">"C"</span>,<span style="color: #000000;">20</span>, <span style="color: #000000;">0</span> <span style="color: #000000;">}</span>, ;<br /> <span style="color: #000000;">{</span> <span style="color: #ff0000;">"LAST"</span>, <span style="color: #ff0000;">"C"</span>,<span style="color: #000000;">20</span>, <span style="color: #000000;">0</span> <span style="color: #000000;">}</span>, ;<br /> <span style="color: #000000;">{</span> <span style="color: #ff0000;">"CITY"</span>, <span style="color: #ff0000;">"C"</span>,<span style="color: #000000;">20</span>, <span style="color: #000000;">0</span> <span style="color: #000000;">}</span> <span style="color: #000000;">}</span><br /><br /> DBCREATE<span style="color: #000000;">(</span> cName, aStruct, <span style="color: #ff0000;">"DBFCDX"</span>, .T., <span style="color: #ff0000;">"SD"</span> <span style="color: #000000;">)</span><br /> FW_CdxCreate<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> <span style="color: #0000ff;">INDEX</span> <span style="color: #0000ff;">ON</span> UPPER<span style="color: #000000;">(</span> FIRST-<span style="color: #ff0000;">"|"</span>-LAST <span style="color: #000000;">)</span> TAG FIRSTLAST<br /> CLOSE SD<br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><span style="color: #B900B9;">// TITEMS CLASS DERIVED FROM TDATASEQ in TSEQ.PRG</span><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><br /><span style="color: #00C800;">CLASS</span> TItems <span style="color: #0000ff;">FROM</span> TDataSEQ<br /><br /> <span style="color: #00C800;">METHOD</span> <span style="color: #00C800;">New</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> CONSTRUCTOR<br /> <span style="color: #00C800;">METHOD</span> Browse<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">METHOD</span> EditDlg<span style="color: #000000;">(</span> oRec <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">METHOD</span> ValidRec<span style="color: #000000;">(</span> oRec <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">METHOD</span> CreateDBF<span style="color: #000000;">(</span> cName <span style="color: #000000;">)</span><br /><br /><span style="color: #00C800;">ENDCLASS</span><br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><br /><span style="color: #00C800;">METHOD</span> <span style="color: #00C800;">New</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #00C800;">CLASS</span> TItems<br /><br /> <span style="color: #00C800;">local</span> cDBF := cPath + <span style="color: #ff0000;">"SITEMS.DBF"</span><br /><br /> <span style="color: #00C800;">if</span> !File<span style="color: #000000;">(</span> cDbf <span style="color: #000000;">)</span>; ::<span style="color: #000000;">CreateDBF</span><span style="color: #000000;">(</span> cDbf <span style="color: #000000;">)</span>; <span style="color: #00C800;">endif</span><br /><br /> ::<span style="color: #00C800;">Super</span>:<span style="color: #00C800;">New</span><span style="color: #000000;">(</span> cDBF, <span style="color: #ff0000;">"ITEMID"</span> <span style="color: #000000;">)</span> <span style="color: #B900B9;">// DbfName, KeyField</span><br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">Self</span><br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><br /><span style="color: #00C800;">METHOD</span> Browse<span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #00C800;">CLASS</span> TItems<br /><br /> <span style="color: #00C800;">local</span> oSelf := <span style="color: #00C800;">Self</span><br /> <span style="color: #00C800;">local</span> oDlg, oFont, oBrw, oRec<br /><br /> <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">FONT</span> oFont <span style="color: #0000ff;">NAME</span> <span style="color: #ff0000;">"TAHOMA"</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">0</span>,<span style="color: #000000;">-14</span><br /> <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">700</span>,<span style="color: #000000;">500</span> <span style="color: #0000ff;">PIXEL</span> TRUEPIXEL <span style="color: #0000ff;">FONT</span> oFont ;<br /> <span style="color: #0000ff;">TITLE</span> <span style="color: #ff0000;">"Items"</span><br /><br /> @ <span style="color: #000000;">60</span>,<span style="color: #000000;">20</span> <span style="color: #0000ff;">XBROWSE</span> oBrw <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">-20</span>,<span style="color: #000000;">-20</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">OF</span> oDlg ;<br /> DATASOURCE <span style="color: #00C800;">Self</span> COLUMNS <span style="color: #ff0000;">"ItemID"</span>, <span style="color: #ff0000;">"ItemName"</span>, <span style="color: #ff0000;">"Rate"</span>, <span style="color: #ff0000;">"VAT"</span> ;<br /> CELL LINES NOBORDER FASTEDIT<br /><br /> oBrw:<span style="color: #000000;">CreateFromCode</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /> @ <span style="color: #000000;">20</span>, <span style="color: #000000;">20</span> <span style="color: #0000ff;">BTNBMP</span> <span style="color: #0000ff;">PROMPT</span> <span style="color: #ff0000;">"New"</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">100</span>,<span style="color: #000000;">35</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">OF</span> oDlg FLAT <span style="color: #0000ff;">ACTION</span> oBrw:<span style="color: #000000;">EditSource</span><span style="color: #000000;">(</span> .T. <span style="color: #000000;">)</span><br /> @ <span style="color: #000000;">20</span>,<span style="color: #000000;">140</span> <span style="color: #0000ff;">BTNBMP</span> <span style="color: #0000ff;">PROMPT</span> <span style="color: #ff0000;">"Edit"</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">100</span>,<span style="color: #000000;">35</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">OF</span> oDlg FLAT <span style="color: #0000ff;">ACTION</span> oBrw:<span style="color: #000000;">EditSource</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> @ <span style="color: #000000;">20</span>,<span style="color: #000000;">260</span> <span style="color: #0000ff;">BTNBMP</span> <span style="color: #0000ff;">PROMPT</span> <span style="color: #ff0000;">"Duplicate"</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">100</span>,<span style="color: #000000;">35</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">OF</span> oDlg FLAT ;<br /> <span style="color: #0000ff;">ACTION</span> <span style="color: #000000;">(</span> oRec := oSelf:<span style="color: #000000;">Record</span><span style="color: #000000;">(</span> .t. <span style="color: #000000;">)</span>, ;<br /> oRec:<span style="color: #000000;">Paste</span><span style="color: #000000;">(</span> oSelf:<span style="color: #000000;">Record</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #000000;">)</span>, ;<br /> oRec:<span style="color: #000000;">oBrw</span> := oBrw, ;<br /> oRec:<span style="color: #00C800;">Edit</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #000000;">)</span><br /> @ <span style="color: #000000;">20</span>,<span style="color: #000000;">380</span> <span style="color: #0000ff;">BTNBMP</span> <span style="color: #0000ff;">PROMPT</span> <span style="color: #ff0000;">"Delete"</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">100</span>,<span style="color: #000000;">35</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">OF</span> oDlg FLAT <span style="color: #0000ff;">ACTION</span> oBrw:<span style="color: #000000;">Delete</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /> <span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">CENTERED</span><br /> <span style="color: #0000ff;">RELEASE</span> <span style="color: #0000ff;">FONT</span> oFont<br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">Self</span><br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><br /><span style="color: #00C800;">METHOD</span> EditDlg<span style="color: #000000;">(</span> oRec <span style="color: #000000;">)</span> <span style="color: #00C800;">CLASS</span> TItems<br /><br /> <span style="color: #00C800;">local</span> oSelf := <span style="color: #00C800;">Self</span><br /> <span style="color: #00C800;">local</span> oDlg, oFont, oBmp, oBmp3, nID<br /> <span style="color: #00C800;">local</span> lExit := .f.<br /><br /> oRec:<span style="color: #000000;">bValid</span> := <span style="color: #000000;">{</span> |o| oSelf:<span style="color: #000000;">ValidRec</span><span style="color: #000000;">(</span> o <span style="color: #000000;">)</span> <span style="color: #000000;">}</span><br /><br /> <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">FONT</span> oFont <span style="color: #0000ff;">NAME</span> <span style="color: #ff0000;">"TAHOMA"</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">0</span>,<span style="color: #000000;">-14</span><br /> <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">400</span>,<span style="color: #000000;">240</span> <span style="color: #0000ff;">PIXEL</span> TRUEPIXEL <span style="color: #0000ff;">FONT</span> oFont ;<br /> <span style="color: #0000ff;">TITLE</span> <span style="color: #00C800;">If</span><span style="color: #000000;">(</span> oRec:<span style="color: #000000;">RecNo</span> == <span style="color: #000000;">0</span>, <span style="color: #ff0000;">"NEW CLIENT"</span>, <span style="color: #ff0000;">"EDIT CLIENT"</span> <span style="color: #000000;">)</span><br /><br /> @ <span style="color: #000000;">40</span>, <span style="color: #000000;">40</span> <span style="color: #0000ff;">SAY</span> <span style="color: #ff0000;">"ItemID :"</span> <span style="color: #0000ff;">GET</span> oRec:<span style="color: #000000;">ItemID</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">300</span>,<span style="color: #000000;">26</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">OF</span> oDlg <span style="color: #0000ff;">UPDATE</span> READONLY<br /><br /> @ <span style="color: #000000;">70</span>, <span style="color: #000000;">40</span> <span style="color: #0000ff;">SAY</span> <span style="color: #ff0000;">"ItemName :"</span> <span style="color: #0000ff;">GET</span> oRec:<span style="color: #000000;">ItemName</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">300</span>,<span style="color: #000000;">26</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">OF</span> oDlg <span style="color: #0000ff;">UPDATE</span> ;<br /> <span style="color: #0000ff;">VALID</span> ::<span style="color: #000000;">UniqueValue</span><span style="color: #000000;">(</span> oRec:<span style="color: #000000;">ItemName</span>, <span style="color: #ff0000;">"ITEMNAME"</span>, oRec:<span style="color: #000000;">RecNo</span>, .t. <span style="color: #000000;">)</span><br /><br /> @ <span style="color: #000000;">100</span>, <span style="color: #000000;">40</span> <span style="color: #0000ff;">SAY</span> <span style="color: #ff0000;">"Rate :"</span> <span style="color: #0000ff;">GET</span> oRec:<span style="color: #0000ff;">Rate</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">300</span>,<span style="color: #000000;">26</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">OF</span> oDlg <span style="color: #0000ff;">UPDATE</span> ;<br /> <span style="color: #0000ff;">PICTURE</span> <span style="color: #ff0000;">"@E 99,999.99"</span> <span style="color: #0000ff;">RIGHT</span> <span style="color: #0000ff;">VALID</span> oRec:<span style="color: #0000ff;">Rate</span> > <span style="color: #000000;">0.0</span><br /><br /> @ <span style="color: #000000;">130</span>, <span style="color: #000000;">40</span> <span style="color: #0000ff;">SAY</span> <span style="color: #ff0000;">"VAT % :"</span> <span style="color: #0000ff;">GET</span> oRec:<span style="color: #000000;">Vat</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">300</span>,<span style="color: #000000;">26</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">OF</span> oDlg <span style="color: #0000ff;">UPDATE</span> ;<br /> <span style="color: #0000ff;">PICTURE</span> <span style="color: #ff0000;">"@E 99.99 %"</span> <span style="color: #0000ff;">RIGHT</span> <span style="color: #0000ff;">VALID</span> oRec:<span style="color: #000000;">Vat</span> >= <span style="color: #000000;">0.0</span><br /><br /><span style="color: #00C800;">if</span> l3BtnStyle<br /> @ <span style="color: #000000;">180</span>, <span style="color: #000000;">40</span> <span style="color: #0000ff;">BTNBMP</span> oBmp <span style="color: #0000ff;">PROMPT</span> <span style="color: #ff0000;">"SAVE"</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">090</span>,<span style="color: #000000;">30</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">OF</span> oDlg FLAT <span style="color: #0000ff;">WHEN</span> oRec:<span style="color: #000000;">Modified</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> ;<br /> <span style="color: #0000ff;">ACTION</span> <span style="color: #000000;">(</span> oRec:<span style="color: #000000;">Save</span><span style="color: #000000;">(</span> .t. <span style="color: #000000;">)</span>, oDlg:<span style="color: #0000ff;">Update</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #000000;">)</span><br /><br /> @ <span style="color: #000000;">180</span>,<span style="color: #000000;">150</span> <span style="color: #0000ff;">BTNBMP</span> oBmp <span style="color: #0000ff;">PROMPT</span> <span style="color: #ff0000;">"UNDO"</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">090</span>,<span style="color: #000000;">30</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">OF</span> oDlg FLAT <span style="color: #0000ff;">WHEN</span> oRec:<span style="color: #000000;">Modified</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> ;<br /> <span style="color: #0000ff;">ACTION</span> <span style="color: #000000;">(</span> oRec:<span style="color: #000000;">Undo</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span>, oDlg:<span style="color: #0000ff;">Update</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #000000;">)</span><br /><br /> @ <span style="color: #000000;">180</span>,<span style="color: #000000;">260</span> <span style="color: #0000ff;">BTNBMP</span> oBmp3 <span style="color: #0000ff;">PROMPT</span> <span style="color: #000000;">{</span> || <span style="color: #00C800;">If</span><span style="color: #000000;">(</span> oRec:<span style="color: #000000;">Modified</span>, <span style="color: #ff0000;">"CANCEL"</span>, <span style="color: #ff0000;">"CLOSE"</span> <span style="color: #000000;">)</span> <span style="color: #000000;">}</span> ;<br /> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">090</span>,<span style="color: #000000;">30</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">OF</span> oDlg FLAT <span style="color: #0000ff;">UPDATE</span> ;<br /> <span style="color: #0000ff;">WHEN</span> <span style="color: #000000;">(</span> oBmp3:<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span>, .t. <span style="color: #000000;">)</span> ;<br /> <span style="color: #0000ff;">ACTION</span> <span style="color: #000000;">(</span> <span style="color: #00C800;">If</span><span style="color: #000000;">(</span> oRec:<span style="color: #000000;">RecNo</span> == <span style="color: #000000;">0</span>, oSelf:<span style="color: #000000;">ResetID</span><span style="color: #000000;">(</span> Val<span style="color: #000000;">(</span> oRec:<span style="color: #000000;">ItemID</span> <span style="color: #000000;">)</span> <span style="color: #000000;">)</span>, <span style="color: #000000;">)</span>, ;<br /> lExit := .t., oDlg:<span style="color: #000000;">End</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #000000;">)</span><br /> oBmp:<span style="color: #000000;">lCancel</span> := .t.<br /><span style="color: #00C800;">else</span><br /> @ <span style="color: #000000;">180</span>, <span style="color: #000000;">40</span> <span style="color: #0000ff;">BTNBMP</span> oBmp <span style="color: #0000ff;">PROMPT</span> <span style="color: #ff0000;">"SAVE"</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">100</span>,<span style="color: #000000;">35</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">OF</span> oDlg FLAT <span style="color: #0000ff;">WHEN</span> oRec:<span style="color: #000000;">Modified</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> ;<br /> <span style="color: #0000ff;">ACTION</span> <span style="color: #00C800;">If</span><span style="color: #000000;">(</span> oRec:<span style="color: #000000;">Save</span><span style="color: #000000;">(</span> .t. <span style="color: #000000;">)</span>, <span style="color: #000000;">(</span> lExit := .t., oDlg:<span style="color: #000000;">End</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #000000;">)</span>, <span style="color: #00C800;">nil</span> <span style="color: #000000;">)</span><br /><br /> @ <span style="color: #000000;">180</span>,<span style="color: #000000;">260</span> <span style="color: #0000ff;">BTNBMP</span> oBmp <span style="color: #0000ff;">PROMPT</span> <span style="color: #ff0000;">"CANCEL"</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">100</span>,<span style="color: #000000;">35</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">OF</span> oDlg FLAT ;<br /> <span style="color: #0000ff;">ACTION</span> <span style="color: #000000;">(</span> <span style="color: #00C800;">If</span><span style="color: #000000;">(</span> oRec:<span style="color: #000000;">RecNo</span> == <span style="color: #000000;">0</span>, oSelf:<span style="color: #000000;">ResetID</span><span style="color: #000000;">(</span> Val<span style="color: #000000;">(</span> oRec:<span style="color: #000000;">ItemID</span> <span style="color: #000000;">)</span> <span style="color: #000000;">)</span>, <span style="color: #000000;">)</span>, ;<br /> lExit := .t., oDlg:<span style="color: #000000;">End</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #000000;">)</span><br /> oBmp:<span style="color: #000000;">lCancel</span> := .t.<br /><span style="color: #00C800;">endif</span><br /><br /> <span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">CENTERED</span> <span style="color: #0000ff;">VALID</span> <span style="color: #000000;">(</span> lExit <span style="color: #000000;">)</span><br /> <span style="color: #0000ff;">RELEASE</span> <span style="color: #0000ff;">FONT</span> oFont<br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><br /><span style="color: #00C800;">METHOD</span> ValidRec<span style="color: #000000;">(</span> oRec <span style="color: #000000;">)</span> <span style="color: #00C800;">CLASS</span> TItems<br /><br /> <span style="color: #00C800;">if</span> Empty<span style="color: #000000;">(</span> oRec:<span style="color: #000000;">ItemName</span> <span style="color: #000000;">)</span> .or. Empty<span style="color: #000000;">(</span> oRec:<span style="color: #0000ff;">Rate</span> <span style="color: #000000;">)</span><br /> MsgAlert<span style="color: #000000;">(</span> <span style="color: #ff0000;">"ItemName, Rate can not be empty"</span>, <span style="color: #ff0000;">"INVALID RECORD"</span> <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">return</span> .f.<br /> <span style="color: #00C800;">endif</span><br /><br /><span style="color: #00C800;">return</span> ::<span style="color: #000000;">UniqueValue</span><span style="color: #000000;">(</span> oRec:<span style="color: #000000;">ItemName</span>, <span style="color: #ff0000;">"ITEMNAME"</span>, oRec:<span style="color: #000000;">RecNo</span>, .t. <span style="color: #000000;">)</span><br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><br /><span style="color: #00C800;">METHOD</span> CreateDBF<span style="color: #000000;">(</span> cName <span style="color: #000000;">)</span> <span style="color: #00C800;">CLASS</span> TItems<br /><br /> field FIRST,LAST<br /><br /> DBCREATE<span style="color: #000000;">(</span> cName, <span style="color: #000000;">{</span> ;<br /> <span style="color: #000000;">{</span> <span style="color: #ff0000;">"ROWID"</span>, <span style="color: #ff0000;">"+"</span>, <span style="color: #000000;">6</span>, <span style="color: #000000;">0</span> <span style="color: #000000;">}</span>, ;<br /> <span style="color: #000000;">{</span> <span style="color: #ff0000;">"CREATEDT"</span>, <span style="color: #ff0000;">"T"</span>, <span style="color: #000000;">8</span>, <span style="color: #000000;">0</span> <span style="color: #000000;">}</span>, ;<br /> <span style="color: #000000;">{</span> <span style="color: #ff0000;">"UPDATEDT"</span>, <span style="color: #ff0000;">"="</span>, <span style="color: #000000;">8</span>, <span style="color: #000000;">0</span> <span style="color: #000000;">}</span>, ;<br /> <span style="color: #000000;">{</span> <span style="color: #ff0000;">"ITEMID"</span>, <span style="color: #ff0000;">"C"</span>, <span style="color: #000000;">8</span>, <span style="color: #000000;">0</span> <span style="color: #000000;">}</span>, ;<br /> <span style="color: #000000;">{</span> <span style="color: #ff0000;">"ITEMNAME"</span>, <span style="color: #ff0000;">"C"</span>,<span style="color: #000000;">20</span>, <span style="color: #000000;">0</span> <span style="color: #000000;">}</span>, ;<br /> <span style="color: #000000;">{</span> <span style="color: #ff0000;">"RATE"</span>, <span style="color: #ff0000;">"N"</span>, <span style="color: #000000;">8</span>, <span style="color: #000000;">2</span> <span style="color: #000000;">}</span>, ;<br /> <span style="color: #000000;">{</span> <span style="color: #ff0000;">"VAT"</span>, <span style="color: #ff0000;">"N"</span>, <span style="color: #000000;">5</span>, <span style="color: #000000;">2</span> <span style="color: #000000;">}</span> <span style="color: #000000;">}</span>, ;<br /> <span style="color: #ff0000;">"DBFCDX"</span>, .T., <span style="color: #ff0000;">"SD"</span> <span style="color: #000000;">)</span><br /> FW_CdxCreate<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> CLOSE SD<br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><span style="color: #B900B9;">// TDATASEQ CLASS: Derive classes for tables from this class</span><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><br /><span style="color: #00C800;">CLASS</span> TDataSEQ <span style="color: #0000ff;">FROM</span> TDatabase<br /><br /> <span style="color: #00C800;">DATA</span> oSequenza<br /><br /> <span style="color: #00C800;">DATA</span> cKeyFld, nKeyLen<br /><br /> <span style="color: #00C800;">METHOD</span> <span style="color: #00C800;">New</span><span style="color: #000000;">(</span> cDbf, cKeyFld <span style="color: #000000;">)</span> CONSTRUCTOR<br /> <span style="color: #00C800;">METHOD</span> Browse<span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #00C800;">INLINE</span> <span style="color: #0000ff;">XBrowse</span><span style="color: #000000;">(</span> <span style="color: #00C800;">Self</span> <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">METHOD</span> EditDlg<span style="color: #000000;">(</span> oRec <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">METHOD</span> NextID<span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #00C800;">INLINE</span> STRZERO<span style="color: #000000;">(</span> ::<span style="color: #000000;">oSequenza</span>:<span style="color: #000000;">NextVal</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span>, ::<span style="color: #000000;">nKeyLen</span> <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">METHOD</span> ResetID<span style="color: #000000;">(</span> nID <span style="color: #000000;">)</span> <span style="color: #00C800;">INLINE</span> ::<span style="color: #000000;">oSequenza</span>:<span style="color: #000000;">Reset</span><span style="color: #000000;">(</span> nID <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">METHOD</span> Record<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">METHOD</span> UniqueValue<span style="color: #000000;">(</span> uValue, cOrder, nRec, lMsg <span style="color: #000000;">)</span><br /><br /><span style="color: #00C800;">ENDCLASS</span><br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><br /><span style="color: #00C800;">METHOD</span> <span style="color: #00C800;">New</span><span style="color: #000000;">(</span> cDbf, cKeyFld <span style="color: #000000;">)</span> <span style="color: #00C800;">CLASS</span> TDataSEQ<br /><br /> field CREATEDT, UPDATEDT<br /><br /> ::<span style="color: #00C800;">Super</span>:<span style="color: #000000;">Open</span><span style="color: #000000;">(</span> , cDbf, <span style="color: #ff0000;">"DBFCDX"</span>, .T. <span style="color: #000000;">)</span><br /> ::<span style="color: #000000;">cKeyFld</span> := cKeyFld<br /> ::<span style="color: #000000;">nKeyLen</span> := ::<span style="color: #000000;">FieldLen</span><span style="color: #000000;">(</span> ::<span style="color: #000000;">FieldPos</span><span style="color: #000000;">(</span> ::<span style="color: #000000;">cKeyFld</span> <span style="color: #000000;">)</span> <span style="color: #000000;">)</span><br /> ::<span style="color: #000000;">oSequenza</span> := TSequenze<span style="color: #000000;">(</span><span style="color: #000000;">)</span>:<span style="color: #00C800;">New</span><span style="color: #000000;">(</span> ::<span style="color: #000000;">cFile</span> <span style="color: #000000;">)</span><br /> ::<span style="color: #000000;">bEdit</span> := <span style="color: #000000;">{</span> |oRec| ::<span style="color: #000000;">EditDlg</span><span style="color: #000000;">(</span> oRec <span style="color: #000000;">)</span> <span style="color: #000000;">}</span><br /><br /> <span style="color: #00C800;">if</span> ::<span style="color: #000000;">FieldPos</span><span style="color: #000000;">(</span> <span style="color: #ff0000;">"CREATEDT"</span> <span style="color: #000000;">)</span> > <span style="color: #000000;">0</span> .and. ::<span style="color: #000000;">FieldPos</span><span style="color: #000000;">(</span> <span style="color: #ff0000;">"UPDATEDT"</span> <span style="color: #000000;">)</span> > <span style="color: #000000;">0</span><br /> ::<span style="color: #000000;">bTrigger</span> := <span style="color: #000000;">{</span> || <span style="color: #00C800;">If</span><span style="color: #000000;">(</span> Empty<span style="color: #000000;">(</span> CREATEDT <span style="color: #000000;">)</span>, CREATEDT := UPDATEDT, <span style="color: #00C800;">nil</span> <span style="color: #000000;">)</span> <span style="color: #000000;">}</span><br /> <span style="color: #00C800;">endif</span><br /><br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">Self</span><br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><br /><span style="color: #00C800;">METHOD</span> Record<span style="color: #000000;">(</span> cFieldList, lNew <span style="color: #000000;">)</span> <span style="color: #00C800;">CLASS</span> TDataSEQ<br /><br /> <span style="color: #00C800;">local</span> oRec, cID, n<br /><br /> <span style="color: #00C800;">if</span> HB_ISLOGICAL<span style="color: #000000;">(</span> cFieldList <span style="color: #000000;">)</span><br /> lNew := cFieldList<br /> cFieldList := <span style="color: #00C800;">nil</span><br /> <span style="color: #00C800;">endif</span><br /><br /> oRec := TDataRow<span style="color: #000000;">(</span><span style="color: #000000;">)</span>:<span style="color: #00C800;">New</span><span style="color: #000000;">(</span> <span style="color: #00C800;">Self</span>, cFieldList, lNew <span style="color: #000000;">)</span><br /> WITH OBJECT oRec<br /> :<span style="color: #000000;">lNavigate</span> := .f.<br /> :<span style="color: #000000;">bEdit</span> := ::<span style="color: #000000;">bEdit</span><br /> <span style="color: #00C800;">if</span> lNew == .t.<br /> cID := ::<span style="color: #000000;">NextID</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> :<span style="color: #000000;">SetDefault</span><span style="color: #000000;">(</span> ::<span style="color: #000000;">cKeyFld</span>, cID, .f. <span style="color: #000000;">)</span><br /> :<span style="color: #000000;">aOrg</span><span style="color: #000000;">[</span> :<span style="color: #000000;">FieldPos</span><span style="color: #000000;">(</span> ::<span style="color: #000000;">cKeyFld</span> <span style="color: #000000;">)</span>, <span style="color: #000000;">2</span> <span style="color: #000000;">]</span> := cID<br /> <span style="color: #00C800;">endif</span><br /> :<span style="color: #000000;">FieldReadOnly</span><span style="color: #000000;">(</span> ::<span style="color: #000000;">cKeyFld</span>, .t. <span style="color: #000000;">)</span><br /> END<br /><br /><span style="color: #00C800;">return</span> oRec<br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><br /><span style="color: #00C800;">METHOD</span> UniqueValue<span style="color: #000000;">(</span> uValue, cOrder, nRec, lMsg <span style="color: #000000;">)</span> <span style="color: #00C800;">CLASS</span> TDataSEQ<br /><br /> <span style="color: #00C800;">local</span> cSaveOrd := ::<span style="color: #000000;">OrdSetFocus</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">local</span> nSaveRec := ::<span style="color: #000000;">RecNo</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">local</span> cFoundID := <span style="color: #ff0000;">""</span><br /> <span style="color: #00C800;">local</span> nFoundAt := <span style="color: #000000;">0</span><br /> <span style="color: #00C800;">local</span> lUnique := .f.<br /> <span style="color: #00C800;">local</span> c<br /><br /> <span style="color: #00C800;">DEFAULT</span> nRec := nSaveRec, lMsg := .f.<br /><br /> ::<span style="color: #000000;">SetOrder</span><span style="color: #000000;">(</span> cOrder <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">if</span> HB_ISCHAR<span style="color: #000000;">(</span> C := ::<span style="color: #000000;">OrdKeyVal</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #000000;">)</span><br /> uValue := PadR<span style="color: #000000;">(</span> cValToChar<span style="color: #000000;">(</span> uValue <span style="color: #000000;">)</span>, Len<span style="color: #000000;">(</span> c <span style="color: #000000;">)</span> <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">if</span> <span style="color: #ff0000;">"UPPER"</span> $ ::<span style="color: #000000;">OrdKey</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> uValue := Upper<span style="color: #000000;">(</span> uValue <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">endif</span><br /> <span style="color: #00C800;">endif</span><br /> <span style="color: #00C800;">if</span> ::<span style="color: #000000;">Seek</span><span style="color: #000000;">(</span> uValue <span style="color: #000000;">)</span><br /> nFoundAt := ::<span style="color: #000000;">RecNo</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> cFoundID := ::<span style="color: #000000;">FieldGet</span><span style="color: #000000;">(</span> ::<span style="color: #000000;">cKeyFld</span> <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">endif</span><br /> ::<span style="color: #000000;">OrdSetFocus</span><span style="color: #000000;">(</span> <span style="color: #00C800;">If</span><span style="color: #000000;">(</span> Empty<span style="color: #000000;">(</span> cSaveOrd <span style="color: #000000;">)</span>, <span style="color: #000000;">0</span>, cSaveOrd <span style="color: #000000;">)</span> <span style="color: #000000;">)</span><br /> ::<span style="color: #000000;">GoTo</span><span style="color: #000000;">(</span> nSaveRec <span style="color: #000000;">)</span><br /><br /> lUnique := <span style="color: #000000;">(</span> nFoundAt == <span style="color: #000000;">0</span> .or. nFoundAt == nRec <span style="color: #000000;">)</span><br /><br /> <span style="color: #00C800;">if</span> lMsg .and. !lUnique<br /> MsgAlert<span style="color: #000000;">(</span> cFoundID + <span style="color: #ff0000;">" has the same value"</span> + CRLF + ;<br /> cValToChar<span style="color: #000000;">(</span> uValue <span style="color: #000000;">)</span> , <span style="color: #ff0000;">"DUPLICATE"</span> <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">endif</span><br /><br /><span style="color: #00C800;">return</span> lUnique<br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><br /><span style="color: #00C800;">METHOD</span> EditDlg<span style="color: #000000;">(</span> oRec <span style="color: #000000;">)</span> <span style="color: #00C800;">CLASS</span> TDataSEQ<br /><br /> oRec:<span style="color: #00C800;">Edit</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /><br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><span style="color: #B900B9;">// TSEQUENZE CLASS</span><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><br /><span style="color: #00C800;">CLASS</span> TSequenze <span style="color: #0000ff;">FROM</span> TDatabase<br /><br /> <span style="color: #00C800;">METHOD</span> <span style="color: #00C800;">New</span><span style="color: #000000;">(</span> cDbf <span style="color: #000000;">)</span> CONSTRUCTOR<br /> <span style="color: #00C800;">METHOD</span> NextVal<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">METHOD</span> Reset<span style="color: #000000;">(</span> nId <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">METHOD</span> CreateSEQDBF<span style="color: #000000;">(</span> cPath <span style="color: #000000;">)</span><br /><br /><span style="color: #00C800;">ENDCLASS</span><br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><br /><span style="color: #00C800;">METHOD</span> <span style="color: #00C800;">New</span><span style="color: #000000;">(</span> cDbf <span style="color: #000000;">)</span> <span style="color: #00C800;">CLASS</span> TSequenze<br /><br /> <span style="color: #00C800;">local</span> cPath := cFilePath<span style="color: #000000;">(</span> cDbf <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">local</span> cName := Upper<span style="color: #000000;">(</span> cFileNoExt<span style="color: #000000;">(</span> cDbf <span style="color: #000000;">)</span> <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">local</span> cSeqDbf := cPath + <span style="color: #ff0000;">"SEQUENZE.DBF"</span><br /> <span style="color: #00C800;">local</span> cFilter := <span style="color: #ff0000;">'TRIM( FIELD->DBF ) == "'</span> + cName + <span style="color: #ff0000;">'"'</span><br /><br /> <span style="color: #00C800;">if</span> !File<span style="color: #000000;">(</span> cSeqDbf <span style="color: #000000;">)</span><br /> ::<span style="color: #000000;">CreateSEQDBF</span><span style="color: #000000;">(</span> cSeqDbf <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">endif</span><br /><br /> ::<span style="color: #00C800;">Super</span>:<span style="color: #000000;">Open</span><span style="color: #000000;">(</span> , cSeqDbf, <span style="color: #ff0000;">"DBFCDX"</span>, .T. <span style="color: #000000;">)</span><br /> ::<span style="color: #000000;">SetFilter</span><span style="color: #000000;">(</span> cFilter <span style="color: #000000;">)</span><br /> ::<span style="color: #000000;">GoTop</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">if</span> ::<span style="color: #000000;">Eof</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><span style="color: #B900B9;">// ::Append( "DBF,COUNTER,UNUSED", { cName, 0, {} } )</span><br /> <span style="color: #B900B9;">//</span><br /> ::<span style="color: #000000;">Append</span><span style="color: #000000;">(</span> <span style="color: #ff0000;">"DBF,COUNTER"</span>, <span style="color: #000000;">{</span> cName, <span style="color: #000000;">0</span> <span style="color: #000000;">}</span> <span style="color: #000000;">)</span><br /> ::<span style="color: #000000;">RecLock</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> <span style="color: #000000;">(</span> ::<span style="color: #000000;">cAlias</span> <span style="color: #000000;">)</span>->UNUSED := <span style="color: #000000;">{</span><span style="color: #000000;">}</span><br /> ::<span style="color: #000000;">Skip</span><span style="color: #000000;">(</span> <span style="color: #000000;">0</span> <span style="color: #000000;">)</span><br /> ::<span style="color: #000000;">RecUnlock</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> <span style="color: #B900B9;">//</span><br /> ::<span style="color: #000000;">GoTop</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">endif</span><br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">Self</span><br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><br /><span style="color: #00C800;">METHOD</span> NextVal<span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #00C800;">CLASS</span> TSequenze<br /><br /> field COUNTER, UNUSED<br /> <span style="color: #00C800;">local</span> nID, bAction<br /><br /> bAction := <||<br /> <span style="color: #00C800;">local</span> a := UNUSED<br /> <span style="color: #00C800;">local</span> nRet<br /> <span style="color: #00C800;">if</span> !Empty<span style="color: #000000;">(</span> a <span style="color: #000000;">)</span><br /> nRet := ATail<span style="color: #000000;">(</span> a <span style="color: #000000;">)</span><br /> a := ASize<span style="color: #000000;">(</span> a, Len<span style="color: #000000;">(</span> a <span style="color: #000000;">)</span> - <span style="color: #000000;">1</span> <span style="color: #000000;">)</span><br /> UNUSED := a<br /> <span style="color: #00C800;">else</span><br /> COUNTER := COUNTER + <span style="color: #000000;">1</span><br /> nRet := COUNTER<br /> <span style="color: #00C800;">endif</span><br /> DBCOMMIT<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">return</span> nRet<br /> ><br /><br /> <span style="color: #00C800;">do</span> <span style="color: #00C800;">while</span> .not. ::<span style="color: #000000;">RecLock</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">enddo</span><br /><br /> nID := ::<span style="color: #000000;">Exec</span><span style="color: #000000;">(</span> bAction <span style="color: #000000;">)</span><br /><br /> ::<span style="color: #000000;">Unlock</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> ::<span style="color: #000000;">Load</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /><span style="color: #00C800;">return</span> nID<br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><br /><span style="color: #00C800;">METHOD</span> Reset<span style="color: #000000;">(</span> nID <span style="color: #000000;">)</span> <span style="color: #00C800;">CLASS</span> TSequenze<br /><br /> field COUNTER, UNUSED<br /> <span style="color: #00C800;">local</span> bAction<br /><br /> bAction := <||<br /> <span style="color: #00C800;">local</span> a<br /> <span style="color: #00C800;">if</span> nID == COUNTER<br /> COUNTER := COUNTER - <span style="color: #000000;">1</span><br /> elseif nID < COUNTER<br /> a := UNUSED<br /> AAdd<span style="color: #000000;">(</span> a, nID <span style="color: #000000;">)</span><br /> UNUSED := a<br /> <span style="color: #00C800;">endif</span><br /> DBCOMMIT<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /> ><br /><br /> <span style="color: #00C800;">do</span> <span style="color: #00C800;">while</span> .not. ::<span style="color: #000000;">RecLock</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">enddo</span><br /><br /> ::<span style="color: #000000;">Exec</span><span style="color: #000000;">(</span> bAction <span style="color: #000000;">)</span><br /><br /> ::<span style="color: #000000;">Unlock</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> ::<span style="color: #000000;">Load</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><br /><span style="color: #00C800;">METHOD</span> CreateSEQDBF<span style="color: #000000;">(</span> cName <span style="color: #000000;">)</span> <span style="color: #00C800;">CLASS</span> TSequenze<br /><br /> DBCREATE<span style="color: #000000;">(</span> cName, <span style="color: #000000;">{</span> ;<br /> <span style="color: #000000;">{</span> <span style="color: #ff0000;">"DBF"</span>, <span style="color: #ff0000;">"C"</span>, <span style="color: #000000;">20</span>, <span style="color: #000000;">0</span> <span style="color: #000000;">}</span>, ;<br /> <span style="color: #000000;">{</span> <span style="color: #ff0000;">"COUNTER"</span>, <span style="color: #ff0000;">"N"</span>, <span style="color: #000000;">10</span>, <span style="color: #000000;">0</span> <span style="color: #000000;">}</span>, ;<br /> <span style="color: #000000;">{</span> <span style="color: #ff0000;">"UNUSED"</span>, <span style="color: #ff0000;">"M"</span>, <span style="color: #000000;">10</span>, <span style="color: #000000;">0</span> <span style="color: #000000;">}</span> <span style="color: #000000;">}</span>, ;<br /> <span style="color: #ff0000;">"DBFCDX"</span> <span style="color: #000000;">)</span><br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /> </div>[/code:2t1lvz09]
This approach has the same cons as discussed above, i.e., the IDs generated may not be ascending the chronological order and some IDs in the serial may be missing.
However, the fields RowID (autoincrement), CreateDt, UpdateDt, which are internal to the dbf and not displayed to the user, are in chronologically serial order and are evidence of the genuineness of data.
Please delete any tables like "sclients.*" created by the previous sample, before testing this program[/quote:2t1lvz09]
Nages ,
can you explain me what are these types of data ?
{ "ROWID", "+", 6, 0 }, ;
{ "CREATEDT", "T", 8, 0 }, ;
I cannot open the dbf with EmagDbu
when I try with fwdbu I see the structure changed
[b:2t1lvz09]= { { "ROWID", "+", 4, 0 },;
{ "CREATEDT", "@", 8, 0 },;
{ "UPDATEDT", "=", 8, 0 },;[/b:2t1lvz09]
{ "CLIENTID", "C", 4, 0 },;
{ "FIRST", "C", 20, 0 },;
{ "LAST", "C", 20, 0 },;
{ "CITY", "C", 20, 0 } }
@ instead of T |
to Nages: test for tdatabase | { "ROWID", "+", 6, 0 }, ;
{ "CREATEDT", "T", 8, 0 }, ;
{ "UPDATEDT", "=", 8, 0 }, ;
Please keep the above three fields at the beginning of the structure of every table using the above system.
"ROWID" : Field Type "+"
Autoincrement numeric field. DBFCDX automatically increments the value in this field every time a new record is appended. Uniqueness and chronological continuity are assured even in multi-user environments. This field is read-only and we can not write this field or modify the values.
"UPDATEDT" : Field Type "="
This field contains datatime value accurate upto millisecond. DBFCDX automatically updates this field whenever any field in the record is modified, with the latest date and time of modification.
"CREATEDT" : Field Type "T"
'T' stands for DateTime type and stores date and time value upto millisecond. The program I provided to you writes the exact date and time when the record was first created. Later on, this value is not changed and you shoud also not change it.
When reading the DBSTRUCT(), Harbour displays this as "@" instead of 'T', but the functionality is the same. Nothing to worry about it. |
to Nages: test for tdatabase | >Please keep the above three fields at the beginning of the structure of every table using the above system.
But if I put them at the end of the structure, what does it imply? |
to Nages:also for Vertical Xbrowse | Dear Nages,
I explain you
I made this test :
On this test I open clienti.dbf and set array for the field I wish to show
I need to have this arrays (aCampi,aNomi,aSizes) to create the xbrowse Main
Function test()
aCampi := { "CODCF", "RAGSOC", "RAGSOC1", "INDIR" }
aNomi:= {"Codice","Ragione Sociale","Ragione Sociale2","Indirizzo Legale"}
aSizes:= {50,250 ,200,100 }
USE CLIENTI ALIAS CLIENTI NEW
LookUp("Clienti",aCampi,aNomi,aSizes,35.7,105,"Anagrafica clienti")
RETURN NIL
ON lookup function there is a xbrowse and a buttonbar
@ 15.6, 0 XBROWSE oBrw OF oDlgLook SIZE -1,-20 PIXEL ;
DATASOURCE cdbf ;
COLUMNS aCampi HEADERS aNomi COLSIZES aSizes
as you can see omn this picture
[img:2khys7xw]http://img33.imageshack.us/img33/9710/vertjo.jpg[/img:2khys7xw]
When I click a button on Button Bar I call a function . this function read the xbrowse columns to create an array ( aarray) and then I cal the Ut_BrwColVert( aArray ) function
But I see [b:2khys7xw]only the fields and not the values[/b:2khys7xw]
Function testsilvio(cDbf, oBrowse)
LOCAL nLen := Len( oBrowse:aCols )
LOCAL aHeader [ nLen ]
LOCAL aShow [ nlen ]
LOCAL aArray [ nLen ]
FOR n := 1 TO nLen
aHeader [ n ] := oBrowse:aCols[ n ]:cHeader
aShow [ n ] := oBrowse:aCols[ n ]:value
aArray [ n ] := {aHeader[n],aShow[n]}
NEXT
Ut_BrwColVert( aArray )
RETUR NIL
function Ut_BrwColVert( aCols )
local oDlg, oBrw, cAlias
cAlias := Alias()
DEFINE DIALOG oDlg SIZE 300,200 PIXEL TITLE cAlias
@ 10,10 XBROWSE oBrw SIZE -10,-10 PIXEL OF oDlg ;
DATASOURCE aCols ;
COLUMNS 1, { || ( cAlias )->&( oBrw:aRow[ 2 ] ) } ;
HEADERS "ColumnName", "ColumnValue" ;
CELL LINES NOBORDER
WITH OBJECT oBrw
:nStretchCol := 2
:CreateFromCode()
END
ACTIVATE DIALOG oDlg CENTERED ON INIT ( oBrw:SetFocus(), .f. )
return nil |
to Nages:also for Vertical Xbrowse | If you want to use Ut_BrwColVert( aCols )
Instead of
[code=fw:35g5sj60]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00C800;">FOR</span> n := <span style="color: #000000;">1</span> <span style="color: #0000ff;">TO</span> nLen<br />aHeader <span style="color: #000000;">[</span> n <span style="color: #000000;">]</span> := oBrowse:<span style="color: #000000;">aCols</span><span style="color: #000000;">[</span> n <span style="color: #000000;">]</span>:<span style="color: #000000;">cHeader</span><br />aShow <span style="color: #000000;">[</span> n <span style="color: #000000;">]</span> := oBrowse:<span style="color: #000000;">aCols</span><span style="color: #000000;">[</span> n <span style="color: #000000;">]</span>:<span style="color: #000000;">value</span><br />aArray <span style="color: #000000;">[</span> n <span style="color: #000000;">]</span> := <span style="color: #000000;">{</span>aHeader<span style="color: #000000;">[</span>n<span style="color: #000000;">]</span>,aShow<span style="color: #000000;">[</span>n<span style="color: #000000;">]</span><span style="color: #000000;">}</span><br /><span style="color: #00C800;">NEXT</span><br /> </div>[/code:35g5sj60]
Use the same arrays aNomi, aCampi
[code]FOR n := 1 TO nLen
aArray [ n ] := {aNomi[n],aCampi[n]}
NEXT
But to view Browse columns in a vertical form, there is another better alternate way. |
to Nages:also for Vertical Xbrowse | Viewing a browse in a vertical form
[code=fw:3m0l7jjt]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"FiveWin.Ch"</span><br /><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"ord.ch"</span><br /><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"xbrowse.ch"</span><br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><br />REQUEST DBFCDX<br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><br /><span style="color: #00C800;">function</span> Test2<br /><br /> <span style="color: #00C800;">local</span> oDlg, oBrw, oFont<br /><br /> USE CUSTOMER <span style="color: #00C800;">NEW</span> <span style="color: #0000ff;">ALIAS</span> CUST SHARED VIA <span style="color: #ff0000;">"DBFCDX"</span><br /> GO TOP<br /><br /> <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">FONT</span> oFont <span style="color: #0000ff;">NAME</span> <span style="color: #ff0000;">"TAHOMA"</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">0</span>,<span style="color: #000000;">-14</span><br /> <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">600</span>,<span style="color: #000000;">400</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">FONT</span> oFont<br /> @ <span style="color: #000000;">10</span>,<span style="color: #000000;">10</span> <span style="color: #0000ff;">XBROWSE</span> oBrw <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">-10</span>,<span style="color: #000000;">-30</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">OF</span> oDlg ;<br /> DATASOURCE <span style="color: #ff0000;">"CUST"</span> ;<br /> COLUMNS <span style="color: #ff0000;">"First"</span>, <span style="color: #ff0000;">"Last"</span>, <span style="color: #ff0000;">"State"</span>, <span style="color: #ff0000;">"Salary"</span> ;<br /> HEADERS <span style="color: #ff0000;">"Name"</span>, <span style="color: #ff0000;">"SurName"</span>, <span style="color: #ff0000;">"State"</span>, <span style="color: #ff0000;">"Salary"</span> ;<br /> CELL LINES FASTEDIT NOBORDER<br /><br /> oBrw:<span style="color: #000000;">CreateFromCode</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /> @ <span style="color: #000000;">180</span>, <span style="color: #000000;">10</span> <span style="color: #0000ff;">BUTTON</span> <span style="color: #ff0000;">"VertBrw"</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">40</span>,<span style="color: #000000;">12</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">OF</span> oDlg <span style="color: #0000ff;">ACTION</span> XbrVert<span style="color: #000000;">(</span> oBrw <span style="color: #000000;">)</span><br /><br /> <span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">CENTERED</span><br /> <span style="color: #0000ff;">RELEASE</span> <span style="color: #0000ff;">FONT</span> oFont<br /><br /> CLOSE CUST<br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><br /><span style="color: #00C800;">function</span> XBrVert<span style="color: #000000;">(</span> oMain <span style="color: #000000;">)</span><br /><br /> <span style="color: #00C800;">local</span> oDlg, oBrw, oFont<br /><br /> <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">FONT</span> oFont <span style="color: #0000ff;">NAME</span> <span style="color: #ff0000;">"TAHOMA"</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">0</span>,<span style="color: #000000;">-14</span><br /> <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">600</span>,<span style="color: #000000;">600</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">FONT</span> oFont<br /><br /> @ <span style="color: #000000;">10</span>, <span style="color: #000000;">10</span> <span style="color: #0000ff;">XBROWSE</span> oBrw <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">280</span>,<span style="color: #000000;">280</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">OF</span> oDlg ;<br /> DATASOURCE oMain:<span style="color: #000000;">aCols</span> ;<br /> COLUMNS <span style="color: #000000;">{</span> || oBrw:<span style="color: #000000;">aRow</span>:<span style="color: #000000;">cHeader</span> <span style="color: #000000;">}</span>, <span style="color: #000000;">{</span> || oBrw:<span style="color: #000000;">aRow</span>:<span style="color: #000000;">Value</span> <span style="color: #000000;">}</span> ;<br /> HEADERS <span style="color: #ff0000;">"Column"</span>, <span style="color: #ff0000;">"ColumnValue"</span> ;<br /> CELL LINES NOBORDER FASTEDIT <span style="color: #0000ff;">UPDATE</span><br /><br /> WITH OBJECT oBrw<br /> :<span style="color: #000000;">lHScroll</span> := .f.<br /> oBrw:<span style="color: #000000;">aCols</span><span style="color: #000000;">[</span> <span style="color: #000000;">1</span> <span style="color: #000000;">]</span>:<span style="color: #000000;">bClrStd</span> := <span style="color: #000000;">{</span> || <span style="color: #000000;">{</span> CLR_BLACK, oBrw:<span style="color: #000000;">nRecSelColor</span> <span style="color: #000000;">}</span> <span style="color: #000000;">}</span><br /><br /> WITH OBJECT oBrw:<span style="color: #000000;">aCols</span><span style="color: #000000;">[</span> <span style="color: #000000;">2</span> <span style="color: #000000;">]</span><br /> :<span style="color: #000000;">nEditType</span> := EDIT_GET<br /> :<span style="color: #000000;">bOnPostEdit</span> := <span style="color: #000000;">{</span> |o,x,n| <span style="color: #00C800;">If</span><span style="color: #000000;">(</span> n != VK_ESCAPE, oBrw:<span style="color: #000000;">aRow</span>:<span style="color: #000000;">VarPut</span><span style="color: #000000;">(</span> x <span style="color: #000000;">)</span>, <span style="color: #00C800;">nil</span> <span style="color: #000000;">)</span> <span style="color: #000000;">}</span><br /> :<span style="color: #000000;">bOnChange</span> := <span style="color: #000000;">{</span> || oMain:<span style="color: #000000;">RefreshCurrent</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #000000;">}</span><br /> END<br /> <span style="color: #B900B9;">//</span><br /> :<span style="color: #000000;">CreateFromCode</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> END<br /><br /> <span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">CENTERED</span> <span style="color: #0000ff;">ON</span> <span style="color: #0000ff;">INIT</span> DlgInit<span style="color: #000000;">(</span> oBrw <span style="color: #000000;">)</span><br /> <span style="color: #0000ff;">RELEASE</span> <span style="color: #0000ff;">FONT</span> oFont<br /> oMain:<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> oMain:<span style="color: #000000;">SetFocus</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><br /><span style="color: #00C800;">static</span> <span style="color: #00C800;">function</span> DlgInit<span style="color: #000000;">(</span> oBrw <span style="color: #000000;">)</span><br /><br /> <span style="color: #00C800;">local</span> oDlg := oBrw:<span style="color: #000000;">oWnd</span><br /> <span style="color: #00C800;">local</span> aDim := <span style="color: #000000;">{</span> oBrw:<span style="color: #000000;">nWidth</span>, oBrw:<span style="color: #000000;">nHeight</span> <span style="color: #000000;">}</span><br /><br /> <span style="color: #B900B9;">// ----- RESIZE DIALOG TO FIT THE CONTENTS OF BROWSE -------//</span><br /><br /> oBrw:<span style="color: #000000;">BrwFitSize</span><span style="color: #000000;">(</span> .t. <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">if</span> oBrw:<span style="color: #000000;">nWidth</span> < <span style="color: #000000;">284</span><br /> oBrw:<span style="color: #000000;">nWidth</span> := <span style="color: #000000;">284</span><br /> oBrw:<span style="color: #000000;">nStretchCol</span> := <span style="color: #000000;">2</span><br /> <span style="color: #00C800;">endif</span><br /> oDlg:<span style="color: #000000;">nWidth</span> += <span style="color: #000000;">(</span> oBrw:<span style="color: #000000;">nWidth</span> - aDim<span style="color: #000000;">[</span> <span style="color: #000000;">1</span> <span style="color: #000000;">]</span> <span style="color: #000000;">)</span><br /> oDlg:<span style="color: #000000;">nHeight</span> += <span style="color: #000000;">(</span> oBrw:<span style="color: #000000;">nHeight</span> - aDim<span style="color: #000000;">[</span> <span style="color: #000000;">2</span> <span style="color: #000000;">]</span> <span style="color: #000000;">)</span><br /><br /> WITH OBJECT oBrw<br /> :<span style="color: #000000;">ColStretch</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> :<span style="color: #000000;">oWnd</span>:<span style="color: #0000ff;">Center</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> :<span style="color: #000000;">SetFocus</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> END<br /><br /><span style="color: #00C800;">return</span> .f.<br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /> </div>[/code:3m0l7jjt] |
to Nages:also for Vertical Xbrowse | thanks Now I think I understood |
to Nages:also for Vertical Xbrowse | Mr Nages,
I add on XBrVert if there is a field memo
for n := 1 to Len( oBrw:aCols )
if oBrw:aCols[ n ]:cDataType == 'M'
oBrw:aCols[ n ]:bStrData = GenLocalBlock( oBrw:aCols, n )
endif
next
function GenLocalBlock( aCols, n )
return { || If( Empty( Eval( aCols[ n ]:bEditValue ) ), "<memo>", "<Memo>" ) }
[b:2pz2mzmy]BUT I see the text [b]<binary>[/b:2pz2mzmy] instead of <memo>[/b]
I wish to edit this field memo with a dialogbox as xrbwmemo.prg |
to Nages:also for Vertical Xbrowse | Dear Friend Silvio
Till you forget bStrData you can never use XBrowse's real capacities.
I have been requesting you about this so many times.
Kindly observe my code. |
to Nages:also for Vertical Xbrowse | opps sorry you're right
Isaw these lines on fwdbu ...sorry
and How I must make to show <memo> instead of <binary>
[img:13f1a4o2]http://img10.imageshack.us/img10/810/verthm.jpg[/img:13f1a4o2] |
to Rao | Mr Rao could You write some examples with
select * from .. and xBrowser
best regards
kajot |
to Rao | Are you referring to built-in FWHMaria library or ADO? |
to Rao | ADO |
to Rao | [code=fw:2e6n28q4]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00C800;">function</span> SampleSQL<br /><br /> <span style="color: #00C800;">local</span> oCn, oRs, cSql<br /><br /> FWNumFormat<span style="color: #000000;">(</span> <span style="color: #ff0000;">"A"</span>, .t. <span style="color: #000000;">)</span><br /><br /> oCn := FW_OpenAdoConnection<span style="color: #000000;">(</span> <span style="color: #ff0000;">"MYSQL,208.91.198.197:3306,fwhdemo,gnraofwh,Bharat@1950"</span>, .t. <span style="color: #000000;">)</span><br /><br /><span style="color: #B900B9;">// 1</span><br /> cSql := <span style="color: #ff0000;">"SELECT * FROM customer"</span><br /> oRs := FW_OpenRecordSet<span style="color: #000000;">(</span> oCn, cSql <span style="color: #000000;">)</span><br /> XBROWSER oRs FASTEDIT<br /> oRs:<span style="color: #000000;">Close</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /><span style="color: #B900B9;">// 2</span><br /> cSql := <span style="color: #ff0000;">"SELECT ID,First,City,Salary FROM customer"</span><br /> oRs := FW_OpenRecordSet<span style="color: #000000;">(</span> oCn, cSql <span style="color: #000000;">)</span><br /> XBROWSER oRs FASTEDIT<br /> oRs:<span style="color: #000000;">Close</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /><span style="color: #B900B9;">// 3</span><br /> cSql := <span style="color: #ff0000;">"SELECT C.ID,C.City,S.NAME AS StateName FROM customer C "</span> + ;<br /> <span style="color: #ff0000;">"LEFT JOIN states S ON C.STATE = S.CODE ORDER BY ID"</span><br /> oRs := FW_OpenRecordSet<span style="color: #000000;">(</span> oCn, cSql <span style="color: #000000;">)</span><br /> XBROWSER oRs FASTEDIT<br /> oRs:<span style="color: #000000;">Close</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /> oCn:<span style="color: #000000;">Close</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span></div>[/code:2e6n28q4] |
to Rao | [url:15wnmv1u]https://forums.fivetechsupport.com/viewtopic.php?f=3&t=35161#p209767[/url:15wnmv1u]
[url:15wnmv1u]https://forums.fivetechsupport.com/viewtopic.php?f=3&t=35830[/url:15wnmv1u]
[url:15wnmv1u]https://forums.fivetechsupport.com/viewtopic.php?f=3&t=36740[/url:15wnmv1u]
[url:15wnmv1u]https://forums.fivetechsupport.com/viewtopic.php?f=3&t=39629#p241540[/url:15wnmv1u]
[url:15wnmv1u]https://forums.fivetechsupport.com/viewtopic.php?f=3&t=39756#p237288[/url:15wnmv1u] |
to Rao | thank you
can I use "select * from" inside xbrowser |
to Rao | [quote:35r1hobj]can I use "select * from" inside xbrowser
[/quote:35r1hobj]
Can you please explain more clearly what do you want to achieve? |
to Rao | I want to change parameters in "select * to" when
xbrowser has worked already |
to Rao | ok. Please wait |
to Rao | Change some parameters like Where clause but without changing the fields.
[code=fw:3fu0jcub]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"fivewin.ch"</span><br /><br /><span style="color: #00C800;">function</span> Main<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /> <span style="color: #00C800;">local</span> oCn, oRs, oDlg, oBar, oBrw, cSql<br /><br /> oCn := FW_OpenAdoConnection<span style="color: #000000;">(</span> <span style="color: #ff0000;">"MYSQL,208.91.198.197:3306,fwhdemo,gnraofwh,Bharat@1950"</span>, .t. <span style="color: #000000;">)</span><br /> cSql := <span style="color: #ff0000;">"SELECT ID,First,City,State FROM customer WHERE STATE = "</span><br /> oRs := FW_OpenRecordSet<span style="color: #000000;">(</span> oCn, cSql + <span style="color: #ff0000;">"'NY'"</span> <span style="color: #000000;">)</span><br /><br /> <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">700</span>,<span style="color: #000000;">300</span> <span style="color: #0000ff;">PIXEL</span> TRUEPIXEL<br /> <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">BUTTONBAR</span> oBar <span style="color: #0000ff;">OF</span> oDlg <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">32</span>,<span style="color: #000000;">32</span> <span style="color: #000000;">2007</span><br /><br /> @ <span style="color: #000000;">52</span>,<span style="color: #000000;">20</span> <span style="color: #0000ff;">XBROWSE</span> oBrw <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">-20</span>,<span style="color: #000000;">-20</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">OF</span> oDlg ;<br /> DATASOURCE oRs <span style="color: #0000ff;">AUTOCOLS</span> ;<br /> CELL LINES NOBORDER FASTEDIT<br /><br /> WITH OBJECT oBrw<br /> :<span style="color: #000000;">nEditTypes</span> := EDIT_GET<br /> :<span style="color: #000000;">CreateFromCode</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> END<br /><br /> <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">BUTTON</span> <span style="color: #0000ff;">PROMPT</span> <span style="color: #ff0000;">"WA"</span> <span style="color: #0000ff;">OF</span> oBar <span style="color: #0000ff;">CENTER</span> <span style="color: #0000ff;">ACTION</span> NewSql<span style="color: #000000;">(</span> oBrw, cSql + <span style="color: #ff0000;">"'WA'"</span> <span style="color: #000000;">)</span><br /> <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">BUTTON</span> <span style="color: #0000ff;">PROMPT</span> <span style="color: #ff0000;">"CA"</span> <span style="color: #0000ff;">OF</span> oBar <span style="color: #0000ff;">CENTER</span> <span style="color: #0000ff;">ACTION</span> NewSql<span style="color: #000000;">(</span> oBrw, cSql + <span style="color: #ff0000;">"'CA'"</span> <span style="color: #000000;">)</span><br /> <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">BUTTON</span> <span style="color: #0000ff;">PROMPT</span> <span style="color: #ff0000;">"NY"</span> <span style="color: #0000ff;">OF</span> oBar <span style="color: #0000ff;">CENTER</span> <span style="color: #0000ff;">ACTION</span> NewSql<span style="color: #000000;">(</span> oBrw, cSql + <span style="color: #ff0000;">"'NY'"</span> <span style="color: #000000;">)</span><br /><br /> <span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">CENTERED</span><br /><br /> oRs:<span style="color: #000000;">Close</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> oCn:<span style="color: #000000;">Close</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /><br /><span style="color: #00C800;">static</span> <span style="color: #00C800;">function</span> NewSql<span style="color: #000000;">(</span> oBrw, cSql <span style="color: #000000;">)</span><br /><br /> WITH OBJECT oBrw:<span style="color: #000000;">oRs</span><br /> :<span style="color: #000000;">Close</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> :<span style="color: #000000;">Source</span> := cSql<br /> :<span style="color: #000000;">Open</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> END<br /> oBrw:<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /> </div>[/code:3fu0jcub]
The logic is : Close the recordset, change the oRs:Source and then Open again
[url=https://imageshack.com/i/pnme3GYxg:3fu0jcub][img:3fu0jcub]https://imagizer.imageshack.com/img923/5010/me3GYx.gif[/img:3fu0jcub][/url:3fu0jcub] |
to Rao | It is also possible to select different fields and even change the source table.
Let us see:
[code=fw:1yz7ol91]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"fivewin.ch"</span><br /><br /><span style="color: #00C800;">function</span> Main<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /> <span style="color: #00C800;">local</span> oCn, oRs, oDlg, oBar, oBrw<br /><br /> FWNumFormat<span style="color: #000000;">(</span> <span style="color: #ff0000;">"E"</span>, .t. <span style="color: #000000;">)</span><br /> SetGetColorFocus<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /> oCn := FW_OpenAdoConnection<span style="color: #000000;">(</span> <span style="color: #ff0000;">"MYSQL,208.91.198.197:3306,fwhdemo,gnraofwh,Bharat@1950"</span>, .t. <span style="color: #000000;">)</span><br /> oRs := FW_OpenRecordSet<span style="color: #000000;">(</span> oCn, <span style="color: #ff0000;">"select * from states"</span> <span style="color: #000000;">)</span><br /><br /> <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">800</span>,<span style="color: #000000;">300</span> <span style="color: #0000ff;">PIXEL</span> TRUEPIXEL<br /> <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">BUTTONBAR</span> oBar <span style="color: #0000ff;">OF</span> oDlg <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">80</span>,<span style="color: #000000;">32</span> <span style="color: #000000;">2007</span><br /><br /> @ <span style="color: #000000;">52</span>,<span style="color: #000000;">20</span> <span style="color: #0000ff;">XBROWSE</span> oBrw <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">-20</span>,<span style="color: #000000;">-20</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">OF</span> oDlg ;<br /> DATASOURCE oRs <span style="color: #0000ff;">AUTOCOLS</span> AUTOSORT ;<br /> CELL LINES NOBORDER FASTEDIT<br /><br /> WITH OBJECT oBrw<br /> :<span style="color: #000000;">nEditTypes</span> := EDIT_GET<br /> :<span style="color: #000000;">CreateFromCode</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> END<br /><br /> <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">BUTTON</span> <span style="color: #0000ff;">PROMPT</span> <span style="color: #ff0000;">"CUSTOMER"</span> <span style="color: #0000ff;">OF</span> oBar <span style="color: #0000ff;">CENTER</span> <span style="color: #0000ff;">ACTION</span> NewTable<span style="color: #000000;">(</span> oBrw, <span style="color: #ff0000;">"customer"</span> <span style="color: #000000;">)</span><br /> <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">BUTTON</span> <span style="color: #0000ff;">PROMPT</span> <span style="color: #ff0000;">"PIVOTDATA"</span> <span style="color: #0000ff;">OF</span> oBar <span style="color: #0000ff;">CENTER</span> <span style="color: #0000ff;">ACTION</span> NewTable<span style="color: #000000;">(</span> oBrw, <span style="color: #ff0000;">"pivotdata"</span> <span style="color: #000000;">)</span><br /> <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">BUTTON</span> <span style="color: #0000ff;">PROMPT</span> <span style="color: #ff0000;">"STATES"</span> <span style="color: #0000ff;">OF</span> oBar <span style="color: #0000ff;">CENTER</span> <span style="color: #0000ff;">ACTION</span> NewTable<span style="color: #000000;">(</span> oBrw, <span style="color: #ff0000;">"states"</span> <span style="color: #000000;">)</span><br /><br /> <span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">CENTERED</span><br /><br /> oRs:<span style="color: #000000;">Close</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> oCn:<span style="color: #000000;">Close</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /><br /><span style="color: #00C800;">static</span> <span style="color: #00C800;">function</span> NewTable<span style="color: #000000;">(</span> oBrw, cTable <span style="color: #000000;">)</span><br /><br /> CursorWait<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> WITH OBJECT oBrw:<span style="color: #000000;">oRs</span><br /> :<span style="color: #000000;">Close</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> :<span style="color: #000000;">Sort</span> := <span style="color: #00C800;">nil</span><br /> :<span style="color: #000000;">Filter</span> := <span style="color: #ff0000;">""</span><br /> :<span style="color: #000000;">Source</span> := <span style="color: #ff0000;">"select * from "</span> + cTable<br /> :<span style="color: #000000;">Open</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> END<br /> WITH OBJECT oBrw<br /> :<span style="color: #000000;">ResetData</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> :<span style="color: #000000;">nEditTypes</span> := EDIT_GET<br /> :<span style="color: #000000;">SetFocus</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> END<br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /> </div>[/code:1yz7ol91]
[url=https://imageshack.com/i/poEojogwg:1yz7ol91][img:1yz7ol91]https://imagizer.imageshack.com/img924/4080/Eojogw.gif[/img:1yz7ol91][/url:1yz7ol91] |
to Rao | thank You |
to Rao | how can you pass parameters to "select * from " |
to Rao | FW_AdoApplyParams( cSql, aParams )
[code=fw:2ofulrbq]<div class="fw" id="{CB}" style="font-family: monospace;"> cState := <span style="color: #ff0000;">"NY"</span><br /> nAge := <span style="color: #000000;">35</span><br /> dDate := <span style="color: #000000;">{</span>^ <span style="color: #000000;">1980</span>/<span style="color: #000000;">01</span>/<span style="color: #000000;">01</span> <span style="color: #000000;">}</span><br /><br /> cSql := <span style="color: #ff0000;">"SELECT * FROM customer WHERE STATE = ? AND AGE > ? AND HIREDATE > ?"</span><br /> ? cSql2 := FW_AdoApplyParams<span style="color: #000000;">(</span> cSql, <span style="color: #000000;">{</span> cState, nAge, dDate <span style="color: #000000;">}</span> <span style="color: #000000;">)</span><br /><br /><span style="color: #B900B9;">// result </span><br /><span style="color: #B900B9;">// --> SELECT * FROM customer WHERE STATE = 'NY' AND AGE > 35 AND HIREDATE > '1980-01-01'</span><br /> </div>[/code:2ofulrbq] |
to Rao | 1) Are you using MySQL with ADO? Or MSSQL with ADO?
2) Your FWH Version? Harbour or xHarbour?
3) If you are using MySql, did you try FWH built-in MySql library? |
to Rao | 1) I am using MSSQL
2) FWH 23.04
3) xHarbour 2022 Bld773
I am trying postgres v.8 too
thank You |
to Rao | Thanks.
I will keep the info in mind while answering your queries. |
to Richard ( Taiwan ) about Skin Themes windows | Hi Richard !
[code:2oy55uih]
DEFINE DIALOG oDlg RESOURCE "D_DR_WIN_STATMSF_SEARCH"
........
ACTIVATE DIALOG oDlg CENTER ON INIT CodeJockSkin_InitDlg( oDlg )
FUNCTION CodeJockSkin_InitDlg( oDlg )
LOCAL oActiveX
oActiveX := TActiveX_FreeWin():New( oDlg, "Codejock.SkinFrameWork.10.4.1" )
oActiveX:LoadSkin( "System\ActiveX\Styles\Vista.cjstyles", "" ) //Vista.cjstyles //Office2007.cjstyles
oActiveX:ApplyWindow( oDlg:hWnd )
RETURN NIL
[/code:2oy55uih]
Do you mind to send me the function TActiveX_FreeWin
Thank's for help
Regards
Areang |
to Richard ( Taiwan ) about Skin Themes windows | Areang
Try with tActivex() of Fivewin. |
to Richard ( Taiwan ) about Skin Themes windows | Hello areang,
Look it. Office 2007 interface.
[url=http://img244.imageshack.us/my.php?image=fwhskinactivex2jf5.jpg:1ofuxbwv][img:1ofuxbwv]http://img244.imageshack.us/img244/3297/fwhskinactivex2jf5.th.jpg[/img:1ofuxbwv][/url:1ofuxbwv]
[url=http://img244.imageshack.us/my.php?image=fwhskinactivex3us9.jpg:1ofuxbwv][img:1ofuxbwv]http://img244.imageshack.us/img244/7369/fwhskinactivex3us9.th.jpg[/img:1ofuxbwv][/url:1ofuxbwv]
Same as TActiveX of FWH. What's FWH version?
Thanks for Rochinha.
Regards,
Richard |
to Richard ( Taiwan ) about Skin Themes windows | Sorry, could somebody tell me where can I get this activex you are showing in the images? |
to Richard ( Taiwan ) about Skin Themes windows | Hello jose_murugosa,
Please visit this web site.
[url:2uyimcib]http://www.codejock.com/[/url:2uyimcib]
Regards,
Richard |
to Richard ( Taiwan ) about Skin Themes windows | Richard
Where did you download the activex file from ? "Codejock.SkinFrameWork.10.4.1"
Is this a freeware ? Are these skins free to use or are they copyrighted.
Thanks for info
Richard |
to Richard ( Taiwan ) about Skin Themes windows | Thank you Taiwan
I´ll check the site. |
to Richard ( Taiwan ) about Skin Themes windows | Hii,
Here is a working sample with SkinFramework:
[code:3rhvji96]
// FiveWin ActiveX support demo - Using Adobe Acrobat Reader
#include "FiveWin.ch"
function Main()
local oWnd, oActiveX
DEFINE WINDOW oWnd TITLE "FiveWin ActiveX Support with Skin"
oActiveX = TActiveX():New( oWnd, "PDF.PdfCtrl.5" )
oWnd:oClient = oActiveX // To fill the entire window surface
oActiveX:Do( "LoadFile", "c:\teste.pdf" )
oActiveX:Do( "SetCurrentPage", 1 )
ACTIVATE WINDOW oWnd ON INIT CodeJockSkin_InitDlg(oWnd)
return nil
FUNCTION CodeJockSkin_InitDlg( oDlg )
LOCAL oActiveX, cStylesPath := "c:\win2003\arquivos de programas\codejock\source\skinframework\Styles\"
oActiveX := TActiveX():New( oDlg, "Codejock.SkinFrameWork.10.4.2" )
oActiveX:Do( "LoadSkin", cStylesPath+"Vista.cjstyles", "" ) //Vista.cjstyles //Office2007.cjstyles
oActiveX:Do( "ApplyWindow", oDlg:hWnd )
return nil
[/code:3rhvji96] |
to Richard ( Taiwan ) about Skin Themes windows | Hello Rochinha,
Yes, same as.
But I have a question about it.
Please look my attach picture.
Why it appear "S/F" mark?
I run VB Exe file disappear mark.
[url=http://img112.imageshack.us/my.php?image=fwhskinactivex5he7.jpg:2mqmiqy8][img:2mqmiqy8]http://img112.imageshack.us/img112/4791/fwhskinactivex5he7.th.jpg[/img:2mqmiqy8][/url:2mqmiqy8]
Regards,
Richard |
to Richard ( Taiwan ) about Skin Themes windows | [quote="Richard Chidiak":112qzsuz]Richard
Where did you download the activex file from ? "Codejock.SkinFrameWork.10.4.1"
Is this a freeware ? Are these skins free to use or are they copyrighted.
Thanks for info
Richard[/quote:112qzsuz]
Please check [url:112qzsuz]http://www.codejock.com/[/url:112qzsuz]
Regards,
Richard |
to Richard ( Taiwan ) about Skin Themes windows | Taiwan
Maybe you have linked other activex too. check it. |
to Richard ( Taiwan ) about Skin Themes windows | Hello All,
Test finish. Look it below:
[url=http://img166.imageshack.us/my.php?image=fwhskinactivex6dz7.jpg:3ps7zsda][img:3ps7zsda]http://img166.imageshack.us/img166/8030/fwhskinactivex6dz7.th.jpg[/img:3ps7zsda][/url:3ps7zsda]
Regards,
Richard |
to Richard ( Taiwan ) about Skin Themes windows | Thank's to all
<!-- s:lol: --><img src="{SMILIES_PATH}/icon_lol.gif" alt=":lol:" title="Laughing" /><!-- s:lol: --> If you don't mind, Can someone to email me ocx and samples source code ? <!-- s:wink: --><img src="{SMILIES_PATH}/icon_wink.gif" alt=":wink:" title="Wink" /><!-- s:wink: -->
Regards
Areang |
to Richard ( Taiwan ) about Skin Themes windows | Hello areang,
Source code check these message. only add in your ap.
ActiveX components -> <!-- m --><a class="postlink" href="http://www.codejock.com/">http://www.codejock.com/</a><!-- m -->
check ActiveX suite pro not MFC++
Regards,
Richard |
to Richard ( Taiwan ) about Skin Themes windows | Hi Richard
[quote:33n3bl36]
This evaluation can be used with Visual Studio 5.0, 6.0, .NET 2002, .NET 2003, and .NET 2005. Unicode versions of the OCX files are currently not provided with the evaluation version.
[/quote:33n3bl36]
I think, Codejock has stopped distributing evaluaiton copies of the OCX files.
How can I get it for testing.
- Ramesh Babu P |
to Richard ( Taiwan ) about Skin Themes windows | [quote="RAMESHBABU":1wzifimr]Hi Richard
[quote:1wzifimr]
This evaluation can be used with Visual Studio 5.0, 6.0, .NET 2002, .NET 2003, and .NET 2005. Unicode versions of the OCX files are currently not provided with the evaluation version.
[/quote:1wzifimr]
I think, Codejock has stopped distributing evaluaiton copies of the OCX files.
How can I get it for testing.
- Ramesh Babu P[/quote:1wzifimr]
Hello
I have Codejock v10.4.1 evaluation version.
But it have 20MB. How to send to you?
Regards,
Richard |
to Richard ( Taiwan ) about Skin Themes windows | Richard,
You can use <!-- w --><a class="postlink" href="http://www.yousendit.com">www.yousendit.com</a><!-- w --> to send large files.
James |
to Richard ( Taiwan ) about Skin Themes windows | Richard,
Please,
Can you send the Codejock v10.4.1 evaluation version too.
Maybe can best if you upload the file to server for download.
Fernando |
to Richard ( Taiwan ) about Skin Themes windows | Dear all,
I am using FiveWin for xHarbour to development the application and facing unicode problem, some Chinese character like the attached image is unable to type in the text box, it will show in '?' after typing.
<!-- m --><a class="postlink" href="http://202.146.109.43/testing/unicode.jpg">http://202.146.109.43/testing/unicode.jpg</a><!-- m -->
I want to know if the ActiveX suite pro can solve this problem?
Regards,
Thomas |
to Richard ( Taiwan ) about Skin Themes windows | [quote="wktsang1":17r2u6vx]Dear all,
I am using FiveWin for xHarbour to development the application and facing unicode problem, some Chinese character like the attached image is unable to type in the text box, it will show in '?' after typing.
<!-- m --><a class="postlink" href="http://202.146.109.43/testing/unicode.jpg">http://202.146.109.43/testing/unicode.jpg</a><!-- m -->
I want to know if the ActiveX suite pro can solve this problem?
Regards,
Thomas[/quote:17r2u6vx]
Hello Thomas,
Could you use Themes into your EXE file?
I know FWH's TGet not support 2 bytes(Chinese) input Chinese when your
application add Themes interface.
I know you can download unicode solution from web site. It support some
AP not support unicode font when you input unicode character.
Regards,
Richard
Fivetech.net Taiwan |
to Richard ( Taiwan ) about Skin Themes windows | [quote="Taiwan":3v7pk6os]
Hello Thomas,
Could you use Themes into your EXE file?
I know FWH's TGet not support 2 bytes(Chinese) input Chinese when your
application add Themes interface.
I know you can download unicode solution from web site. It support some
AP not support unicode font when you input unicode character.
Regards,
Richard
Fivetech.net Taiwan[/quote:3v7pk6os]
Hi Richard,
Thank for your quick response.
In fact now my application can support most of the Chinese character, but find few character with problem.
Does 'unicode solution' you mention is the ActiveX suite pro in <!-- m --><a class="postlink" href="http://www.codejock.com/">http://www.codejock.com/</a><!-- m -->? After purchase and install this tool, do I need to update all object (such as textbox, list, label) in order to show/input such character?
Any what is the meaning of 'It support some
AP not support unicode font when you input unicode character.'.
I have also try the Visual xHarbour and find the problem is still exist, indeed if xHarbour provide the component like RichTextBox in Visual Basic?
Many thank.
Thomas |
to Richard ( Taiwan ) about Skin Themes windows | [quote="wktsang1":35p8x9ke][quote="Taiwan":35p8x9ke]
Hello Thomas,
Could you use Themes into your EXE file?
I know FWH's TGet not support 2 bytes(Chinese) input Chinese when your
application add Themes interface.
I know you can download unicode solution from web site. It support some
AP not support unicode font when you input unicode character.
Regards,
Richard
Fivetech.net Taiwan[/quote:35p8x9ke]
Hi Richard,
Thank for your quick response.
In fact now my application can support most of the Chinese character, but find few character with problem.
Does 'unicode solution' you mention is the ActiveX suite pro in <!-- m --><a class="postlink" href="http://www.codejock.com/">http://www.codejock.com/</a><!-- m -->? After purchase and install this tool, do I need to update all object (such as textbox, list, label) in order to show/input such character?
Any what is the meaning of 'It support some
AP not support unicode font when you input unicode character.'.
I have also try the Visual xHarbour and find the problem is still exist, indeed if xHarbour provide the component like RichTextBox in Visual Basic?
Many thank.
Thomas[/quote:35p8x9ke]
Hello Thomas,
Now, FWH's TGet problem when you add Themes interface.
input Chinese charact cursor position not correct.
If remove Themes interface, cursor position no problem.
Unicode problem. Sometimes when we input some Chinese Character
MS-Work can disappear it, but FWH's AP appear '?' problem for me.
So I intall Free Unicode tools from site( I gorgot ) to solve this problem.
Now, I input any Chinese character no problem.
Codejock ActiveX.
Now, I just test Codejock Suite pro ActiveX functions. I think very nice tools for me. But how to write codes not easy. I need more time to try.
Regards,
Richard
Fivetech.net Taiwan |
to Richard ( Taiwan ) about Skin Themes windows | [quote:1yibii18]
Unicode problem. Sometimes when we input some Chinese Character
MS-Work can disappear it, but FWH's AP appear '?' problem for me.
So I intall Free Unicode tools from site( I gorgot ) to solve this problem.
Now, I input any Chinese character no problem[/quote:1yibii18]
Cool, I think what I need now is this unicode tool, could you provide more information for me to get this tool? |
to Richard ( Taiwan ) about Skin Themes windows | Hi Richard !
Could you tell me how to remove the S/F mark
Thanks !!!
Best Regards |
to Richard ( Taiwan ) about Skin Themes windows | hELLO!
How you remove S/F icon when use skinframework?
Thank´s
[quote="Taiwan":1psf2wk7]Hello areang,
Source code check these message. only add in your ap.
ActiveX components -> <!-- m --><a class="postlink" href="http://www.codejock.com/">http://www.codejock.com/</a><!-- m -->
check ActiveX suite pro not MFC++
Regards,
Richard[/quote:1psf2wk7] |
to Richard ( Taiwan ) about Skin Themes windows | [quote="goosfancito":3thb66ex]hELLO!
How you remove S/F icon when use skinframework?
Thank´s
[quote="Taiwan":3thb66ex]Hello areang,
Source code check these message. only add in your ap.
ActiveX components -> <!-- m --><a class="postlink" href="http://www.codejock.com/">http://www.codejock.com/</a><!-- m -->
check ActiveX suite pro not MFC++
Regards,
Richard[/quote:3thb66ex][/quote:3thb66ex]
Hi
very simple use it.
[code=fw:3thb66ex]<div class="fw" id="{CB}" style="font-family: monospace;"><br />oActiveX&#<span style="color: #000000;">058</span>;nWidth := <span style="color: #000000;">0</span><br />oActiveX&#<span style="color: #000000;">058</span>;nHeight := <span style="color: #000000;">0</span><br /> </div>[/code:3thb66ex]
That's all.
Regards,
richard
Fivetech.net Taiwan |
to Richard ( Taiwan ) about Skin Themes windows | Thank´s it work!
[quote="richard-service":17h0w42n][quote="goosfancito":17h0w42n]hELLO!
How you remove S/F icon when use skinframework?
Thank´s
[quote="Taiwan":17h0w42n]Hello areang,
Source code check these message. only add in your ap.
ActiveX components -> <!-- m --><a class="postlink" href="http://www.codejock.com/">http://www.codejock.com/</a><!-- m -->
check ActiveX suite pro not MFC++
Regards,
Richard[/quote:17h0w42n][/quote:17h0w42n]
Hi
very simple use it.
[code=fw:17h0w42n]<div class="fw" id="{CB}" style="font-family: monospace;"><br />oActiveX&#<span style="color: #000000;">058</span>;nWidth := <span style="color: #000000;">0</span><br />oActiveX&#<span style="color: #000000;">058</span>;nHeight := <span style="color: #000000;">0</span><br /> </div>[/code:17h0w42n]
That's all.
Regards,
richard
Fivetech.net Taiwan[/quote:17h0w42n] |
to Richard ( Taiwan ) about Skin Themes windows | Hi Richard,
Can you please guide me how to use the Codejock Menubar and Toolbars.
Thanks,
- Ramesh Babu P |
to Stefan Haupt RMCHART | Stefan, I would greatly appreciate you emailing the RMChart wrappers to me at
<!-- e --><a href="mailto:[email protected]">[email protected]</a><!-- e -->
tks
Pako |
to Stefan Haupt RMCHART | Hello Francisco,
Done. |
to Stefan Haupt RMCHART | Regards,
Pako |
to Stefan Haupt RMCHART | Hi friends,
Where I can find wrappers for rmchart.dll please? If anyone can send it I thanks: <!-- e --><a href="mailto:[email protected]">[email protected]</a><!-- e -->
TIA and best regards
Toninho. |
to Stefan Haupt RMCHART | Hi Toninho,
just sent <!-- s:D --><img src="{SMILIES_PATH}/icon_biggrin.gif" alt=":D" title="Very Happy" /><!-- s:D --> |
to Stefan Haupt RMCHART | Please send to me as well.
jeff @ can-soft.net |
to Stefan Haupt RMCHART | Done |
to Stefan Haupt RMCHART | Stefan
Please send the Rmchart wrappers to me also. I'm sure your wrappers are a better solution than trying to use DLL32 calls (which I still can't get to work correctly for Rmchart.dll).
You can email the wrappers to me at:
roger AT leadersoft DOT com
Thanks!
- Roger |
to Stefan Haupt RMCHART | Dear Stefan,
Could you give an example for How to use RMCHART.DLL wrapper (FWH code)? How to set the figures for graph?
Regards,
Dutch |
to Stefan Haupt RMCHART | Hi
Mean it?
[url=http://img201.imageshack.us/my.php?image=20080103215609dx1.jpg:1kdhjxlp][img:1kdhjxlp]http://img201.imageshack.us/img201/6151/20080103215609dx1.th.jpg[/img:1kdhjxlp][/url:1kdhjxlp]
[url=http://img201.imageshack.us/my.php?image=20080104093517qv5.jpg:1kdhjxlp][img:1kdhjxlp]http://img201.imageshack.us/img201/5672/20080104093517qv5.th.jpg[/img:1kdhjxlp][/url:1kdhjxlp]
I use RMCHART Class and OCX work fine everything.
Look attach samples jpgs.
Regards,
Richard |
to Stefan Haupt RMCHART | Roger,
[quote="Roger Seiler":82jq2wxe]
Please send the Rmchart wrappers to me also. I'm sure your wrappers are a better solution than trying to use DLL32 calls (which I still can't get to work correctly for Rmchart.dll).
[/quote:82jq2wxe]
just sent.
Thanks for your kind words, but the wrapper and the sample are not mine, They are from Oscar Joel. I just have the files in my archiv. I don´t use it so far, just for tests. For diagrams I´m still using TGraph, which is included in fwh.
If I´ll have some time I´ll try to test your solution. |
to Stefan Haupt RMCHART | Hi Dutch,
[quote="dutch":13mdrx59]Dear Stefan,
Could you give an example for How to use RMCHART.DLL wrapper (FWH code)? How to set the figures for graph?
Dutch[/quote:13mdrx59]
Please see my last post to Roger, I only have the sample which is included in the TRmChartX class.
Did you have the wrapper using ocx ? I can sent you the archiv file if you want. |
to Stefan Haupt RMCHART | Thanks, Stefan for sending the file.
Meanwhile, I figured out how to get the Rmchart.dll working correctly in FWH with FWH's DLL32 command. I'm cleaning it up now so that I can upload a new RMC4FWH.PRG with all of the 130 or so DLL32 command calls (now working), plus a test program and some samples so everyone who's interested can work with it.
I expect to be able to upload it sometime tomorrow. Hopefully I can get it done before I leave on my six week safari in the Amazon jungle tomorrow morning.
- Roger |
to Stefan Haupt RMCHART | Stefan
Please send the Rmchart wrappers to me also. I'm sure your wrappers are a better solution.
You can email to me at:
<!-- e --><a href="mailto:[email protected]">[email protected]</a><!-- e -->
Thanks in advance!
Alfonso |
to Stefan Haupt RMCHART | Stefan
Excuse me, in my previews messagethe e_mail was wrong. In this new message it is OK.
Please send the Rmchart wrappers to me also. I'm sure your wrappers are a better solution.
You can email to me at:
<!-- e --><a href="mailto:[email protected]">[email protected]</a><!-- e -->
Thanks in advance!
Alfonso |
to Stefan Haupt RMCHART | I've looked carefully at the files within TRMchartX.zip from Oscar and Stefan, and unless I'm missing something, I don't see any C wrappers included for RMChart.dll. This set of files appears to be focused on a TRMChartX class in its TRMChartX.prg, which seems to only access the ActiveX capabilities of RMChart and Harbour -not the dll implementation. Of course, for many, the ActiveX route may be the best way to go.
But if one wants to use RMChart.dll, the approach that Im working on with DLL32 may be appropriate. Anyway, it's working here - though some additional cleanup is still needed with the functions that have arrays as parameters. Hope to have that finished tonight.
- Roger |
to Stefan Haupt RMCHART | It seems someone else using xHarbour (but not FWH) also had the problem passing arrays to the RMchart.dll functions - the problem I'm wrestling with - and he found a solution. However, I can't seem to get his solution to work in FWH. Can someone show me how?
Here's an exerpt of the discussion from the Rmchart forum...
*------------
I have a problem with RM_ADDBARSERIES .... I can't get the data array in ??? - ChrisG
aData := { 10.0, 20.0, 30.0, 40.0, 50.0 } // define my array of data
nResult := DLLCall( ;
hDll, ; // DLL to call
DC_CALL_STD, ; // calling convention
"RMC_ADDBARSERIES", ; // the function to call
nCtrlId, ;
1, ; //region
aData, ;
5, ; // length of data
0,0,0,0,0,0,0,0,0 )
I have tried it with aData, aData[1]
*------------
(LATER, HIS SOLUTION...)
A clever person on the xHarbour NG has given me some code that allowed me to do this...
typedef struct { DOUBLE nDouble[5] } MyStructure
PROCEDURE MakeData
LOCAL o IS MyStructure
o:nDouble[1] := 1.0
o:nDouble[2] := 2.0
o:nDouble[3] := 3.0
o:nDouble[4] := 4.0
o:nDouble[5] := 5.0
RETURN( o )
#pragma ENDDUMP
I then pass o[1] into the Rmchart function .... and all works 100%.
*------------------------------------------
(Me again...)
I've tried, but haven't quite been able to implement this solution in FWH.
Any suggestions? (Come on Enrico - throw me a life preserver. You're so good at it!)
- Roger |
to Stefan Haupt RMCHART | Whoops - the #pragma ENDDUMP wasn't part of ChrisG's code - it's a fragment left over from my attempt to implement his solution. - Roger |
to Stefan Haupt RMCHART | Dear Stefan,
Yes, please.
Regards,
Dutch
<!-- e --><a href="mailto:[email protected]">[email protected]</a><!-- e -->
<!-- e --><a href="mailto:[email protected]">[email protected]</a><!-- e -->
[quote="StefanHaupt":3u6sgycz]Hi Dutch,
[quote="dutch":3u6sgycz]Dear Stefan,
Could you give an example for How to use RMCHART.DLL wrapper (FWH code)? How to set the figures for graph?
Dutch[/quote:3u6sgycz]
Please see my last post to Roger, I only have the sample which is included in the TRmChartX class.
Did you have the wrapper using ocx ? I can sent you the archiv file if you want.[/quote:3u6sgycz] |
to Stefan Haupt RMCHART | Alfonso, Dutch,
just sent the file |
to call Infoser | Someone can give me number phone or email of Infoser ( Spain)
-------------------------------- |
to compile - WebView - Bcc55 - xHarbour | Hello
I can compile xHarbour + BCC55 + WebView with FWH2212
I'm not always missing something.
[b:2v391e21]
a part of .lnk[/b:2v391e21]
[code=fw:2v391e21]<div class="fw" id="{CB}" style="font-family: monospace;"><br />\sis\fsql901\visual\lib\tip.lib +<br />\sis\fsql901\visual\lib\mysql.obj +<br />\sis\fsql901\visual\lib\ttaskpanel.lib +<br />\sis\fsql901\lib\libmysql.lib +<br />\sis\fsql901\lib\mysqlclient.lib, +<br />sisrev.exe, +<br />sisrev.map, +<br />\fwh2212\lib\fivehx.lib +<br />\fwh2212\lib\fivehc.lib +<br />\xharbour\lib\gtgui.lib +<br />\xharbour\lib\rdd.lib +<br />\xharbour\lib\usrrdd.lib +<br />\xharbour\lib\dbfntx.lib +<br />\xharbour\lib\dbfcdx.lib +<br />\xharbour\lib\dbffpt.lib +<br />\xharbour\lib\rtl.lib +<br />\xharbour\lib\vm.lib +<br />\xharbour\lib\lang.lib +<br />\xharbour\lib\macro.lib +<br />\xharbour\lib\hbsix.lib +<br />\xharbour\lib\hbzip.lib +<br />\xharbour\lib\zlib.lib +<br />\xharbour\lib\common.lib +<br />\xharbour\lib\codepage.lib +<br />\xharbour\lib\pp.lib +<br />\xharbour\lib\pcrepos.lib +<br />\xharbour\lib\ct.lib +<br />\bcc55\lib\cw32.lib +<br />\bcc55\lib\import32.lib +<br />\bcc55\lib\uuid.lib +<br />\bcc55\lib\psdk\nddeapi.lib +<br />\bcc55\lib\psdk\iphlpapi.lib +<br />\bcc55\lib\psdk\odbc32.lib +<br />\bcc55\lib\psdk\rasapi32.lib +<br />\bcc55\lib\psdk\msimg32.lib +<br />\bcc55\lib\psdk\gdiplus.lib +<br />\bcc55\lib\c0w32.obj,<br /> </div>[/code:2v391e21]
[code=fw:2v391e21]<div class="fw" id="{CB}" style="font-family: monospace;"><br /> c:\bcc55\bin\bcc32 -c -tWM -I\sis\fsql901\include;\fwh2212\include;\xharbour\include;\bcc55\include -o\tmp\sisrev5\versao \tmp\sisrev5\versao.c<br />Borland C++ <span style="color: #000000;">5.5</span> <span style="color: #00C800;">for</span> Win32 Copyright <span style="color: #000000;">(</span>c<span style="color: #000000;">)</span> <span style="color: #000000;">1993</span>, <span style="color: #000000;">2000</span> Borland<br />\tmp\sisrev5\versao.c:<br /><span style="color: #000000;">MAKE</span> Version <span style="color: #000000;">5.2</span> Copyright <span style="color: #000000;">(</span>c<span style="color: #000000;">)</span> <span style="color: #000000;">1987</span>, <span style="color: #000000;">2000</span> Borland<br />Turbo Incremental Link <span style="color: #000000;">5.00</span> Copyright <span style="color: #000000;">(</span>c<span style="color: #000000;">)</span> <span style="color: #000000;">1997</span>, <span style="color: #000000;">2000</span> Borland<br />Error: <span style="color: #000000;">Unresolved</span> external <span style="color: #ff0000;">'_hb_vmPushSize'</span> referenced <span style="color: #0000ff;">from</span> C:\FWH2212\LIB\FIVEHC.LIB|FFDLGPRC<br />Error: <span style="color: #000000;">Unresolved</span> external <span style="color: #ff0000;">'_HB_FUN_HB_ISCHAR'</span> referenced <span style="color: #0000ff;">from</span> C:\FWH2212\LIB\FIVEHX.LIB|FILENAME<br />Error: <span style="color: #000000;">Unresolved</span> external <span style="color: #ff0000;">'SHGetImageList'</span> referenced <span style="color: #0000ff;">from</span> C:\FWH2212\LIB\FIVEHC.LIB|ICONS<br />Error: <span style="color: #000000;">Unresolved</span> external <span style="color: #ff0000;">'_hb_partdt'</span> referenced <span style="color: #0000ff;">from</span> C:\FWH2212\LIB\FIVEHX.LIB|VALTOSTT<br />Error: <span style="color: #000000;">Unresolved</span> external <span style="color: #ff0000;">'GdipFree'</span> referenced <span style="color: #0000ff;">from</span> C:\FWH2212\LIB\FIVEHC.LIB|GDIPFWH<br />Error: <span style="color: #000000;">Unresolved</span> external <span style="color: #ff0000;">'GdipDisposeImageAttributes'</span> referenced <span style="color: #0000ff;">from</span> C:\FWH2212\LIB\FIVEHC.LIB|GDIPFWH<br />Error: <span style="color: #000000;">Unresolved</span> external <span style="color: #ff0000;">'GdipDeleteGraphics'</span> referenced <span style="color: #0000ff;">from</span> C:\FWH2212\LIB\FIVEHC.LIB|GDIPFWH<br />Error: <span style="color: #000000;">Unresolved</span> external <span style="color: #ff0000;">'GdipDeleteMatrix'</span> referenced <span style="color: #0000ff;">from</span> C:\FWH2212\LIB\FIVEHC.LIB|GDIPFWH<br />Error: <span style="color: #000000;">Unresolved</span> external <span style="color: #ff0000;">'GdipCreateImageAttributes'</span> referenced <span style="color: #0000ff;">from</span> C:\FWH2212\LIB\FIVEHC.LIB|GDIPFWH<br />Error: <span style="color: #000000;">Unresolved</span> external <span style="color: #ff0000;">'GdipGetImageWidth'</span> referenced <span style="color: #0000ff;">from</span> C:\FWH2212\LIB\FIVEHC.LIB|GDIPFWH<br />Error: <span style="color: #000000;">Unresolved</span> external <span style="color: #ff0000;">'GdipGetImageHeight'</span> referenced <span style="color: #0000ff;">from</span> C:\FWH2212\LIB\FIVEHC.LIB|GDIPFWH<br />Error: <span style="color: #000000;">Unresolved</span> external <span style="color: #ff0000;">'GdipGetImagePixelFormat'</span> referenced <span style="color: #0000ff;">from</span> C:\FWH2212\LIB\FIVEHC.LIB|GDIPFWH<br />Error: <span style="color: #000000;">Unresolved</span> external <span style="color: #ff0000;">'GdipCreateBitmapFromStream'</span> referenced <span style="color: #0000ff;">from</span> C:\FWH2212\LIB\FIVEHC.LIB|GDIPFWH<br />Error: <span style="color: #000000;">Unresolved</span> external <span style="color: #ff0000;">'GdipDisposeImage'</span> referenced <span style="color: #0000ff;">from</span> C:\FWH2212\LIB\FIVEHC.LIB|GDIPFWH<br />Error: <span style="color: #000000;">Unresolved</span> external <span style="color: #ff0000;">'GdipCloneImage'</span> referenced <span style="color: #0000ff;">from</span> C:\FWH2212\LIB\FIVEHC.LIB|GDIPFWH<br />Error: <span style="color: #000000;">Unresolved</span> external <span style="color: #ff0000;">'GdipAlloc'</span> referenced <span style="color: #0000ff;">from</span> C:\FWH2212\LIB\FIVEHC.LIB|GDIPFWH<br />Error: <span style="color: #000000;">Unresolved</span> external <span style="color: #ff0000;">'GdipBitmapLockBits'</span> referenced <span style="color: #0000ff;">from</span> C:\FWH2212\LIB\FIVEHC.LIB|GDIPFWH<br />Error: <span style="color: #000000;">Unresolved</span> external <span style="color: #ff0000;">'GdipCreateBitmapFromScan0'</span> referenced <span style="color: #0000ff;">from</span> C:\FWH2212\LIB\FIVEHC.LIB|GDIPFWH<br />Error: <span style="color: #000000;">Unresolved</span> external <span style="color: #ff0000;">'GdipGetImageGraphicsContext'</span> referenced <span style="color: #0000ff;">from</span> C:\FWH2212\LIB\FIVEHC.LIB|GDIPFWH<br />Error: <span style="color: #000000;">Unresolved</span> external <span style="color: #ff0000;">'GdipDrawImageRectI'</span> referenced <span style="color: #0000ff;">from</span> C:\FWH2212\LIB\FIVEHC.LIB|GDIPFWH<br />Error: <span style="color: #000000;">Unresolved</span> external <span style="color: #ff0000;">'GdipBitmapUnlockBits'</span> referenced <span style="color: #0000ff;">from</span> C:\FWH2212\LIB\FIVEHC.LIB|GDIPFWH<br />Error: <span style="color: #000000;">Unresolved</span> external <span style="color: #ff0000;">'GdipSetImageAttributesColorMatrix'</span> referenced <span style="color: #0000ff;">from</span> C:\FWH2212\LIB\FIVEHC.LIB|GDIPFWH<br />Error: <span style="color: #000000;">Unresolved</span> external <span style="color: #ff0000;">'GdipBitmapGetPixel'</span> referenced <span style="color: #0000ff;">from</span> C:\FWH2212\LIB\FIVEHC.LIB|GDIPFWH<br />Error: <span style="color: #000000;">Unresolved</span> external <span style="color: #ff0000;">'GdipSetImageAttributesColorKeys'</span> referenced <span style="color: #0000ff;">from</span> C:\FWH2212\LIB\FIVEHC.LIB|GDIPFWH<br />Error: <span style="color: #000000;">Unresolved</span> external <span style="color: #ff0000;">'GdipCreateFromHDC'</span> referenced <span style="color: #0000ff;">from</span> C:\FWH2212\LIB\FIVEHC.LIB|GDIPFWH<br />Error: <span style="color: #000000;">Unresolved</span> external <span style="color: #ff0000;">'GdipSetSmoothingMode'</span> referenced <span style="color: #0000ff;">from</span> C:\FWH2212\LIB\FIVEHC.LIB|GDIPFWH<br />Error: <span style="color: #000000;">Unresolved</span> external <span style="color: #ff0000;">'GdipCreateMatrix'</span> referenced <span style="color: #0000ff;">from</span> C:\FWH2212\LIB\FIVEHC.LIB|GDIPFWH<br />Error: <span style="color: #000000;">Unresolved</span> external <span style="color: #ff0000;">'GdipScaleMatrix'</span> referenced <span style="color: #0000ff;">from</span> C:\FWH2212\LIB\FIVEHC.LIB|GDIPFWH<br />Error: <span style="color: #000000;">Unresolved</span> external <span style="color: #ff0000;">'GdipRotateMatrix'</span> referenced <span style="color: #0000ff;">from</span> C:\FWH2212\LIB\FIVEHC.LIB|GDIPFWH<br />Error: <span style="color: #000000;">Unresolved</span> external <span style="color: #ff0000;">'GdipTranslateMatrix'</span> referenced <span style="color: #0000ff;">from</span> C:\FWH2212\LIB\FIVEHC.LIB|GDIPFWH<br />Error: <span style="color: #000000;">Unresolved</span> external <span style="color: #ff0000;">'GdipSetWorldTransform'</span> referenced <span style="color: #0000ff;">from</span> C:\FWH2212\LIB\FIVEHC.LIB|GDIPFWH<br />Error: <span style="color: #000000;">Unresolved</span> external <span style="color: #ff0000;">'GdipDrawImageRectRectI'</span> referenced <span style="color: #0000ff;">from</span> C:\FWH2212\LIB\FIVEHC.LIB|GDIPFWH<br />Error: <span style="color: #000000;">Unresolved</span> external <span style="color: #ff0000;">'GdipDrawImageI'</span> referenced <span style="color: #0000ff;">from</span> C:\FWH2212\LIB\FIVEHC.LIB|GDIPFWH<br />Error: <span style="color: #000000;">Unresolved</span> external <span style="color: #ff0000;">'GdipResetWorldTransform'</span> referenced <span style="color: #0000ff;">from</span> C:\FWH2212\LIB\FIVEHC.LIB|GDIPFWH<br />Error: <span style="color: #000000;">Unresolved</span> external <span style="color: #ff0000;">'GdipCreateBitmapFromHBITMAP'</span> referenced <span style="color: #0000ff;">from</span> C:\FWH2212\LIB\FIVEHC.LIB|GDIPFWH<br />Error: <span style="color: #000000;">Unresolved</span> external <span style="color: #ff0000;">'PrintWindow'</span> referenced <span style="color: #0000ff;">from</span> C:\FWH2212\LIB\FIVEHC.LIB|RIBBON<br />Error: <span style="color: #000000;">Unresolved</span> external <span style="color: #ff0000;">'GdipCreateHBITMAPFromBitmap'</span> referenced <span style="color: #0000ff;">from</span> C:\FWH2212\LIB\FIVEHC.LIB|GDIPFWH<br />Error: <span style="color: #000000;">Unresolved</span> external <span style="color: #ff0000;">'GdipSetImageAttributesRemapTable'</span> referenced <span style="color: #0000ff;">from</span> C:\FWH2212\LIB\FIVEHC.LIB|GDIPLUS<br />Error: <span style="color: #000000;">Unresolved</span> external <span style="color: #ff0000;">'GdipDeletePen'</span> referenced <span style="color: #0000ff;">from</span> C:\FWH2212\LIB\FIVEHC.LIB|GDIPFWH<br />Error: <span style="color: #000000;">Unresolved</span> external <span style="color: #ff0000;">'GdipDeleteCustomLineCap'</span> referenced <span style="color: #0000ff;">from</span> C:\FWH2212\LIB\FIVEHC.LIB|GDIPFWH<br />Error: <span style="color: #000000;">Unresolved</span> external <span style="color: #ff0000;">'GdipCreatePen1'</span> referenced <span style="color: #0000ff;">from</span> C:\FWH2212\LIB\FIVEHC.LIB|GDIPFWH<br />Error: <span style="color: #000000;">Unresolved</span> external <span style="color: #ff0000;">'GdipCreateAdjustableArrowCap'</span> referenced <span style="color: #0000ff;">from</span> C:\FWH2212\LIB\FIVEHC.LIB|GDIPFWH<br />Error: <span style="color: #000000;">Unresolved</span> external <span style="color: #ff0000;">'GdipSetPenStartCap'</span> referenced <span style="color: #0000ff;">from</span> C:\FWH2212\LIB\FIVEHC.LIB|GDIPFWH<br />Error: <span style="color: #000000;">Unresolved</span> external <span style="color: #ff0000;">'GdipSetPenCustomEndCap'</span> referenced <span style="color: #0000ff;">from</span> C:\FWH2212\LIB\FIVEHC.LIB|GDIPFWH<br />Error: <span style="color: #000000;">Unresolved</span> external <span style="color: #ff0000;">'GdipDrawLine'</span> referenced <span style="color: #0000ff;">from</span> C:\FWH2212\LIB\FIVEHC.LIB|GDIPFWH<br />Error: <span style="color: #000000;">Unresolved</span> external <span style="color: #ff0000;">'SHCreateDirectoryExA'</span> referenced <span style="color: #0000ff;">from</span> C:\FWH2212\LIB\FIVEHC.LIB|MKDIR<br />Error: <span style="color: #000000;">Unresolved</span> external <span style="color: #ff0000;">'SHCreateDirectoryExW'</span> referenced <span style="color: #0000ff;">from</span> C:\FWH2212\LIB\FIVEHC.LIB|MKDIR<br />Error: <span style="color: #000000;">Unresolved</span> external <span style="color: #ff0000;">'_hb_arraySetTDT'</span> referenced <span style="color: #0000ff;">from</span> C:\FWH2212\LIB\FIVEHX.LIB|TDTPICKE<br />Error: <span style="color: #000000;">Unresolved</span> external <span style="color: #ff0000;">'GdipDeleteFont'</span> referenced <span style="color: #0000ff;">from</span> C:\FWH2212\LIB\FIVEHC.LIB|GDIPFWH<br />Error: <span style="color: #000000;">Unresolved</span> external <span style="color: #ff0000;">'GdipDeleteBrush'</span> referenced <span style="color: #0000ff;">from</span> C:\FWH2212\LIB\FIVEHC.LIB|GDIPFWH<br />Error: <span style="color: #000000;">Unresolved</span> external <span style="color: #ff0000;">'GdipCloneBrush'</span> referenced <span style="color: #0000ff;">from</span> C:\FWH2212\LIB\FIVEHC.LIB|GDIPFWH<br />Error: <span style="color: #000000;">Unresolved</span> external <span style="color: #ff0000;">'GdipDeleteStringFormat'</span> referenced <span style="color: #0000ff;">from</span> C:\FWH2212\LIB\FIVEHC.LIB|GDIPFWH<br />Error: <span style="color: #000000;">Unresolved</span> external <span style="color: #ff0000;">'GdipCreateFontFromLogfontA'</span> referenced <span style="color: #0000ff;">from</span> C:\FWH2212\LIB\FIVEHC.LIB|GDIPFWH<br />Error: <span style="color: #000000;">Unresolved</span> external <span style="color: #ff0000;">'GdipCreateFontFromDC'</span> referenced <span style="color: #0000ff;">from</span> C:\FWH2212\LIB\FIVEHC.LIB|GDIPFWH<br />Error: <span style="color: #000000;">Unresolved</span> external <span style="color: #ff0000;">'GdipCreateSolidFill'</span> referenced <span style="color: #0000ff;">from</span> C:\FWH2212\LIB\FIVEHC.LIB|GDIPFWH<br />Error: <span style="color: #000000;">Unresolved</span> external <span style="color: #ff0000;">'GdipCreateStringFormat'</span> referenced <span style="color: #0000ff;">from</span> C:\FWH2212\LIB\FIVEHC.LIB|GDIPFWH<br />Error: <span style="color: #000000;">Unresolved</span> external <span style="color: #ff0000;">'GdipSetStringFormatAlign'</span> referenced <span style="color: #0000ff;">from</span> C:\FWH2212\LIB\FIVEHC.LIB|GDIPFWH<br />Error: <span style="color: #000000;">Unresolved</span> external <span style="color: #ff0000;">'GdipSetStringFormatLineAlign'</span> referenced <span style="color: #0000ff;">from</span> C:\FWH2212\LIB\FIVEHC.LIB|GDIPFWH<br />Error: <span style="color: #000000;">Unresolved</span> external <span style="color: #ff0000;">'GdipDrawString'</span> referenced <span style="color: #0000ff;">from</span> C:\FWH2212\LIB\FIVEHC.LIB|GDIPFWH<br />Error: <span style="color: #000000;">Unresolved</span> external <span style="color: #ff0000;">'GdipDeletePath'</span> referenced <span style="color: #0000ff;">from</span> C:\FWH2212\LIB\FIVEHC.LIB|GDIPFWH<br />Error: <span style="color: #000000;">Unresolved</span> external <span style="color: #ff0000;">'GdipDeleteFontFamily'</span> referenced <span style="color: #0000ff;">from</span> C:\FWH2212\LIB\FIVEHC.LIB|GDIPFWH<br />Error: <span style="color: #000000;">Unresolved</span> external <span style="color: #ff0000;">'GdipCreatePath'</span> referenced <span style="color: #0000ff;">from</span> C:\FWH2212\LIB\FIVEHC.LIB|GDIPFWH<br />Error: <span style="color: #000000;">Unresolved</span> external <span style="color: #ff0000;">'GdipCreateFontFamilyFromName'</span> referenced <span style="color: #0000ff;">from</span> C:\FWH2212\LIB\FIVEHC.LIB|GDIPFWH<br />Error: <span style="color: #000000;">Unresolved</span> external <span style="color: #ff0000;">'GdipFillRectangleI'</span> referenced <span style="color: #0000ff;">from</span> C:\FWH2212\LIB\FIVEHC.LIB|GDIPFWH<br />Error: <span style="color: #000000;">Unresolved</span> external <span style="color: #ff0000;">'GdipAddPathStringI'</span> referenced <span style="color: #0000ff;">from</span> C:\FWH2212\LIB\FIVEHC.LIB|GDIPFWH<br />Error: <span style="color: #000000;">Unresolved</span> external <span style="color: #ff0000;">'GdipDrawPath'</span> referenced <span style="color: #0000ff;">from</span> C:\FWH2212\LIB\FIVEHC.LIB|GDIPFWH<br />Error: <span style="color: #000000;">Unresolved</span> external <span style="color: #ff0000;">'GdipFillPath'</span> referenced <span style="color: #0000ff;">from</span> C:\FWH2212\LIB\FIVEHC.LIB|GDIPFWH<br />Error: <span style="color: #000000;">Unresolved</span> external <span style="color: #ff0000;">'GdipDeleteRegion'</span> referenced <span style="color: #0000ff;">from</span> C:\FWH2212\LIB\FIVEHC.LIB|GDIPFWH<br />Error: <span style="color: #000000;">Unresolved</span> external <span style="color: #ff0000;">'GdipAddPathEllipseI'</span> referenced <span style="color: #0000ff;">from</span> C:\FWH2212\LIB\FIVEHC.LIB|GDIPFWH<br />Error: <span style="color: #000000;">Unresolved</span> external <span style="color: #ff0000;">'GdipCreateRegionPath'</span> referenced <span style="color: #0000ff;">from</span> C:\FWH2212\LIB\FIVEHC.LIB|GDIPFWH<br />Error: <span style="color: #000000;">Unresolved</span> external <span style="color: #ff0000;">'GdipCreateRegionRectI'</span> referenced <span style="color: #0000ff;">from</span> C:\FWH2212\LIB\FIVEHC.LIB|GDIPFWH<br />Error: <span style="color: #000000;">Unresolved</span> external <span style="color: #ff0000;">'GdipSetClipRegion'</span> referenced <span style="color: #0000ff;">from</span> C:\FWH2212\LIB\FIVEHC.LIB|GDIPFWH<br />Error: <span style="color: #000000;">Unresolved</span> external <span style="color: #ff0000;">'GdipDrawImageRectRect'</span> referenced <span style="color: #0000ff;">from</span> C:\FWH2212\LIB\FIVEHC.LIB|GDIPFWH<br />Error: <span style="color: #000000;">Unresolved</span> external <span style="color: #ff0000;">'GdipCloneBitmapAreaI'</span> referenced <span style="color: #0000ff;">from</span> C:\FWH2212\LIB\FIVEHC.LIB|GDIPFWH<br />Error: <span style="color: #000000;">Unresolved</span> external <span style="color: #ff0000;">'GdipDrawArcI'</span> referenced <span style="color: #0000ff;">from</span> C:\FWH2212\LIB\FIVEHC.LIB|GDIPFWH<br />Error: <span style="color: #000000;">Unresolved</span> external <span style="color: #ff0000;">'GdipDrawPolygonI'</span> referenced <span style="color: #0000ff;">from</span> C:\FWH2212\LIB\FIVEHC.LIB|GDIPFWH<br />Error: <span style="color: #000000;">Unresolved</span> external <span style="color: #ff0000;">'GdipFillPolygonI'</span> referenced <span style="color: #0000ff;">from</span> C:\FWH2212\LIB\FIVEHC.LIB|GDIPFWH<br />Error: <span style="color: #000000;">Unresolved</span> external <span style="color: #ff0000;">'GdipDrawBeziersI'</span> referenced <span style="color: #0000ff;">from</span> C:\FWH2212\LIB\FIVEHC.LIB|GDIPFWH<br />Error: <span style="color: #000000;">Unresolved</span> external <span style="color: #ff0000;">'GdipDrawLinesI'</span> referenced <span style="color: #0000ff;">from</span> C:\FWH2212\LIB\FIVEHC.LIB|GDIPFWH<br />Error: <span style="color: #000000;">Unresolved</span> external <span style="color: #ff0000;">'GdipDrawClosedCurve2I'</span> referenced <span style="color: #0000ff;">from</span> C:\FWH2212\LIB\FIVEHC.LIB|GDIPFWH<br />Error: <span style="color: #000000;">Unresolved</span> external <span style="color: #ff0000;">'GdipDrawCurve2I'</span> referenced <span style="color: #0000ff;">from</span> C:\FWH2212\LIB\FIVEHC.LIB|GDIPFWH<br />Error: <span style="color: #000000;">Unresolved</span> external <span style="color: #ff0000;">'GdipFillClosedCurve2I'</span> referenced <span style="color: #0000ff;">from</span> C:\FWH2212\LIB\FIVEHC.LIB|GDIPFWH<br />Error: <span style="color: #000000;">Unresolved</span> external <span style="color: #ff0000;">'GdipDrawPieI'</span> referenced <span style="color: #0000ff;">from</span> C:\FWH2212\LIB\FIVEHC.LIB|GDIPFWH<br />Error: <span style="color: #000000;">Unresolved</span> external <span style="color: #ff0000;">'GdipFillPieI'</span> referenced <span style="color: #0000ff;">from</span> C:\FWH2212\LIB\FIVEHC.LIB|GDIPFWH<br />Error: <span style="color: #000000;">Unresolved</span> external <span style="color: #ff0000;">'GdipDrawEllipseI'</span> referenced <span style="color: #0000ff;">from</span> C:\FWH2212\LIB\FIVEHC.LIB|GDIPFWH<br />Error: <span style="color: #000000;">Unresolved</span> external <span style="color: #ff0000;">'GdipFillEllipseI'</span> referenced <span style="color: #0000ff;">from</span> C:\FWH2212\LIB\FIVEHC.LIB|GDIPFWH<br />Error: <span style="color: #000000;">Unresolved</span> external <span style="color: #ff0000;">'GdipDrawRectangleI'</span> referenced <span style="color: #0000ff;">from</span> C:\FWH2212\LIB\FIVEHC.LIB|GDIPFWH<br />Error: <span style="color: #000000;">Unresolved</span> external <span style="color: #ff0000;">'GdipGetImageEncodersSize'</span> referenced <span style="color: #0000ff;">from</span> C:\FWH2212\LIB\FIVEHC.LIB|GDIPFWH<br />Error: <span style="color: #000000;">Unresolved</span> external <span style="color: #ff0000;">'GdipGetImageEncoders'</span> referenced <span style="color: #0000ff;">from</span> C:\FWH2212\LIB\FIVEHC.LIB|GDIPFWH<br />Error: <span style="color: #000000;">Unresolved</span> external <span style="color: #ff0000;">'GdipBitmapSetResolution'</span> referenced <span style="color: #0000ff;">from</span> C:\FWH2212\LIB\FIVEHC.LIB|GDIPFWH<br />Error: <span style="color: #000000;">Unresolved</span> external <span style="color: #ff0000;">'GdipGraphicsClear'</span> referenced <span style="color: #0000ff;">from</span> C:\FWH2212\LIB\FIVEHC.LIB|GDIPFWH<br />Error: <span style="color: #000000;">Unresolved</span> external <span style="color: #ff0000;">'GdipSaveImageToFile'</span> referenced <span style="color: #0000ff;">from</span> C:\FWH2212\LIB\FIVEHC.LIB|GDIPFWH<br />Error: <span style="color: #000000;">Unresolved</span> external <span style="color: #ff0000;">'GdipFillRectangle'</span> referenced <span style="color: #0000ff;">from</span> C:\FWH2212\LIB\FIVEHC.LIB|GDIPLUS<br />Error: <span style="color: #000000;">Unresolved</span> external <span style="color: #ff0000;">'GdipDrawRectangle'</span> referenced <span style="color: #0000ff;">from</span> C:\FWH2212\LIB\FIVEHC.LIB|GDIPLUS<br />Error: <span style="color: #000000;">Unresolved</span> external <span style="color: #ff0000;">'GdipFillEllipse'</span> referenced <span style="color: #0000ff;">from</span> C:\FWH2212\LIB\FIVEHC.LIB|GDIPLUS<br />Error: <span style="color: #000000;">Unresolved</span> external <span style="color: #ff0000;">'GdipDrawEllipse'</span> referenced <span style="color: #0000ff;">from</span> C:\FWH2212\LIB\FIVEHC.LIB|GDIPLUS<br />Error: <span style="color: #000000;">Unresolved</span> external <span style="color: #ff0000;">'GdipDrawArc'</span> referenced <span style="color: #0000ff;">from</span> C:\FWH2212\LIB\FIVEHC.LIB|GDIPLUS<br />Error: <span style="color: #000000;">Unresolved</span> external <span style="color: #ff0000;">'GdipCreateFont'</span> referenced <span style="color: #0000ff;">from</span> C:\FWH2212\LIB\FIVEHC.LIB|GDIPLUS<br />Error: <span style="color: #000000;">Unresolved</span> external <span style="color: #ff0000;">'GdipTranslateWorldTransform'</span> referenced <span style="color: #0000ff;">from</span> C:\FWH2212\LIB\FIVEHC.LIB|GDIPLUS<br />Error: <span style="color: #000000;">Unresolved</span> external <span style="color: #ff0000;">'GdipRotateWorldTransform'</span> referenced <span style="color: #0000ff;">from</span> C:\FWH2212\LIB\FIVEHC.LIB|GDIPLUS<br />Error: <span style="color: #000000;">Unresolved</span> external <span style="color: #ff0000;">'GdipScaleWorldTransform'</span> referenced <span style="color: #0000ff;">from</span> C:\FWH2212\LIB\FIVEHC.LIB|GDIPLUS<br />Error: <span style="color: #000000;">Unresolved</span> external <span style="color: #ff0000;">'GdipSetPageUnit'</span> referenced <span style="color: #0000ff;">from</span> C:\FWH2212\LIB\FIVEHC.LIB|GDIPLUS<br />Error: <span style="color: #000000;">Unresolved</span> external <span style="color: #ff0000;">'GdipCreateFromHWNDICM'</span> referenced <span style="color: #0000ff;">from</span> C:\FWH2212\LIB\FIVEHC.LIB|GDIPLUS<br />Error: <span style="color: #000000;">Unresolved</span> external <span style="color: #ff0000;">'GdipCreateFromHWND'</span> referenced <span style="color: #0000ff;">from</span> C:\FWH2212\LIB\FIVEHC.LIB|GDIPLUS<br />Error: <span style="color: #000000;">Unresolved</span> external <span style="color: #ff0000;">'GdipIsVisibleRegionPointI'</span> referenced <span style="color: #0000ff;">from</span> C:\FWH2212\LIB\FIVEHC.LIB|GDIPLUS<br />Error: <span style="color: #000000;">Unresolved</span> external <span style="color: #ff0000;">'GdipSetPenColor'</span> referenced <span style="color: #0000ff;">from</span> C:\FWH2212\LIB\FIVEHC.LIB|GDIPLUS<br />Error: <span style="color: #000000;">Unresolved</span> external <span style="color: #ff0000;">'GdipSetPenMode'</span> referenced <span style="color: #0000ff;">from</span> C:\FWH2212\LIB\FIVEHC.LIB|GDIPLUS<br />Error: <span style="color: #000000;">Unresolved</span> external <span style="color: #ff0000;">'GdipSetPenLineJoin'</span> referenced <span style="color: #0000ff;">from</span> C:\FWH2212\LIB\FIVEHC.LIB|GDIPLUS<br />Error: <span style="color: #000000;">Unresolved</span> external <span style="color: #ff0000;">'GdipSetPenWidth'</span> referenced <span style="color: #0000ff;">from</span> C:\FWH2212\LIB\FIVEHC.LIB|GDIPLUS<br />Error: <span style="color: #000000;">Unresolved</span> external <span style="color: #ff0000;">'GdipSetPenLineCap197819'</span> referenced <span style="color: #0000ff;">from</span> C:\FWH2212\LIB\FIVEHC.LIB|GDIPLUS<br />Error: <span style="color: #000000;">Unresolved</span> external <span style="color: #ff0000;">'GdipCreateLineBrushFromRectI'</span> referenced <span style="color: #0000ff;">from</span> C:\FWH2212\LIB\FIVEHC.LIB|GDIPLUS<br />Error: <span style="color: #000000;">Unresolved</span> external <span style="color: #ff0000;">'GdipCreateLineBrushFromRectWithAngleI'</span> referenced <span style="color: #0000ff;">from</span> C:\FWH2212\LIB\FIVEHC.LIB|GDIPLUS<br />Error: <span style="color: #000000;">Unresolved</span> external <span style="color: #ff0000;">'GdiplusStartup'</span> referenced <span style="color: #0000ff;">from</span> C:\FWH2212\LIB\FIVEHC.LIB|GDIPLUS<br />Error: <span style="color: #000000;">Unresolved</span> external <span style="color: #ff0000;">'GdiplusShutdown'</span> referenced <span style="color: #0000ff;">from</span> C:\FWH2212\LIB\FIVEHC.LIB|GDIPLUS<br />Error: <span style="color: #000000;">Unresolved</span> external <span style="color: #ff0000;">'GdipAddPathArcI'</span> referenced <span style="color: #0000ff;">from</span> C:\FWH2212\LIB\FIVEHC.LIB|GDIPLUS<br />Error: <span style="color: #000000;">Unresolved</span> external <span style="color: #ff0000;">'GdipAddPathLineI'</span> referenced <span style="color: #0000ff;">from</span> C:\FWH2212\LIB\FIVEHC.LIB|GDIPLUS<br />Error: <span style="color: #000000;">Unresolved</span> external <span style="color: #ff0000;">'GdipAddPathRectangleI'</span> referenced <span style="color: #0000ff;">from</span> C:\FWH2212\LIB\FIVEHC.LIB|GDIPLUS<br />Error: <span style="color: #000000;">Unresolved</span> external <span style="color: #ff0000;">'GdipClosePathFigure'</span> referenced <span style="color: #0000ff;">from</span> C:\FWH2212\LIB\FIVEHC.LIB|GDIPLUS<br />Error: <span style="color: #000000;">Unresolved</span> external <span style="color: #ff0000;">'GdipStartPathFigure'</span> referenced <span style="color: #0000ff;">from</span> C:\FWH2212\LIB\FIVEHC.LIB|GDIPLUS<br />Error: <span style="color: #000000;">Unresolved</span> external <span style="color: #ff0000;">'GdipSetMatrixElements'</span> referenced <span style="color: #0000ff;">from</span> C:\FWH2212\LIB\FIVEHC.LIB|GDIPLUS<br />Error: <span style="color: #000000;">Unresolved</span> external <span style="color: #ff0000;">'GdipTransformPath'</span> referenced <span style="color: #0000ff;">from</span> C:\FWH2212\LIB\FIVEHC.LIB|GDIPLUS<br />Error: <span style="color: #000000;">Unresolved</span> external <span style="color: #ff0000;">'GdipSetInterpolationMode'</span> referenced <span style="color: #0000ff;">from</span> C:\FWH2212\LIB\FIVEHC.LIB|GDIPLUS<br />Error: <span style="color: #000000;">Unresolved</span> external <span style="color: #ff0000;">'GdipImageRotateFlip'</span> referenced <span style="color: #0000ff;">from</span> C:\FWH2212\LIB\FIVEHC.LIB|GDIPLUS<br />Error: <span style="color: #000000;">Unresolved</span> external <span style="color: #ff0000;">'GdipBitmapSetPixel'</span> referenced <span style="color: #0000ff;">from</span> C:\FWH2212\LIB\FIVEHC.LIB|GDIPLUS<br />Error: <span style="color: #000000;">Unresolved</span> external <span style="color: #ff0000;">'GdipGetImageThumbnail'</span> referenced <span style="color: #0000ff;">from</span> C:\FWH2212\LIB\FIVEHC.LIB|GDIPLUS<br />Error: <span style="color: #000000;">Unresolved</span> external <span style="color: #ff0000;">'GdipCreateMetafileFromStream'</span> referenced <span style="color: #0000ff;">from</span> C:\FWH2212\LIB\FIVEHC.LIB|GDIPLUS<br />Error: <span style="color: #000000;">Unresolved</span> external <span style="color: #ff0000;">'GdipCreateBitmapFromFile'</span> referenced <span style="color: #0000ff;">from</span> C:\FWH2212\LIB\FIVEHC.LIB|GDIPLUS<br />Error: <span style="color: #000000;">Unresolved</span> external <span style="color: #ff0000;">'GdipImageGetFrameDimensionsCount'</span> referenced <span style="color: #0000ff;">from</span> C:\FWH2212\LIB\FIVEHC.LIB|GDIPLUS<br />Error: <span style="color: #000000;">Unresolved</span> external <span style="color: #ff0000;">'GdipImageGetFrameDimensionsList'</span> referenced <span style="color: #0000ff;">from</span> C:\FWH2212\LIB\FIVEHC.LIB|GDIPLUS<br />Error: <span style="color: #000000;">Unresolved</span> external <span style="color: #ff0000;">'GdipImageGetFrameCount'</span> referenced <span style="color: #0000ff;">from</span> C:\FWH2212\LIB\FIVEHC.LIB|GDIPLUS<br />Error: <span style="color: #000000;">Unresolved</span> external <span style="color: #ff0000;">'GdipImageSelectActiveFrame'</span> referenced <span style="color: #0000ff;">from</span> C:\FWH2212\LIB\FIVEHC.LIB|GDIPLUS<br />Error: <span style="color: #000000;">Unresolved</span> external <span style="color: #ff0000;">'GdipResetClip'</span> referenced <span style="color: #0000ff;">from</span> C:\FWH2212\LIB\FIVEHC.LIB|GDIPFWH<br />Error: <span style="color: #000000;">Unresolved</span> external <span style="color: #ff0000;">'GdipCreateLineBrushI'</span> referenced <span style="color: #0000ff;">from</span> C:\FWH2212\LIB\FIVEHC.LIB|GDIPFWH<br />Error: <span style="color: #000000;">Unresolved</span> external <span style="color: #ff0000;">'GdipSetLinePresetBlend'</span> referenced <span style="color: #0000ff;">from</span> C:\FWH2212\LIB\FIVEHC.LIB|GDIPFWH<br />Error: <span style="color: #000000;">Unresolved</span> external <span style="color: #ff0000;">'GdipAddPathPieI'</span> referenced <span style="color: #0000ff;">from</span> C:\FWH2212\LIB\FIVEHC.LIB|GDIPFWH<br />Error: <span style="color: #000000;">Unresolved</span> external <span style="color: #ff0000;">'_HB_FUN_HB_JSONENCODE'</span> referenced <span style="color: #0000ff;">from</span> C:\FWH2212\LIB\FIVEHX.LIB|VALTOSTR<br />Error: <span style="color: #000000;">Unresolved</span> external <span style="color: #ff0000;">'_HB_FUN_HB_JSONDECODE'</span> referenced <span style="color: #0000ff;">from</span> C:\FWH2212\LIB\FIVEHX.LIB|VALTOSTR<br />Error: <span style="color: #000000;">Unresolved</span> external <span style="color: #ff0000;">'GdipCreateTexture'</span> referenced <span style="color: #0000ff;">from</span> C:\FWH2212\LIB\FIVEHC.LIB|GDIPFWH<br />Error: <span style="color: #000000;">Unresolved</span> external <span style="color: #ff0000;">'_HB_FUN_MENUDRAWITEM'</span> referenced <span style="color: #0000ff;">from</span> C:\TMP\SISREV5\<span style="color: #0000ff;">WINDOW</span>.OBJ<br />Error: <span style="color: #000000;">Unresolved</span> external <span style="color: #ff0000;">'_HB_FUN_MENUDRAW2007'</span> referenced <span style="color: #0000ff;">from</span> C:\TMP\SISREV5\<span style="color: #0000ff;">WINDOW</span>.OBJ<br />Error: <span style="color: #000000;">Unresolved</span> external <span style="color: #ff0000;">'_HB_FUN_MENUMEASUREITEM'</span> referenced <span style="color: #0000ff;">from</span> C:\TMP\SISREV5\<span style="color: #0000ff;">WINDOW</span>.OBJ<br />Error: <span style="color: #000000;">Unresolved</span> external <span style="color: #ff0000;">'_HB_FUN_XFREEPROC'</span> referenced <span style="color: #0000ff;">from</span> C:\TMP\SISREV5\<span style="color: #0000ff;">WINDOW</span>.OBJ<br /> </div>[/code:2v391e21] |
to compile - WebView - Bcc55 - xHarbour | [quote="Ari":1nw40p23][code=fw:1nw40p23]<div class="fw" id="{CB}" style="font-family: monospace;">Error: <span style="color: #000000;">Unresolved</span> external <span style="color: #ff0000;">'_hb_vmPushSize'</span> referenced <span style="color: #0000ff;">from</span> C:\FWH2212\LIB\FIVEHC.LIB|FFDLGPRC</div>[/code:1nw40p23][/quote:1nw40p23]
Probably you are using a version of xHarbour that is too old. Please try with the latest version 10270 (just released):
[url:1nw40p23]http://xharbour.org/index.asp?page=download/windows/binaries_win[/url:1nw40p23]
And BCC55 is older too. Please use BCC 7.40:
[url:1nw40p23]http://xharbour.org/index.asp?page=download/windows/required_win[/url:1nw40p23]
Or better switch to MSC. |
to compile - WebView - Bcc55 - xHarbour | Grato. |
to convert file.dll | hi,
I have a file DLL make by Borland Resource Workshop (more than ten years old).
my pc has windows 7 home premium 64 bit.
I can try open it by pelles C but nothing (error reading from file "xyz.dll" not a valid win32 application).
I would like to convert that .DLL
how can I do?
thanks |
to convert file.dll | <!-- l --><a class="postlink-local" href="http://forums.fivetechsupport.com/viewtopic.php?f=6&t=14830&hilit=convertir+a+dll+de+32+bits#p76597">viewtopic.php?f=6&t=14830&hilit=convertir+a+dll+de+32+bits#p76597</a><!-- l --> |
to convert file.dll | hi mr navarro
I have not Borland Resource Workshop... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.