Posts

Showing posts from 2021

New search facility on the Delphi Tips micro-site

Image
Ever since the old DelphiDabbler.com closed last year and moved to its new home on Creo Hosting (thanks guys), the Delphi Tips part of the site never got properly re-established. Instead it got parked on GitHub Pages as  https://delphidabbler.github.io/delphi-tips/ . One of the things that was lost in moving from a PHP driven site to Jekyll was the custom search. I've no made partial amends  by putting a Google powered search bar on each page. Of course you do get the usual advertising crap, but the results below the adverts seem to be returning some useful information from the micro-site. Still no new tips though! Anyone who wants to contribute please create an issue on the delphidabbler/delphi-tips project and upload your tip. I'll work through it and covert it to the appropriate format. One day I might enable Markdown formatted tips to be posted, but don't hold your breath"

Released v1.3.0 of my HTML Resource Compiler

Image
Well, this one's pretty niche! And it's getting nich-er-er-er by the day as Internet Explorer dies a slow death. Why's that? Well, HTMLRes compiles individual files files into a single 32 bit resource file, with the contents of each file being recorded in a separate RT_HTML resource. The resources have the same name as the files. These resources have two uses: Internet Explorer can display RT_HTML resources compiled into a DLL using the res:// protocol. This article explains . The IE based TWebBrowser can do the same. Therefore any program that uses TWebBrowser  can embed the HTML & images it displays in the program's resources. This means you don't have to distribute such files with the program and read them from the file system.  The same article explains . Big deal - why not use BRCC32 to compile them then? Well, my  CodeSnip program uses the approach in point 2 above in parts of its UI, and I include some HTML and image files in RT_HTML resources whe

Added unit tests and demo code to Code Snippets Database

I've just released v2.0.1 of the DelphiDabbler Code Snippets Database . This release adds some unit tests and demo code for some of the snippets. The code was previously available, but really well hidden on my Google Drive. Now you can get the code from the main Code Snippets repository. Go to the release download page . There are three separate files for download. The tests are in  csdb-v2.0.1-tests.zip . Notes: There are no new or updated snippets in this release - it's simply the tests and demos that have been added. The new tests have only been tested with old versions of Delphi. I'll be updating them over time. But if you want to do that, then I won't object! New tests and bug fixes are always welcome - you can now submit them via the project GitHub repo . Just fork the repo, switch to the develop  branch, create a feature branch off develop , make your changes and then open a pull request.

DelphiCon 2021 announced

This year’s official online Delphi conference on all things Delphi has been announced. It's free, and its scheduled for 16th to 18th November. For a change I've decided not to be a last minute Larry and just booked myself in! You can book now at  https://delphicon.embarcadero.com/ . Keep checking back there as details of speakers etc. are announced.

How to find all Delphi / RAD Studio installations from code - new article

Image
I've just published a new article on my website for the first time in a long, long, long ... time. It takes a look at how you can programmatically detect which versions of Delphi (or RAD Studio) you have installed (locally) on your system. It goes on to show how to find the installation folders and how to find various exe files: I focus on the 32 and 64 bit command line compilers. It's a short step from there to compiling Delphi (and C++?) code from within your program, like my CodeSnip program actually does. I've not gone in to how to do this in my article, but I will if there's interest. Here's the result of running some of the code from the article on my home machine, showing what I've got installed: Compiled with Delphi 11 Alexandria

The System Information Unit Now Detects Windows 11

Probably the quickest I've ever added support for detecting a new version of Windows to the System Information Unit. But that's because most of the work was done last month and I just needed the build number to be finalised. It's a long time since MSs versioning made any sense at all. This time it's even stranger. Windows 11 is version 10.0 You know like Windows 10 is version 10.0! Well that makes sense. The only difference is in the build numbers - Win 10 goes as far as build 19044 so far. Windows 11 pre-releases start at 21996. Even stranger is that the Win 11 release hasn't even got its own build number - it's revision 1094 of build 22000 as far as I can see from reading MS documentation. Does that give an indication of how much of an update MS think Windows 11 actually is? More info about the System Information Unit on my website . Download the new version 5.7.0 from SourceForge .

SSL Errors on DelphiDabbler.com? Everything's Cool(ish)

The Chrome browser on my Android tablet reported a problem with the security certificate on https://delphidabbler.com this morning (2021/10/04 06:50 GMT). Neither my Android phone nor my PC reported such errors a little later. Neither did my tablet when I tried Firefox. Anyhow I've checked with  https://www.sslshopper.com/ssl-checker.html#hostname=delphidabbler.com to check and the certificate was OK at 07:57 GMT (12:57 PST). https://www.delphidabbler.com  was fine too. Anyhow - if you're getting the same error be assured everything seems to be now cool! If in doubt use http://delphidabbler.com instead - or even the mirror on https://delphidabbler.github.io/ UPDATE 1: Just (09:23 GMT) received a similar error while using Subversion to commit a change to SourceForge. Like my site, the problematic certificate was issued by Lets Encrypt! . Could there be a problem with that service? Service status shows normal & the last reported problem was high demand on 1 October, b

Swap two integers without using a temporary variable

Here's a clever little algorithm you can use to swap two integers without using a temporary variable. I rediscovered this tip , by Muhammad Saied, while reviewing my Delphi Tips micro-site . Dunno why, but I find this strangley pleasing! Assume we have two integers, A & B, both of which have values assigned. Swap their values like this:     A := A + B;     B := A - B;     A := A - B; To follow this through, let: A0 and B0 be the original values of A and B respectively A1 be the value of A after line 1 B2 be the value of B after line 2 A3 be the value of A after line 3 We have: After line 1:     A1 = A0 + B0 After line 2:     B2 = A1 - B0        = A0 + B0 - B0        = A0 After line 3:     A3 = A1 - B2        = A0 + B0 - B2        = A0 + B0 - A0        = B0 Et voilĂ . Very cunning Muhammad! EDIT: As  Dalija Prasnikar pointed out in the comments, because you're adding values, there's a danger of overflow errors. So what d'you reckon? Would you use that trick? For me,

Unit2NS gets a hotfix

Image
My little program to look up fully specified unit names given a base name has a memory leak in v0.1.0-beta. For details of the program, see this post or visit the Unit2NS web page web page. This HotFix fixes it. It's been released as v0.1.1-beta and is available in 32bit and 64bit versions from the Unit2NS Releases page on GitHub. O yeah, and this is the first thing I've edited and compiled with Delphi 11 Alexandria !

Updated my little file modification date comparison program

While reviewing my old programs, I've found one that I've not archived but actually updated! It's only a minor update - the program now spits out a friendlier message when no files names are provided. Oh, and the dox were updated and markdownified. Get new release v2.1.0 View the source See the change log

End of the line for two of my programs

Image
I've been reviewing my too-big-to-handle collection of repositories on GitHub. Something had to give and I've picked two for culling just now. More to follow probably. Photo: Chris McKenna  ( Thryduulf )  CC BY-SA 4.0  license. One is the Clipboard Format Spy - a clipboard view that uses some pretty old API calls. It's not had a release since 2014, so I reckon it's time to call it a day. The other is Version Information Spy - a version information viewer / extractor program and explorer extension. I had a thing about version information resources back in the noughties and wrote quite a bit of code. Last month the program celebrated 10 years since its last release, so its pretty moribund - time to say goodbye. There's still some other version info stuff that I may or may not keep.

Delphi 11 Treeview has check boxes

Image
Just been reading one of Marco Cantu's blog posts and am inordinately excited to find the VCL tree view component now supports multi-state check boxes in Delphi 11 Alexandria. I've been waiting a while for this feature. Check out Marco's blog for details. Image from Marco's blog I know, if this makes me excited, I probably need to get a life!

Released v2.1.0 of the PasHi Pascal Syntax Highlighter

Image
Five years to the day from the release of PasHi v2.0.0 I've just released v2.1.0. And, no, I didn't plan it that way. More like I forgot about the program for half a decade until I needed it again! PasHi is a command line Pascal syntax highlighter and it's accompanied by a separate GUI front end program. The mode I use it in most of the time is to highlight code placed on the clipboard and write the result back to the clipboard. I mainly write HTML code fragments that can be pasted into an HTML4, 5 or XHTML documents. Occasionally I use it to write complete HTML files. The project is on GitHub as delphidabbler/pashi and the program installer for the latest release is also on GitHub as Release 2.1.0 . More info from my website .

Opening a command line terminal from Windows Explorer

Image
I'm sure that I'm not the only one who gets irritated when opening a terminal window from the Windows start menu that the first thing I have to do is cd out of my user directory into wherever I want to be. On my old Win 7 machine I had an Explorer extension that let me open a command line in the selected directory. I don't have that on my current Win 10 machine. Neither do I want to do some registry editing nonsense to enable it. So imagine the joy when I discovered this hack yesterday: In Windows Explorer select the folder where you want to open a command line terminal window. Select the folder in the left hand pane. Type cmd in the address bar. Press enter, and voila! Wow ... wish I'd known that a few years ago. Now, if I'm the only one in the world who doesn't know this already apologies for wasting your time! And yes, I'm still using cmd.exe , and no, I don't use PowerShell. And yes, I'm an old fart resisting change. But I&

Arrgh! Silly error ends in another little System Information Unit update

When I published v5.6.1 of the System Information Unit a couple of days back, I failed to catch another strange error in v5.6.0. As a result I've pushed out another bug fix today: v5.6.2. What error? Well it's a weird one - somehow I introduced a different version of the dash character into the some of the comments in PJSysInfo.pas - I think I copied and pasted the comments from a website. I fixed it by replacing the dashes with ASCII "-" characters. Who cares? Anyone using an old pre-Unicode version of Delphi should care, because it's entirely possible that the compiler will choke on such a character. I haven't tested it because I don't have such a beast. But better safe than sorry - this would be a pig of a bug to catch a few months down the line. I only noticed it because SourceTree's diff viewer couldn't display the characters. Well that's an hour I won't get back! Get the update from SourceForge .

New System Information Unit release supports latest Win OSs

Yesterday (2021-09-12) I released a couple of updates to the System Information Unit - v5.6.0 and v5.6.1. v5.6.0 adds support for detecting new Windows versions announced since the previous release last October 31st. Specifically: Windows 10 Version 21H1 Windows 10 Version 21H2 (due late 2021) DEV, Insider preview and beta releases of Windows 11 Windows 2018 Server Versions 2004 and 20H2 Windows 2022 Server Version 21H2 A new method was added to get an OSs revision number from the registry. This is TPJOSInfo.RevisionNumber . There were a few other minor changes. Take a look at the change log for more information. v5.6.1 followed a few hours later and simply marked a few more class methods as inline . This release also added details of v5.6.0 to the change log that got missed in the previous release and tweaked some other docs. v5.6.1 can be downloaded from SourceForge .

New v4.18.0 of CodeSnip has Delphi 11 Support

I've just released a new version of CodeSnip  that adds support for detecting and automatically compiling snippets using the new Delphi 11 Alexandria compiler. For more info see my post on the CodeSnip blog .

Some Features of the Upcoming Delphi 11 (probably)

Image
Before we start, please note that I'm discussing, by special permission, a pre-release product that is subject to change. (Image used by permission) So here's a brief list of what we can (hopefully) expect in Delphi/C++ Builder/RAD Studio 11: High DPI support in the IDE. Design time previews of VCL styles. An improved rich edit control in the VCL - I'm looking forward to that one! Native ARM compilation for Delphi on Macs. An Edge Chromium powered web browser control for FMX. If you want to know more then you can register for a sneak preview event  on 9th September.

Delphi & C++ Builder Community Editions Are Back

Embarcadero have announced the long awaited return of the community editions of Delphi & C++ Builder. The version being released is 10.4.2. There are certain preconditions that you must meet to be entitled to use the community edition. I'm not going to explain here, partly because I'll probably get it wrong, but mainly because Embarcadero have produced a helpful FAQ . You're going to have to choose whether you want the Delphi or C++ Builder editions because they won't coexist on the same computer. Now that choice be a no brainer for me - the name of this blog should be a bit of a give away! And don't forget that Embarcadero also have a different free C++ product available. I believe neither will work if you have a paid version installed - but why would you want to do that anyway? I'm really pleased to see Embarcadero supporting the hobbyist community again. I think it can only help stimulate interest in their development software - particularly in Delphi.

Embarcadero Announce RAD Studio 11 Is Coming

Embarcadero have announced the next release of RAD Studio / Delphi / C++ Builder.  It's going to be version 11 rather than the expected v10.5. If you're an existing RAD Studio / Delphi / C++ Builder user and have an active update subscription for then you'll be able to join to the v11 beta program.  The code name for this new release is "Olympus". For full details see Marco Cantu's blog post .

4 Degrees Of Programming Distraction

Image
One of the advantages about being a hobbyist coder is that I have no deadlines and can go where my interests take me. One of the disadvantages about being a hobbyist coder is that I have no deadlines and can go where my interests take me. Here's a cautionary tale of four degrees of programming distraction I've just blundered through. Maybe I need to focus! There was the plan... As long ago as New Year's Day 2021 I confidently announced that I'd decided on a related pair of programs I was going to concentrate on. Two days later I'd decided on a third one to join the group. So I started on them right? Not a chance! 1st degree I was working on a music mix and made my usual mistake of spending too long on the mix without resting my ears. Right, I thought, what I need is a little timer app that tells me to take a break. But not one of the many available. Oh no. What I want is one tailored to the ideal work pattern when mixing music. 2nd degree So, I

New Unit2NS Application Released in Beta

Image
Since the introduction of namespaces to Delphi I've been struggling to remember which namespaces some units belong to. I like this feature and would rather provide the fully qualified unit name in my source code rather than specifying a list of assumed namespaces in project options, but I do need some help finding the correct namespace. Years ago Dr Bob had a little utility on his website that did this, but I wanted a little app to run locally. After drawing a blank casting around for something that could help me I bit the bullet and cobbled together a little app myself. It's called Unit2NS . If you give it a unit name it displays a list of one or more namespaces the unit could belong to. Once you've chosen a namespace you can copy the fully qualified unit name to the clipboard for pasting into your code editor. It also lets you display all the units belonging to a given namespace, a bit like the Delphi IDE (sometimes!) does. OK, "How does it know about the name

A Little Birthday Rant!

Image
Today is my birthday, I'm 62 today. I'm British and I'm officially a grumpy old man. So am I allowed a little birthday rant? My topic: The failure of software developers to internationalise dates irritates much, much more than it probably should! Well, it is still my birthday in the GMT/UTC time zone. It's 3/1/2021. In a significant chunk of the world it is or recently was 3/1/2021. So why the expletive are Google still sending me stats that say it's the 1st of March (1/3/2021)? On the increasingly rare occasions they send me cheques they're in pounds, not dollars. So why are they still getting the date format wrong for most of the bloody world? Sadly Google are not alone. Some British companies get this wrong too, which is even worse. Here's a list of the countries and the date formats they use. This is according to the gods of Wikipedia (so it must be right!) M/D/Y isn't that popular is it? Maybe the Google developers should start usin

Another New Application for 2021

Image
Following on from my announcement that I'm planning to start work on two new related apps fro 2021 I realised that the MIDIView app I announced will only test reading MIDI files, when the most important part of the main MathsNMusic application with respect to MIDI will be to write MIDI data. Duh! So I've decided to add another little app to the list. This is one that I was originally planning as a web app and abandoned. It's called KeyNote and will display the notes of various musical scales and, crucially for researching MIDI, will play them. There's a new GitHub repo for KeyNote too. It's delphidabbler/keynote . EDIT: There maybe a change of plan - I got distracted! Here's a mock up for the web app that I did several months ago in Figma: And here's a provisional design in the Delphi IDE: The piano keyboard component can wait: can't find an open source one, so it looks like I'll have to build one ... eventually!

Welcome freebie from Embarcadero for C++ fans

Image
The other day I heard for the first time, from Jim McKeeth, about Embarcadero releasing a new version of Dev C++ that they'd forked from Bloodshed Dev-C++ and Orwell Dev-C++. It's an open source, free, C++ IDE. I'm probably late to the party, and most of you know about this already, but I thought I'd share anyway. What's this got to do with Delphi? OK it's a bit off topic, but it's written in Delphi! I've downloaded the portable version to have a tinker with. Now it's C++ (shudder!) and it's, thankfully, been years since I wrote anything in C, but I'm curious. Did I mention I'm an old tight wad and it's free? There are several themes available. I've chosen a dark one: If you're interested you can read more and/or download it on GitHub or on the Embarcadero site. Contributions to the project are welcome.

Happy New Year - Time For A New Start

If you're celebrating new year today, have a happy one. Let's hope it's somewhat better than 2020. First new year's resolution: I'm making myself start on a new application. As discussed in my previous post I was trying to decide whther to write something that helped in creating sample instruments for the Sforzando sampler or whether to write a program to help generate music from mathmatical sequences. EDIT: Should have known I'd never keep a new year's resolution: I got distracted ! The second choice has won out for two main reasons: I treated myself to the industry standard Kontakt (£eek!) sampler for Christmas. This is so much more sophisticated than Sforzando (£0) and I'll be using that to build new sample instruments instead. (As an aside, the fact that Kontakt has a scripting language that uses the := assignment operator pleases me more than it should!) Mathmatical sequences appeal to the dormant mathematician in me. So, there