Re: [harbour-users] HBUtil: new and extended commands

378 views
Skip to first unread message
Message has been deleted

Alex Strickland

unread,
Jun 11, 2025, 4:04:57 AMJun 11
to harbou...@googlegroups.com

Hi Hurricane

This is very interesting. Is your code available to have a look? 

Sadly I don't think I am "someone else" as this stuff is above my pay grade.

--

Regards

Alex



On 2025/06/11 09:39, 'Hurricane' via Harbour Users wrote:
Suggestions for more modern and efficient code

1 - Declaration & initialization. Syntax:    
LOCAL|STATIC <var> AS <TYPE>

2 - Functions and methods, runtime parameter validation. Syntax:
FUNCTION | PROCEDURE | METHOD <name>( <var> [ = <v> | AS <TYPE> | AS CLASS <name> | AS BYREF ] [, <varN> ...] )
and attached image

3 - REQUIRED <var, ...> RETURN | THROW. Syntax:
REQUIRED <var, ...> [SIGNAL <name> | EVAL <expr> ] [ RETURN [<v>] | THROW ]
   
4 - Searches a value in another value. Syntax:
<v> IN <Value> // String, Array, Hash

5 - Functions and methods, return type validation at runtime. Syntax:
FUNCTION <name>([...]) AS <TYPE> | AS CLASS <TNameX>
METHOD <name>([...]) CLASS <TName> AS <TYPE> | AS CLASS <TNameX>
METHOD <TName>:<name>([...]) AS <TYPE> | AS CLASS <TNameX>
   
    If the return type is not as expected, throw an RTE with the appropriate description.

   <TYPE> = ARRAY, HASH, AHASH, CHARACTER, DATE, TIMESTAMP, NUMERIC, OBJECT, ... just simple checks
      INTEGER - simple check but convert number to integer
      DECIMAL|MONEY - simple check but convert number to decimal

   AS CLASS <name> = check class name or ancestor


Przemek*, would it be possible to implement item 5 in Harbour? (at a low level)
If this item is implemented, I will provide the source code of my implementations (items 1 to 4) for inclusion in Harbour (core or contrib) for anyone who wants to use it.
You implemented a function I suggested, but I only found out about it 16 months later... 🙂, so I recently implemented the AS BYREF check.


* or someone else

Regards,
Hurricane

--
You received this message because you are subscribed to the Google Groups "Harbour Users" group.
Unsubscribe: harbour-user...@googlegroups.com
Web: https://groups.google.com/group/harbour-users
---
You received this message because you are subscribed to the Google Groups "Harbour Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to harbour-user...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/harbour-users/412198075.2286773.1749627572836%40mail.yahoo.com.

fdaniele

unread,
Jun 11, 2025, 5:08:53 AMJun 11
to Harbour Users
very very interesting, thanks mr. Hurricane

hherrera

unread,
Jun 11, 2025, 1:41:27 PMJun 11
to Harbour Users
Que es eso de hbutil.  podrian explicarme.  Gracias
What is this hbutil? Could you explain it to me? Thanks.

Henry Herrera

Hurricane

unread,
Jun 19, 2025, 4:34:43 PMJun 19
to harbou...@googlegroups.com
Hello everyone,

I added a lot of information to the blog about the 4 implementations I made (and activated syntax highlighter).
Commands 1 and 2 have been expanded.
To the Harbour team:
If you want to ask me for the full source code to add to Harbour (e.g. HB32\CONTRIB), for anyone who wants to test and use it freely.


Ask me if you have any questions.

Regards,
Hurricane


lai...@paysoft.com.br

unread,
Jun 19, 2025, 10:39:37 PMJun 19
to Harbour Users
Hi Hurricane,

It is really cool.

You can go ahead and create a "PULL REQUEST" in https://github.com/harbour/core/ with your code.

then it will be verified and if be ok will be merged into core.

I would like to make a test if you have a git repository already with it.
Maybe on the future it can be added as a syntax check in "build" time. 

Thanks

Hurricane

unread,
Jun 20, 2025, 9:48:55 AMJun 20
to harbou...@googlegroups.com
No thanks. Just as I described.
I posted a small fix years ago and it's still waiting.
Regardless, hbutil is an independent contribution.

"syntax check in build time"
so vague (and many syntaxes are already checked at compile time)
Certain "ideas" may be useless, incompatible for current/legacy use, and only good for new developments.

Anyway, Mr. Lailton, ignore this matter.
Thanks

lai...@paysoft.com.br

unread,
Jun 20, 2025, 1:41:04 PMJun 20
to Harbour Users

No problem.

You can check the pending pull requests here:
https://github.com/harbour/core/pulls

Is it listed there?

The people who approve or reject pull requests usually reply to you if it gets rejected for some reason based on the rules:https://github.com/harbour/core/blob/master/README.md#how-to-participate

However, it’s up to you.

About syntax checking at build time:
Similar to TypeScript, when a variable doesn’t match its expected type (for example, trying to assign a numeric value to a string type), the build will either fail or show a warning for that line of code.

You can search for it—similar to what you are doing—but Harbour already offers a way to check syntax. If you run:

hbmk2 -n -s -q0 -w3 -es1

That’s what I’m talking about.

Francesco Perillo

unread,
Jun 20, 2025, 2:03:18 PMJun 20
to harbou...@googlegroups.com

Hi,
I still don't understand how you did it and I'm curious to know.
Anyway i'd suggest that you move your work to the addons directory, that has very very similar features as contrib but is "personal", there should never be commits to that dir in github.

In this way you may publish your project on github, ask the users to clone into addons and rebuild harbour...

If harbour doesnt need to be rebuilt, it may be completely outside harbour dir...


--
You received this message because you are subscribed to the Google Groups "Harbour Users" group.
Unsubscribe: harbour-user...@googlegroups.com
Web: https://groups.google.com/group/harbour-users
---
You received this message because you are subscribed to the Google Groups "Harbour Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to harbour-user...@googlegroups.com.

Hurricane

unread,
Jun 20, 2025, 2:26:56 PMJun 20
to harbou...@googlegroups.com
you didn't understand....
1 - usability, etc.
2 - "so vague"... so that you can express yourself objectively/specifically, especially on such basic topics as this...
This type of check has a name, anyway... none of that matters

3 - most importantly...
ignore this topic

bye

lai...@paysoft.com.br

unread,
Jun 20, 2025, 2:46:25 PMJun 20
to Harbour Users
Maybe you are right, I dont understand what you want :)

if you idea is to share, like "Francesco Perillo" said, you can add it to your github profile and share it.
or create a PR in the core if you feel it should be there in contrib. ( but of course will be verified by the Harbour team who check that PR ).

However. lets ignore this I dont really understand you. 

Thank you anyway.

Reply all
Reply to author
Forward
Message has been deleted
0 new messages