Post Reply 
A quick and dirty forms generator
11-07-2020, 06:37 PM (This post was last modified: 11-07-2020 07:23 PM by emax.)
Post: #5
RE: A quick and dirty forms generator
(11-07-2020 08:34 AM)grsbanks Wrote:  I'm afraid Windows users won't have a clue what to do with a tarball and won't have the ability to extract the files in one. It's best to upload a zip file.

I agree with ijabbott:
> The Windows users who have no clue what to do
> with a tarball would probably have even less of a clue what to do with a Perl script!

Maybe there two kinds of windows users. Those who have a perl interpreter installed: They will usually know what to do. And those who don't have a perl interpreter: They can simply not run the script. But there is free perl for download on the web.

But though I think that nowadays archivers usually know how to deal with a tgz file even under windows, I have of course made a zip file, see below.

In case that someone might not know how to use it:

  1. Enter -h gives a short usage string via STDERR:
    Usage: < STDIN
  2. this means that one can provide the input by either typing on the keyboard OR by feeding a file to the script. In the latter case the syntax was: < form.hpfrm
  3. The script produces output on STDOUT, which means, that the code is "printed on the monitor". To write into a file use it like this: < form.hpfrm > form.ppl

    which reads: shall read from form.hpfrm and write to form.ppl

Hope this helps.

.zip (Size: 2.16 KB / Downloads: 3)

PS: 'crthppfrm' is by the way an abbreviation for 'create HP Prime form'. A tribute to the command nomenclature of the fantastic AS400/i5 operating system.


A note for those who wonder "why didn't he write this in C++, C or java?".

There is a slogan which says "Only perl can parse perl". This is probably true since perl is a very (very!) powerful text processor. I could have done this in Java or C++. Or maybe not. 'not' because it is sometimes not easily possible to do certain things so fast in other programming languages than perl. The script is less than a hundred lines and even simple regex-es can sometimes be a PITA in other languages. Perl is unbeatable in this respect and unbeatable fast to implement.

It took me half an hour to have a 60% solution. It took two hours to get to 80%. It took the afternoon to fix a glitch here and there and to make it at least "postable". No way in C++. I do C++ development for a living. But without a minimum design, you will fail with C++. At least I do. But this costs (too much) time and so I wouldn't have done it at all.

In perl, which is my swiss-army-knifeĀ² for such cheapo-tools, you sit down and start to code (known as 'quick&dirty'). You add what is missing and after a while it basically does what you had in mind (and often a bit more).

And here you can read why I didn't do this in Python.
Find all posts by this user
Quote this message in a reply
Post Reply 

Messages In This Thread
A quick and dirty forms generator - emax - 11-06-2020, 08:36 PM
RE: A quick and dirty forms generator - emax - 11-07-2020 06:37 PM

User(s) browsing this thread: 1 Guest(s)