11-03-2022, 05:32 PM
(11-03-2022, 05:22 PM)bplus Wrote: Ah practicing API skills, OK!In addition, I want to make it work on Linux as well as Windows. And someone else should be as interested for Macintosh.
The thing is that with Q(uick)BASIC we used to be limited to BASIC-only solutions. If someone wasn't confident enough doing mixed-language programming then he/she was content with having a mess of "LEN()" and string functions instead of "PRINT USING" only to always get two-digit date and time variables. The creators of GW-BASIC and Q(uick)BASIC didn't perceive that somebody wanted to format an arbitrary date and/or time; they felt "DATE$" and "TIME$" were good enough. That's because back then, at least on Windows those two "function values" could be changed by the user.
In QB64 we were given the choice to look for a solution in C/C++, for somebody who knew enough about it. This is something the Wiki encouraged me to do. I modified the "fileexist" example, that used to be in the Wiki, to come up with my own function which produced full paths for a given directory on the disk, and made it work on Windows and Linux.
Before QB64PE there was no example in the Wiki which wrote a function which resided in a "dot-H" file, and declared also as function inside "DECLARE" block. Declaring the ones "directly" from C runtime library didn't count for me, I wanted to see a written example like that "fileexist" one. That's why I said I was comfortable writing it as subprogram with the final parameter being changeable.