A quick and dirty forms generator - Printable Version +- HP Forums (https://www.hpmuseum.org/forum) +-- Forum: HP Calculators (and very old HP Computers) (/forum-3.html) +--- Forum: HP Prime (/forum-5.html) +--- Thread: A quick and dirty forms generator (/thread-15852.html) |
A quick and dirty forms generator - emax - 11-06-2020 08:36 PM I was tired of searching for syntax errors in INPUT definitions and of counting braces and curly braces. So I have written a very simple, quick&dirty forms generator. It reads a very simple input and generates the INPUT code. Note: This is only tested for my personal needs. So far, this means only basic datatypes, drop-down boxes with alpha values and checkboxes. As I am a pure linux user, I did this in perl (feel free to rewrite it in your language of choice). An example input file (form.hpfrm) is included. Some explanations inside. I will fix bugs if reported here and if I have time. Have fun. For tar users & linuxees: [attachment=8846] UPDATE: Zip version: [attachment=8849] PS: rename formgen_tgz.txt to formgen.tgz and then "tar xvzf formgen.tgz". You'll get two files: A sample form and the script. Depending on your umask you'll eventually have to "chmod ug+x crthppfrm.pl" RE: A quick and dirty forms generator - grsbanks - 11-07-2020 08:34 AM 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. RE: A quick and dirty forms generator - ijabbott - 11-07-2020 10:29 AM (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. 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! RE: A quick and dirty forms generator - rprosperi - 11-07-2020 01:36 PM (11-07-2020 10:29 AM)ijabbott Wrote:(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 had to smile here, always a good way to start the day, thanks for that. RE: A quick and dirty forms generator - emax - 11-07-2020 06:37 PM (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:
Hope this helps. [attachment=8848] 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. |