DBF editors

Re: DBF editors

Postby Otto » Tue Sep 13, 2016 2:23 pm

ZAP errors out

Workaround:
1. uncommanded
local cRdd := (cAlias)->(RddName())

2. and before reopening insert

cFileName := UPPER(cPath+cFileName+cExtension)


ACTIVATE DIALOG oDlg CENTER

SELECT (cAlias)
IF lShared
USE
cFileName := UPPER(cPath+cFileName+cExtension)
TRY
dbUseArea( .F. , cRdd , cFileName , cAlias , .T. , .F. )
CATCH
MsgInfo( cFileName + CRLF + 'can not be opened (shared)' )
return nil
END
EVAL(::oWnd:oMsgBar:aItems[MSGSHARED]:bMsg)
END
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
https://www.facebook.com/groups/modharbour.club
********************************************************************
User avatar
Otto
 
Posts: 6133
Joined: Fri Oct 07, 2005 7:07 pm

Re: DBF editors

Postby HunterEC » Tue Sep 13, 2016 10:59 pm

Otto:

Can you post a download link for the editor ? Thank you very much !
HunterEC
 
Posts: 723
Joined: Tue Sep 04, 2007 8:45 am

Re: DBF editors

Postby Otto » Tue Jun 25, 2024 11:27 am

Hello friends,

I practically always use 2 DBF editors: the one by Enrico and the one by Franklin.

Enrico's for quick lookup and browsing and for changing the structure, ZAP, PACK. It runs rock solid. Unfortunately, some functions are missing, like statistics, replace, etc.

Since structure changes didn't start at all in Franklin's, I started looking for the errors today. It works so far now, but it still needs extensive testing. Here is the modified part.

Best regards,
Otto

https://mybergland.com/fwforum/frankdb.zip
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
https://www.facebook.com/groups/modharbour.club
********************************************************************
User avatar
Otto
 
Posts: 6133
Joined: Fri Oct 07, 2005 7:07 pm

Re: DBF editors

Postby Rick Lipkin » Tue Jun 25, 2024 1:37 pm

Otto

I have used DbfViewer Plus by Alex Nolan in the past for simple .dbf stuff ... I know you can create, add fields, etc .... and it is free.



http://www.alexnolan.net/software/dbf.htm





Rick Lipkin
User avatar
Rick Lipkin
 
Posts: 2642
Joined: Fri Oct 07, 2005 1:50 pm
Location: Columbia, South Carolina USA

Re: DBF editors

Postby karinha » Tue Jun 25, 2024 1:42 pm

Otto wrote:Hello friends,

I practically always use 2 DBF editors: the one by Enrico and the one by Franklin.

Enrico's for quick lookup and browsing and for changing the structure, ZAP, PACK. It runs rock solid. Unfortunately, some functions are missing, like statistics, replace, etc.

Since structure changes didn't start at all in Franklin's, I started looking for the errors today. It works so far now, but it still needs extensive testing. Here is the modified part.

Best regards,
Otto

https://mybergland.com/fwforum/frankdb.zip


Master Otto, where are the resources to be able to compile it completely?

Maestro Otto, ¿dónde están los recursos para poder compilarlo por completo?

Gracias, tks.

Regards, saludos.
João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
User avatar
karinha
 
Posts: 7436
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil

Re: DBF editors

Postby Otto » Tue Jun 25, 2024 2:17 pm

Hello João,

I looked at this source code today because I wanted to check out the compilation of the filter conditions. In my sample folder, I don't have any RC or RES files.

I have my copy of frankdb in visualx.prj and visualx.RES here, but I have made some other changes as well. As a test, I renamed the RES file and copied it into the sample folder. I think it matches.

Can you download it again? https://mybergland.com/fwforum/frankdb.zip

This program is a real treasure trove.

I am posting things here that explain the code a bit and that I am working on with the help of AI.

Best regards,
Otto
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
https://www.facebook.com/groups/modharbour.club
********************************************************************
User avatar
Otto
 
Posts: 6133
Joined: Fri Oct 07, 2005 7:07 pm

Re: DBF editors

Postby Otto » Tue Jun 25, 2024 2:23 pm

add) METHOD FILTER in frankDB

The macro #define COMPILAR(x) &( "{ || " + x + " }" ) is a definition that transforms the parameter x into a code block (known as "Codeblock Evaluation").
In Harbour and related dialects (such as xHarbour and FiveWin), code blocks can be evaluated at runtime.

Let's break down what happens when COMPILAR(x) is used:

Macro Definition: #define COMPILAR(x) &( "{ || " + x + " }" )
x is the input parameter.
The expression is converted into a string "{ || " + x + " }".
&() is a metaprogramming technique used in Harbour to treat strings as executable code.
When COMPILAR(::cFilter) is used, the following happens:

Suppose ::cFilter has the value "::topic == 'heute'".
COMPILAR(::cFilter) expands to &( "{ || ::topic == 'heute' }" ).




In Harbour and related dialects like xHarbour and FiveWin, code blocks (often referred to as "codeblocks") are a powerful feature. They allow you to create anonymous functions or chunks of code that can be passed around and executed later. Let's discuss their performance characteristics and behavior at runtime.

Code Blocks Performance
Execution Speed:

Fast Execution: Once created, the execution of code blocks is quite fast. They are similar to inline functions or lambdas in other programming languages.
Overhead: The initial creation of a code block can have some overhead, especially if it involves complex expressions. However, this overhead is usually minimal compared to the speed of execution.
Memory Usage:

Efficient Use: Code blocks are typically small in terms of memory footprint. They store the instructions to be executed and any local variables captured when the block is created.
Garbage Collection: Harbour has garbage collection mechanisms to manage memory used by code blocks. Unreferenced code blocks are cleaned up automatically.
Flexibility:

Dynamic Behavior: Code blocks provide a high degree of flexibility, allowing you to create dynamic and reusable pieces of code. They are particularly useful for callbacks, event handlers, and iterative operations.
Maintainability: Code blocks can make code more concise and maintainable, reducing boilerplate code and enhancing readability.
Use Case Example
Here is a practical example to illustrate the use of code blocks and their performance characteristics:

harbour
Code kopieren
// Define a code block to filter items
cFilter := "nAge > 18"
bFilter := COMPILAR(cFilter) // Create the code block using COMPILAR macro

// Example data
aData := { { "John", 20 }, { "Jane", 17 }, { "Doe", 22 } }

// Apply filter using AEVAL and code block
AEVAL(aData, {|aItem| IF(EVAL(bFilter), QOut(aItem[1]), NIL ) })
In this example:

COMPILAR(cFilter) creates a code block from the filter string cFilter.
EVAL(bFilter) evaluates the code block for each item in the array aData.
QOut(aItem[1]) outputs the names of people who are older than 18.
Performance Considerations
Speed: The execution of EVAL(bFilter) is very fast because the code block is precompiled. It does not involve parsing or compiling the filter string at each execution.
Overhead: The overhead of creating the code block COMPILAR(cFilter) is minimal and occurs only once.
Conclusion
Code blocks in Harbour are efficient and powerful constructs. They provide fast execution once created and are flexible enough to handle dynamic behavior in your applications.
While there is some initial overhead in creating them, this is generally outweighed by the benefits they offer in terms of performance and maintainability. Thus, they are a valuable tool for optimizing and organizing code in Harbour-based applications.

& interprets "{ || ::topic == 'heute' }" as a code block and evaluates it.
This means that COMPILAR(::cFilter) creates a code block at runtime containing the condition ::topic == 'heute' and evaluates it.

Example usage:

harbour
Code kopieren
::cFilter := "::topic == 'heute'"
oDlg:SetFilter(COMPILAR(::cFilter))
Here, a filter is set that only considers records where ::topic equals 'heute'.

In summary, COMPILAR(x) dynamically creates a code block from the string x at runtime,
which can then be evaluated. This enables flexible and dynamic code generation and execution in Harbour and related dialects.
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
https://www.facebook.com/groups/modharbour.club
********************************************************************
User avatar
Otto
 
Posts: 6133
Joined: Fri Oct 07, 2005 7:07 pm

Re: DBF editors

Postby karinha » Tue Jun 25, 2024 2:59 pm

Good morning Master Otto. FRANK.RES is damaged. I can recover it using WORKSHOP32.exe and saved it as FRANKDB.RC.

Download FRANKDB.RC here:

Buenos días Maestro Otto. FRANK.RES está dañado. Puedo recuperarlo usando WORKSHOP32.exe y guardarlo como FRANKDB.RC.

Descargue FRANKDB.RC aquí:

https://mega.nz/file/ZUFETKRa#PUadaa74jJz1cT53jb3BS9cGJ4skpAg_imR1WB25WtA

Gracias, tks.


Regards, saludos.
João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
User avatar
karinha
 
Posts: 7436
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil

Re: DBF editors

Postby karinha » Tue Jun 25, 2024 3:23 pm

Thank you Master Otto. It already compiles well with xHARBOUR.

Gracias Maestro Otto. Ya se compila bien con xHARBOUR()

https://imgur.com/7rh4KKh

Image

Gracias, tks.

Regards, saludos.
João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
User avatar
karinha
 
Posts: 7436
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil

Re: DBF editors

Postby Enrico Maria Giordano » Tue Jun 25, 2024 3:51 pm

Otto wrote:Hello friends,

I practically always use 2 DBF editors: the one by Enrico and the one by Franklin.

Enrico's for quick lookup and browsing and for changing the structure, ZAP, PACK. It runs rock solid. Unfortunately, some functions are missing, like statistics, replace, etc.


Please elaborate: which functions are missing exactly?
User avatar
Enrico Maria Giordano
 
Posts: 8408
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Re: DBF editors

Postby Otto » Tue Jun 25, 2024 4:16 pm

Dear Enrico,

I mean these menu items here in the screenshot. What also causes problems are tables if you have an auto-increment field.

Best regards,
Otto


Image
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
https://www.facebook.com/groups/modharbour.club
********************************************************************
User avatar
Otto
 
Posts: 6133
Joined: Fri Oct 07, 2005 7:07 pm

Re: DBF editors

Postby Enrico Maria Giordano » Tue Jun 25, 2024 5:24 pm

Otto wrote:Dear Enrico,

I mean these menu items here in the screenshot.


Statistics apart, the other functions are all available in my EmagDBU.

Otto wrote:What also causes problems are tables if you have an auto-increment field.


Which problems?
User avatar
Enrico Maria Giordano
 
Posts: 8408
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Re: DBF editors

Postby Otto » Tue Jun 25, 2024 5:38 pm

Dear Enrico,
I am particularly referring to these functions.
Perhaps I also don't know how to call them.

Best regards,
Otto

Image

Image

Image

Image

Image
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
https://www.facebook.com/groups/modharbour.club
********************************************************************
User avatar
Otto
 
Posts: 6133
Joined: Fri Oct 07, 2005 7:07 pm

Re: DBF editors

Postby Enrico Maria Giordano » Tue Jun 25, 2024 5:48 pm

I'm not aware of any pending bug. Can you send me the DBF and the steps to reproduce the problem here, please?
User avatar
Enrico Maria Giordano
 
Posts: 8408
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Re: DBF editors

Postby Otto » Tue Jun 25, 2024 6:26 pm

Dear Enrico,
I uploaded the dbf file with an auto-increment field.

Thank you and best regards
Otto

https://mybergland.com/fwforum/staff.zip
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
https://www.facebook.com/groups/modharbour.club
********************************************************************
User avatar
Otto
 
Posts: 6133
Joined: Fri Oct 07, 2005 7:07 pm

PreviousNext

Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 132 guests