Page 2 of 3

Re: fwdbu request

PostPosted: Tue Mar 27, 2018 7:29 am
by Marc Venken
TimStone wrote:Antonio,

Schedule.prg is the program I worked on with two other FW developers, which we shared freely, and it is fine to be in the samples. It uses the Codejock library.

This specific version is pretty enhanced, and is used by most of my clients very heavily. It allows for very detailed appointments, repeating ones, assigning people to them, tracking clients and their service items, color coded work types, and much more. It displays like Outlook, and allows multiple appointments for the same, or overlapping, times.

Tim


The version i see 17.15 is giving errors. Is there a newer version ? I would like to see it.

Re: fwdbu request

PostPosted: Tue Mar 27, 2018 7:32 am
by Marc Venken
Antonio,

Maybe you can put the print (structure) button in the new release ? So we don't have to copy /paste ? Would be handy...

Re: fwdbu request

PostPosted: Tue Mar 27, 2018 7:55 am
by Carlos Mora
Antonio Linares wrote:Silvio,

Code: Select all  Expand view
  for n = 1 to 15
      if ! Empty( ( Alias() )->( IndexKey( n ) ) )
         cCode += CRLF + CRLF + "INDEX ON " + ( Alias() )->( IndexKey( n ) ) + ;
                  If( ( Alias() )->( RddName() ) == "DBFNTX", " TO ", " TAG " ) + ;
                  ( Alias() )->( OrdName( n ) )
      endif
   next


To have the complete picture, we can also add FOR conditions for indexes (I use them a lot)

Code: Select all  Expand view
  for n = 1 to 15
      if ! Empty( ( Alias() )->( IndexKey( n ) ) )
         cCode += CRLF + CRLF + "INDEX ON " + ( Alias() )->( IndexKey( n ) ) + ;
                  If( ( Alias() )->( RddName() ) == "DBFNTX", " TO ", " TAG " ) + ;
                  ( Alias() )->( OrdName( n ) )
         IF !Empty( OrdFor(n) )
            cCode+= ' FOR '+OrdFor(n)
         ENDIF
      endif
   next


A question: ¿Is there any reason to call the functions prefixed with '( Alias() )->()'? I think it has no efect aliasing the current workarea. May be there is a missing parameter for the Alias() call...

Re: fwdbu request

PostPosted: Tue Mar 27, 2018 9:04 am
by Marc Venken
I see here options to create indexes, but has someone a option (code) for the folowing :

I have a app. (Xbrowse) with lots of fields and already many indexes.

I see that I often need a other index to sort the data a better way. Is there a sample that will build a index while te program is running ?
or a function that will give all fields and where we can put a kind of rule to create a index ?

Re: fwdbu request

PostPosted: Tue Mar 27, 2018 10:10 am
by Otto
Hello,
If you want to create index purely in memory you can use
( cAlias )->( FW_CdxCreate( niL, .T. ) ) --> lSuccess
Note: Creation in memory if available only in the recent versions 17.09 and 17.11

BTW- does someone know if there is a Limit of TAGs you can create.
I do not see any limitation in FW_CdxCreate .

FW errorsys.prg
Looks
for j = 1 to 15 .
I will remember that 15 was the maximum at Clippertimes.
If this is still true I think in FW_CdxCreate we need a limitation if it is not true errorsys needs an update.



Best regards,
Otto

Re: fwdbu request

PostPosted: Tue Mar 27, 2018 11:32 am
by Antonio Linares
Carlos,

many thanks. This is the final version:

Code: Select all  Expand view
for n = 1 to 15
      if ! Empty( IndexKey( n ) )
         cCode += CRLF + CRLF + "INDEX ON " + IndexKey( n ) + ;
                  If( RddName() == "DBFNTX", " TO ", " TAG " ) + ;
                  OrdName( n )
         if ! Empty( OrdFor( n ) )
            cCode += ' FOR ' + OrdFor( n )
         endif
      endif
   next
 

Re: fwdbu request

PostPosted: Tue Mar 27, 2018 11:50 am
by Antonio Linares
Marc and all,

This is the most recent FiveDBU version. Free and full source code included :-)

https://bitbucket.org/fivetech/fivewin-contributions/downloads/fivedbu_20180327.zip

Image

Re: fwdbu request

PostPosted: Tue Mar 27, 2018 11:54 am
by Antonio Linares
Marc,

Marc Venken wrote:I see here options to create indexes, but has someone a option (code) for the folowing :

I have a app. (Xbrowse) with lots of fields and already many indexes.

I see that I often need a other index to sort the data a better way. Is there a sample that will build a index while te program is running ?
or a function that will give all fields and where we can put a kind of rule to create a index ?


FiveDBU lets you create new Indexes tags on the run :-)

Re: fwdbu request

PostPosted: Tue Mar 27, 2018 12:41 pm
by Otto
Hello Antonio,
I did following test.

use ( "artikel" ) new
artikel->( FW_CdxCreate( niL, .T. ) )


It seems Harbour can handle more Indexes than 15.
for n = 1 to 15
Errorsys does also use only 15.

Best regards,
Otto




use ( "artikel" ) new
artikel->( FW_CdxCreate( niL, .T. ) )


1: => ARTIKEL RddName: DBFCDX
==============================
RecNo RecCount BOF EOF
1 1349 .F. .F.

Indexes in use TagName
1 Upper(field->artikelnum) AR_NR
2 field->liefernum AR_LIEF
3 Upper(field->kategorie)+ Upper(fielAR_KATE
4 STR(field->liefernum)+ Upper(field-AR_BEST
5 Upper(field->bezeichnun) AR_BEZ
6 Upper(field->kategorie) AR_KUNIQUE
7 field->kategorie1+ str(field->positAR_UMSATZ
8 (field->dbgesamt) AR_DBGES
9 field->konto AR_KONTO
10 field->taste AR_TASTE
11 Upper(field->druckkat)+ field->drucAR_DRUCK
12 Upper(field->kategorie1) AR_K1UNI
13 Upper(field->druckkat) AR_D_KUNI
14 UPPER(ARTIKELNUM) ARTIKELNUM
15 UPPER(KATEGORIE) KATEGORIE
16 UPPER(DRUCKKAT) DRUCKKAT
17 POSITION POSITION
18 UPPER(DRUCKPOS) DRUCKPOS
19 UPPER(KATEGORIE1) KATEGORIE1
20 UPPER(BEZEICHNUN) BEZEICHNUN
21 UPPER(BEZEICH2) BEZEICH2
22 UPPER(TAG) TAG
23 MWST_SATZ MWST_SATZ
24 LIEFERNUM LIEFERNUM
25 UPPER(LIEFERNAME) LIEFERNAME
26 UPPER(BESTELLNUM) BESTELLNUM
27 UPPER(ANMERK) ANMERK
28 EK_PREIS EK_PREIS
29 B_PREIS B_PREIS
30 BEZUGSKOST BEZUGSKOST
31 EINSTANDPR EINSTANDPR
32 VK_PREIS VK_PREIS
33 UPPER(BEMERKUNG) BEMERKUNG
34 MAX_BEST MAX_BEST
35 SOLL_BEST SOLL_BEST
36 IST_BEST IST_BEST
37 KALKAUF KALKAUF
38 BESTELLMEN BESTELLMEN
39 VK_MENGE VK_MENGE
40 DATUM DATUM
41 KONTO KONTO
42 BESTELLT BESTELLT
43 B_DATUM B_DATUM
44 B_MENGE B_MENGE
45 GEST GEST
46 BEDIENUNG BEDIENUNG
47 ROHAUF ROHAUF
48 UPPER(EINHEIT) EINHEIT
49 GSTKENN GSTKENN
50 DBGESAMT DBGESAMT
51 A_DATE A_DATE
52 E_DATE E_DATE
53 TASTE TASTE
54 UPPER(TAEGLICH) TAEGLICH
55 UPPER(AENDERN) AENDERN

Relations in use



local aFields := { { "ARTIKELNUM", "C", 13, 0 },;
{ "KATEGORIE", "C", 20, 0 },;
{ "DRUCKKAT", "C", 35, 0 },;
{ "POSITION", "N", 3, 0 },;
{ "DRUCKPOS", "C", 5, 0 },;
{ "KATEGORIE1", "C", 20, 0 },;
{ "BEZEICHNUN", "C", 34, 0 },;
{ "BEZEICH2", "C", 160, 0 },;
{ "TAG", "C", 1, 0 },;
{ "MWST_SATZ", "N", 6, 2 },;
{ "LIEFERNUM", "N", 6, 0 },;
{ "LIEFERNAME", "C", 30, 0 },;
{ "BESTELLNUM", "C", 15, 0 },;
{ "ANMERK", "C", 30, 0 },;
{ "EK_PREIS", "N", 10, 2 },;
{ "B_PREIS", "N", 10, 2 },;
{ "BEZUGSKOST", "N", 8, 2 },;
{ "EINSTANDPR", "N", 10, 2 },;
{ "VK_PREIS", "N", 10, 2 },;
{ "BEMERKUNG", "C", 72, 0 },;
{ "MAX_BEST", "N", 9, 2 },;
{ "SOLL_BEST", "N", 9, 2 },;
{ "IST_BEST", "N", 9, 2 },;
{ "KALKAUF", "N", 8, 2 },;
{ "BESTELLMEN", "N", 9, 2 },;
{ "VK_MENGE", "N", 9, 2 },;
{ "DATUM", "D", 8, 0 },;
{ "KONTO", "N", 10, 0 },;
{ "BESTELLT", "N", 9, 2 },;
{ "B_DATUM", "D", 8, 0 },;
{ "B_MENGE", "N", 9, 2 },;
{ "GEST", "N", 5, 2 },;
{ "BEDIENUNG", "N", 5, 2 },;
{ "ROHAUF", "N", 7, 2 },;
{ "EINHEIT", "C", 5, 0 },;
{ "GSTKENN", "N", 1, 0 },;
{ "DBGESAMT", "N", 13, 2 },;
{ "A_DATE", "D", 8, 0 },;
{ "E_DATE", "D", 8, 0 },;
{ "TASTE", "N", 4, 0 },;
{ "TAEGLICH", "C", 1, 0 },;
{ "AENDERN", "C", 1, 0 },;
{ "VK_PREIS1", "N", 10, 2 },;
{ "VK_PREIS2", "N", 10, 2 },;
{ "VK_PREIS3", "N", 10, 2 },;
{ "VK_PREIS4", "N", 10, 2 },;
{ "VK_PREIS5", "N", 10, 2 },;
{ "VK_PREIS6", "N", 10, 2 },;
{ "VK_PREIS7", "N", 10, 2 },;
{ "VK_PREIS8", "N", 10, 2 },;
{ "VON1", "D", 8, 0 },;
{ "VON2", "D", 8, 0 },;
{ "VON3", "D", 8, 0 },;
{ "VON4", "D", 8, 0 },;
{ "VON5", "D", 8, 0 },;
{ "VON6", "D", 8, 0 },;
{ "VON7", "D", 8, 0 },;
{ "VON8", "D", 8, 0 },;
{ "BIS1", "D", 8, 0 },;
{ "BIS2", "D", 8, 0 },;
{ "BIS3", "D", 8, 0 },;
{ "BIS4", "D", 8, 0 },;
{ "BIS5", "D", 8, 0 },;
{ "BIS6", "D", 8, 0 },;
{ "BIS7", "D", 8, 0 },;
{ "BIS8", "D", 8, 0 },;
{ "MENU", "N", 1, 0 },;
{ "SAISON", "L", 1, 0 },;
{ "KATEGORIE2", "N", 2, 0 },;
{ "WE", "N", 10, 2 },;
{ "KURTAXE", "L", 1, 0 },;
{ "PROVISION", "L", 1, 0 },;
{ "KELLNERLAG", "L", 1, 0 },;
{ "GROUPLINK", "C", 2, 0 },;
{ "FLAGMWST", "C", 2, 0 },;
{ "FLAGKUECHE", "C", 2, 0 },;
{ "KP", "C", 2, 0 },;
{ "PAUSCHALE", "L", 1, 0 },;
{ "GUELTIG", "N", 2, 0 },;
{ "UMSATZ", "N", 15, 2 },;
{ "UNIWELL", "L", 1, 0 },;
{ "GSTTEXT", "C", 30, 0 },;
{ "KONTO1", "N", 10, 0 },;
{ "KONTO2", "N", 10, 0 },;
{ "KONTO3", "N", 10, 0 },;
{ "KONTO4", "N", 10, 0 },;
{ "KONTO5", "N", 10, 0 },;
{ "BETRAG1", "N", 10, 2 },;
{ "BETRAG2", "N", 10, 2 },;
{ "BETRAG3", "N", 10, 2 },;
{ "BETRAG4", "N", 10, 2 },;
{ "BETRAG5", "N", 10, 2 },;
{ "ANTEIL1", "C", 15, 0 },;
{ "ANTEIL2", "C", 15, 0 },;
{ "ANTEIL3", "C", 15, 0 },;
{ "ANTEIL4", "C", 15, 0 },;
{ "ANTEIL5", "C", 15, 0 },;
{ "UPDATE", "L", 1, 0 },;
{ "MWST1", "N", 5, 2 },;
{ "MWST2", "N", 5, 2 },;
{ "MWST3", "N", 5, 2 },;
{ "MWST4", "N", 5, 2 },;
{ "MWST5", "N", 5, 2 },;
{ "KONTOBEZ", "C", 30, 0 },;
{ "UEBERS3", "C", 30, 0 },;
{ "S3POS", "N", 5, 0 },;
{ "UEBERS4", "C", 30, 0 },;
{ "S4POS", "N", 5, 0 },;
{ "ANZAHL", "N", 3, 0 },;
{ "STB_ARTNUM", "N", 4, 0 },;
{ "FOLIO", "C", 1, 0 },;
{ "TAX", "N", 1, 0 },;
{ "VON9", "D", 8, 0 },;
{ "BIS9", "D", 8, 0 },;
{ "VK_PREIS9", "N", 10, 2 },;
{ "VON10", "D", 8, 0 },;
{ "BIS10", "D", 8, 0 },;
{ "VK_PREIS10", "N", 10, 2 },;
{ "VON11", "D", 8, 0 },;
{ "BIS11", "D", 8, 0 },;
{ "VK_PREIS11", "N", 10, 2 },;
{ "VON12", "D", 8, 0 },;
{ "BIS12", "D", 8, 0 },;
{ "VK_PREIS12", "N", 10, 2 },;
{ "VON13", "D", 8, 0 },;
{ "BIS13", "D", 8, 0 },;
{ "VK_PREIS13", "N", 10, 2 },;
{ "VON14", "D", 8, 0 },;
{ "BIS14", "D", 8, 0 },;
{ "VK_PREIS14", "N", 10, 2 },;
{ "VON15", "D", 8, 0 },;
{ "BIS15", "D", 8, 0 },;
{ "VK_PREIS15", "N", 10, 2 },;
{ "UPDATEDATE", "D", 8, 0 } }

DbCreate( "myfile.dbf", aFields, "DBFCDX" )

Re: fwdbu request

PostPosted: Tue Mar 27, 2018 2:33 pm
by Antonio Linares
We can enhance FiveDBU code this way:

Code: Select all  Expand view
  n = 1
  while ! Empty( IndexKey( n ) )
      cCode += CRLF + CRLF + "INDEX ON " + IndexKey( n ) + ;
               If( RddName() == "DBFNTX", " TO ", " TAG " ) + ;
               OrdName( n )
      if ! Empty( OrdFor( n ) )
         cCode += ' FOR ' + OrdFor( n )
      endif
      n++
   end
 


thanks for your feedback :-)

Re: fwdbu request

PostPosted: Tue Mar 27, 2018 2:42 pm
by Otto
Dear Antonio,
thank you. The same code is in errorsys.prg too.
Best regards and Happy Easter
Otto

Re: fwdbu request

PostPosted: Tue Mar 27, 2018 3:05 pm
by gdeteran
Antonio
Al elegir un indice, me da este error:

Code: Select all  Expand view
  Error description: Error BASE/1004  No exported method: REFRESH
   Args:
     [   1] = U  

Stack Calls
===========
   Called from:  => REFRESH( 0 )
   Called from: fivedbu.prg => (b)BUILDINDEXESDROPMENU( 176 )
   Called from: .\source\classes\MENU.PRG => TMENU:ACTIVATE( 1586 )
   Called from: .\source\classes\BTNBMP.PRG => TBTNBMP:LBUTTONUP( 934 )
   Called from: .\source\classes\CONTROL.PRG => TCONTROL:HANDLEEVENT( 1721 )
   Called from: .\source\classes\BTNBMP.PRG => TBTNBMP:HANDLEEVENT( 1909 )
   Called from: .\source\classes\WINDOW.PRG => _FWH( 3368 )
   Called from:  => WINRUN( 0 )
   Called from: .\source\classes\WINDOW.PRG => TMDIFRAME:ACTIVATE( 1043 )
   Called from: fivedbu.prg => FIVEDBU( 59 )
 

Re: fwdbu request

PostPosted: Tue Mar 27, 2018 3:17 pm
by Antonio Linares
Otto,

Otto wrote:Dear Antonio,
thank you. The same code is in errorsys.prg too.
Best regards and Happy Easter
Otto


Modified and included for next FWH 18.03

many thanks

Re: fwdbu request

PostPosted: Tue Mar 27, 2018 3:28 pm
by Antonio Linares
Gonzalo,

Arreglado,

Por favor vuelve a descargar FiveDBU, gracias :-)

https://bitbucket.org/fivetech/fivewin-contributions/downloads/fivedbu_20180327.zip

Re: fwdbu request

PostPosted: Wed Mar 28, 2018 6:11 pm
by Otto
Dear Antonio,
in my copy I changed size of the dialogs and I inserted AUTOSORT.
Best regards,
Otto


Image