Tag ObjectPascal

Mastering absolute/relative file path conversions in Pascal in a cross-platform way

In this post, I'll discuss how to handle file paths in Pascal in a cross-platform manner. I have newly written the following functions, because I often encountered problems with the Delphi and FreePascal own appropriate functions in terms of cross-platform difficulties. So I reinvented the wheel out of necessity, but for the cross-platform special case, where each build variant must also support the each other path convention. Specifically, I'll focus on converting between relative and absolute paths, expanding relative paths, including handling UNC paths and so on. I'll also provide an in-depth analysis of each function, detailing the logic and edge cases they handle. So, let's get started.

IsPathSeparator

The IsPathSeparator function checks if a character is a path separator. It considers '/' and '\' as path separators. This fundamental function forms the basis for parsing the paths in the following functions, and is crucial for ensuring cross-platform compatibility. It's implemented as a function rather … (read more)

Why Object Pascal is More Than Meets the Eye: Exploring the Power and Versatility of Delphi and FreePascal

1. About Object Pascal

If you aren't familiar with Object Pascal, you might not know that it's been around for decades - and it's still going strong. Object Pascal is a programming language evolved from Pascal that has been used to create a variety of software applications, including desktop and mobile apps, as well as games. Despite its capabilities, many developers and programmers tend to regard Object Pascal as an inferior language, and it is often the subject of jokes and ridicule.

2. Reasons why Object Pascal is seen as inferior

One of the main reasons that Object Pascal is seen as inferior is that it is not as widely used as other languages, such as C, C++, Rust and so on. This lack of popularity can make it difficult for developers to find resources and support when working with Object Pascal, which can be frustrating and time-consuming.

Another reason that Object Pascal is often criticized is that it is associated with older, legacy systems. Many developers view Object Pascal as a "dated" language that … (read more)