fwdbu request
- Silvio.Falconi
- Posts: 7110
- Joined: Thu Oct 18, 2012 7:17 pm
fwdbu request
it is possible add to the function TxtStruct( oBrw ) of fivedbu the list of index and key expression and for expression .
thanks
thanks
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)
I use : FiveWin for Harbour November 2023 - January 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
I use : FiveWin for Harbour November 2023 - January 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
- Otto
- Posts: 6396
- Joined: Fri Oct 07, 2005 7:07 pm
- Has thanked: 8 times
- Been thanked: 1 time
- Contact:
Re: fwdbu request
Hello Silvio,
this is a very useful practical feature. Thank you for asking.
Best regards,
Otto
this is a very useful practical feature. Thank you for asking.
Best regards,
Otto
Code: Select all | Expand
function TxtStruct( oBrw )
local cCode := "local aFields := { ", n, bClipboard
local cIndexCode := " Indexes in use " + Space( 23 ) + "TagName" + CRLF
local J := 0
*----------------------------------------------------------
for j = 1 to 15
if ! Empty( ( Alias( n ) )->( IndexKey( j ) ) )
cIndexCode += Space( 8 ) + ;
If( ( Alias( n ) )->( IndexOrd() ) == j, "=> ", " " ) + ;
PadR( ( Alias( n ) )->( IndexKey( j ) ), 35 ) + ;
( Alias( n ) )->( OrdName( j ) ) + ;
CRLF
endif
next
if Empty( oBrw:oRs )
for n = 1 to FCount()
if n > 1
cCode += Space( 19 )
endif
cCode += '{ "' + FieldName( n ) + '", "' + ;
FieldType( n ) + '", ' + ;
AllTrim( Str( FieldLen( n ) ) ) + ", " + ;
AllTrim( Str( FieldDec( n ) ) ) + " },;" + CRLF
next
else
for n = 1 to oBrw:oRS:Fields:Count
if n > 1
cCode += Space( 19 )
endif
cCode += '{ "' + oBrw:oRS:Fields[ n - 1 ]:Name + '", "' + ;
FWAdoFieldType( oBrw:oRs, n ) + '", ' + ;
AllTrim( Str( FWAdoFieldSize( oBrw:oRs, n ) ) ) + ", " + ;
AllTrim( Str( FWAdoFieldDec( oBrw:oRs, n ) ) ) + ;
" },;" + CRLF
next
endif
cCode = SubStr( cCode, 1, Len( cCode ) - 4 ) + " }" + CRLF + CRLF
if Empty( oBrw:oRs )
cCode += 'DbCreate( "myfile.dbf", aFields, "' + RddName() + '" )'
endif
cCode += CRLF + cIndexCode
bClipboard = { | oDlg | AddClipboardButton( oDlg ), cCode }
MemoEdit( bClipboard, FWString( "Code" ) )
return nil
//----------------------------------------------------------------------------//
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
https://www.facebook.com/groups/modharbour.club
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
https://www.facebook.com/groups/modharbour.club
********************************************************************
- Antonio Linares
- Site Admin
- Posts: 42395
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Has thanked: 10 times
- Been thanked: 41 times
- Contact:
Re: fwdbu request
Thanks Otto
I think this is a better implementation as it writes the code that we need to create the indexes :
See the result for FWH\samples\aswapt.dbf:
I think this is a better implementation as it writes the code that we need to create the indexes :
Code: Select all | Expand
function TxtStruct( oBrw )
local cCode := "local aFields := { ", n, bClipboard
if Empty( oBrw:oRs )
for n = 1 to FCount()
if n > 1
cCode += Space( 19 )
endif
cCode += '{ "' + FieldName( n ) + '", "' + ;
FieldType( n ) + '", ' + ;
AllTrim( Str( FieldLen( n ) ) ) + ", " + ;
AllTrim( Str( FieldDec( n ) ) ) + " },;" + CRLF
next
else
for n = 1 to oBrw:oRS:Fields:Count
if n > 1
cCode += Space( 19 )
endif
cCode += '{ "' + oBrw:oRS:Fields[ n - 1 ]:Name + '", "' + ;
FWAdoFieldType( oBrw:oRs, n ) + '", ' + ;
AllTrim( Str( FWAdoFieldSize( oBrw:oRs, n ) ) ) + ", " + ;
AllTrim( Str( FWAdoFieldDec( oBrw:oRs, n ) ) ) + ;
" },;" + CRLF
next
endif
cCode = SubStr( cCode, 1, Len( cCode ) - 4 ) + " }" + CRLF + CRLF
if Empty( oBrw:oRs )
cCode += 'DbCreate( "myfile.dbf", aFields, "' + RddName() + '" )'
endif
for n = 1 to 15
if ! Empty( ( Alias() )->( IndexKey( n ) ) )
cCode += CRLF + CRLF + "INDEX ON " + ( Alias() )->( IndexKey( n ) ) + " TO " + ;
( Alias() )->( OrdName( n ) )
endif
next
bClipboard = { | oDlg | AddClipboardButton( oDlg ), cCode }
MemoEdit( bClipboard, FWString( "Code" ) )
return nil
See the result for FWH\samples\aswapt.dbf:
Code: Select all | Expand
local aFields := { { "APTCLI", "C", 40, 0 },;
{ "APTVEH", "C", 40, 0 },;
{ "APTDAT", "D", 8, 0 },;
{ "APTBTI", "C", 5, 0 },;
{ "APTETI", "C", 5, 0 },;
{ "APTDUR", "N", 5, 0 },;
{ "APTACN", "C", 6, 0 },;
{ "APTLIC", "C", 12, 0 },;
{ "APTQUO", "C", 8, 0 },;
{ "APTASG", "C", 20, 0 },;
{ "APTUSD", "L", 1, 0 },;
{ "APTUID", "C", 12, 0 },;
{ "APTCLR", "C", 2, 0 },;
{ "APTREM", "L", 1, 0 },;
{ "APTBEG", "C", 18, 0 },;
{ "APTEND", "C", 18, 0 },;
{ "APTPHO", "C", 18, 0 },;
{ "APTNOT", "M", 10, 0 },;
{ "APTSUM", "C", 60, 0 },;
{ "APTITV", "N", 4, 0 },;
{ "APTSEQ", "N", 12, 0 },;
{ "APTRON", "L", 1, 0 },;
{ "APTALD", "L", 1, 0 },;
{ "APTMTG", "L", 1, 0 },;
{ "APTPRI", "L", 1, 0 },;
{ "APTIMP", "N", 1, 0 },;
{ "APTBSY", "N", 1, 0 } }
DbCreate( "myfile.dbf", aFields, "DBFCDX" )
INDEX ON dtos(aptdat)+aptbti TO ASWAPT
INDEX ON aptasg+dtos(aptdat)+aptbti TO ASWAPU
INDEX ON aptbeg TO ASWBEG
INDEX ON aptuid TO ASWUID
Code: Select all | Expand
INDEX ON dtos(aptdat)+aptbti TO ASWAPT
INDEX ON aptasg+dtos(aptdat)+aptbti TO ASWAPU
INDEX ON aptbeg TO ASWBEG
INDEX ON aptuid TO ASWUID
- Silvio.Falconi
- Posts: 7110
- Joined: Thu Oct 18, 2012 7:17 pm
Re: fwdbu request
Antonio,
and the tags ?
and the tags ?
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)
I use : FiveWin for Harbour November 2023 - January 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
I use : FiveWin for Harbour November 2023 - January 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
- Otto
- Posts: 6396
- Joined: Fri Oct 07, 2005 7:07 pm
- Has thanked: 8 times
- Been thanked: 1 time
- Contact:
Re: fwdbu request
Dear Antonio,
thank you.
As to show source code is for me one oft he most used functions I inserted a button on the buttonbar for this.
Also the question “Do you want to end” I deleted.
Best regards,
Otto
thank you.
As to show source code is for me one oft he most used functions I inserted a button on the buttonbar for this.
Code: Select all | Expand
DEFINE BUTTON OF oBar PROMPT FWString( "SourceCode" ) RESOURCE "code" ACTION TxtStruct( oBrw )
Also the question “Do you want to end” I deleted.
Code: Select all | Expand
ACTIVATE WINDOW oWndMain MAXIMIZED ;
VALID ( FWMissingStrings(), .T. ) ;
ON PAINT DrawTiled( hDC, oWndMain, oBmpTiled )
Best regards,
Otto
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
https://www.facebook.com/groups/modharbour.club
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
https://www.facebook.com/groups/modharbour.club
********************************************************************
- Otto
- Posts: 6396
- Joined: Fri Oct 07, 2005 7:07 pm
- Has thanked: 8 times
- Been thanked: 1 time
- Contact:
Re: fwdbu request
In my copy I also changed AddClipboardButton:
function AddClipboardButton( oDlg, cText )
local oBtn
@ 238, 6 BUTTON oBtn PROMPT FWString( "Copy to clipboard" ) ;
OF oDlg SIZE 180, 28 PIXEL ;
ACTION ( CopyToClipboard( oDlg:aControls[ 1 ]:GetText() ), oDlg:end() )
return nil
//----------------------------------------------------------------------------//
function AddClipboardButton( oDlg, cText )
local oBtn
@ 238, 6 BUTTON oBtn PROMPT FWString( "Copy to clipboard" ) ;
OF oDlg SIZE 180, 28 PIXEL ;
ACTION ( CopyToClipboard( oDlg:aControls[ 1 ]:GetText() ), oDlg:end() )
return nil
//----------------------------------------------------------------------------//
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
https://www.facebook.com/groups/modharbour.club
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
https://www.facebook.com/groups/modharbour.club
********************************************************************
- Marc Venken
- Posts: 1482
- Joined: Tue Jun 14, 2016 7:51 am
- Location: Belgium
Re: fwdbu request
In FWDbu there is no option to print the structure on paper ?
Marc Venken
Using: FWH 23.08 with Harbour
Using: FWH 23.08 with Harbour
- Antonio Linares
- Site Admin
- Posts: 42395
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Has thanked: 10 times
- Been thanked: 41 times
- Contact:
- Silvio.Falconi
- Posts: 7110
- Joined: Thu Oct 18, 2012 7:17 pm
Re: fwdbu request
Antonio
I not understood
I need also the tag
sample :
INDEX ON upper(last) TAG LAST EVAL (oProgress:SetPos(nProgress++), Sysrefresh()) EVERY 1 FOR ! DELETED()
I not understood
I need also the tag
sample :
INDEX ON upper(last) TAG LAST EVAL (oProgress:SetPos(nProgress++), Sysrefresh()) EVERY 1 FOR ! DELETED()
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)
I use : FiveWin for Harbour November 2023 - January 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
I use : FiveWin for Harbour November 2023 - January 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
- Otto
- Posts: 6396
- Joined: Fri Oct 07, 2005 7:07 pm
- Has thanked: 8 times
- Been thanked: 1 time
- Contact:
Re: fwdbu request
Hello Silvio,
I added:
Best regards,
Otto
I added:
Code: Select all | Expand
if cRDD = "DBFCDX"
cCode += CRLF + CRLF + "INDEX ON " + ( Alias() )->( IndexKey( n ) ) + " TO TAG " + ;
( Alias() )->( OrdName( n ) )
else
cCode += CRLF + CRLF + "INDEX ON " + ( Alias() )->( IndexKey( n ) ) + " TO " + ;
( Alias() )->( OrdName( n ) )
endif
Best regards,
Otto
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
https://www.facebook.com/groups/modharbour.club
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
https://www.facebook.com/groups/modharbour.club
********************************************************************
- Antonio Linares
- Site Admin
- Posts: 42395
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Has thanked: 10 times
- Been thanked: 41 times
- Contact:
Re: fwdbu request
Silvio,
Code: Select all | Expand
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
- TimStone
- Posts: 2953
- Joined: Fri Oct 07, 2005 1:45 pm
- Location: Trabuco Canyon, CA USA
- Has thanked: 25 times
- Contact:
Re: fwdbu request
I'm rather confused by the question ...
I modified the dBU a few years ago, added some features, and have the ability to select an index. My clients have learned to use this "File Editor" effectively.
In the users manual, I added instruction on how to use the editor, plus the structure ( fields, types, sizes, and description of each ), and specify in there the indexes and keys. This way, for someone who actually needs to know what they are looking for, they can check the document and see not only the key, but also the description of each field.
If they are not willing to read the manual, and understand what they are doing, I certainly do not want them using this utility.
I also keep a copy of those structures in One Note. This allows me an instant reference to every file.
Finally, Antonio I noted you mentioned the ASWAPT.dbf. That is the one I created for the calendar implementation using Codejock. Do we have that full implementation in the Samples ?
Tim
I modified the dBU a few years ago, added some features, and have the ability to select an index. My clients have learned to use this "File Editor" effectively.
In the users manual, I added instruction on how to use the editor, plus the structure ( fields, types, sizes, and description of each ), and specify in there the indexes and keys. This way, for someone who actually needs to know what they are looking for, they can check the document and see not only the key, but also the description of each field.
If they are not willing to read the manual, and understand what they are doing, I certainly do not want them using this utility.
I also keep a copy of those structures in One Note. This allows me an instant reference to every file.
Finally, Antonio I noted you mentioned the ASWAPT.dbf. That is the one I created for the calendar implementation using Codejock. Do we have that full implementation in the Samples ?
Tim
Tim Stone
http://www.MasterLinkSoftware.com
http://www.autoshopwriter.com
timstone@masterlinksoftware.com
Using: FWH 23.10 with Harbour 3.2.0 / Microsoft Visual Studio Community 2022-24 32/64 bit
http://www.MasterLinkSoftware.com
http://www.autoshopwriter.com
timstone@masterlinksoftware.com
Using: FWH 23.10 with Harbour 3.2.0 / Microsoft Visual Studio Community 2022-24 32/64 bit
- Antonio Linares
- Site Admin
- Posts: 42395
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Has thanked: 10 times
- Been thanked: 41 times
- Contact:
Re: fwdbu request
Tim,
Today we enhanced the FiveDBU functionality to generate the code to create the index files:
ASWAPT.dbf is provided in FWH\samples. It is used from FWH\samples\schedule.prg
I don't remember when it was placed there (I can check it in FWH repository) but I guess it was an example
that we tested together. If you want me to remove it please let me know it.
Today we enhanced the FiveDBU functionality to generate the code to create the index files:
ASWAPT.dbf is provided in FWH\samples. It is used from FWH\samples\schedule.prg
I don't remember when it was placed there (I can check it in FWH repository) but I guess it was an example
that we tested together. If you want me to remove it please let me know it.
- TimStone
- Posts: 2953
- Joined: Fri Oct 07, 2005 1:45 pm
- Location: Trabuco Canyon, CA USA
- Has thanked: 25 times
- Contact:
Re: fwdbu request
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
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
Tim Stone
http://www.MasterLinkSoftware.com
http://www.autoshopwriter.com
timstone@masterlinksoftware.com
Using: FWH 23.10 with Harbour 3.2.0 / Microsoft Visual Studio Community 2022-24 32/64 bit
http://www.MasterLinkSoftware.com
http://www.autoshopwriter.com
timstone@masterlinksoftware.com
Using: FWH 23.10 with Harbour 3.2.0 / Microsoft Visual Studio Community 2022-24 32/64 bit
- Silvio.Falconi
- Posts: 7110
- Joined: Thu Oct 18, 2012 7:17 pm
Re: fwdbu request
Antonio Linares wrote:Silvio,Code: Select all | Expand
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
thanks
where is the last version of fwdbu
why not use a class to show dbf window ? type ....class odbfwnd from TXbrowse ?
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)
I use : FiveWin for Harbour November 2023 - January 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
I use : FiveWin for Harbour November 2023 - January 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com