FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour DBF editors
Posts: 6983
Joined: Fri Oct 07, 2005 07:07 PM
Re: DBF editors
Posted: Tue Sep 13, 2016 02:23 PM

ZAP errors out

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

  1. 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

Posts: 723
Joined: Tue Sep 04, 2007 08:45 AM
Re: DBF editors
Posted: Tue Sep 13, 2016 10:59 PM

Otto:

Can you post a download link for the editor ? Thank you very much !

Posts: 6983
Joined: Fri Oct 07, 2005 07:07 PM
Re: DBF editors
Posted: 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
Posts: 2706
Joined: Fri Oct 07, 2005 01:50 PM
Re: DBF editors
Posted: Tue Jun 25, 2024 01: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
Posts: 8515
Joined: Tue Dec 20, 2005 07:36 PM
Re: DBF editors
Posted: Tue Jun 25, 2024 01: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
Posts: 6983
Joined: Fri Oct 07, 2005 07:07 PM
Re: DBF editors
Posted: Tue Jun 25, 2024 02: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
Posts: 6983
Joined: Fri Oct 07, 2005 07:07 PM
Re: DBF editors
Posted: Tue Jun 25, 2024 02: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.

Posts: 8515
Joined: Tue Dec 20, 2005 07:36 PM
Re: DBF editors
Posted: Tue Jun 25, 2024 02: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
Posts: 8515
Joined: Tue Dec 20, 2005 07:36 PM
Re: DBF editors
Posted: Tue Jun 25, 2024 03: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



Gracias, tks.

Regards, saludos.
João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
Re: DBF editors
Posted: Tue Jun 25, 2024 03: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?
Posts: 6983
Joined: Fri Oct 07, 2005 07:07 PM
Re: DBF editors
Posted: Tue Jun 25, 2024 04: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


Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
Re: DBF editors
Posted: Tue Jun 25, 2024 05: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?
Posts: 6983
Joined: Fri Oct 07, 2005 07:07 PM
Re: DBF editors
Posted: Tue Jun 25, 2024 05:38 PM
Dear Enrico,
I am particularly referring to these functions.
Perhaps I also don't know how to call them.

Best regards,
Otto









Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
Re: DBF editors
Posted: Tue Jun 25, 2024 05: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?

Posts: 6983
Joined: Fri Oct 07, 2005 07:07 PM
Re: DBF editors
Posted: Tue Jun 25, 2024 06: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