…and I just had to try it. It’s so archaic, it makes AppleScript look as extendable as Perl with ALL of CPAN installed locally. Curious? It’s Escapade, an interpeted language only available for use as a Server-Side CGI.
The Language is similar to BASIC, yet at the same time, is just as comfortable beign an odd Flip-Flop boolean thingy in SGML tags. Oh, it has rudimentary math and testing facilities, and the world’s simplest SQL interface. I’ve decided to test them all.
As it works with MySQL, I created a db, let’s call it ‘mydbname’, with a table of ‘mytable’. As Escapade only works with MySQL, I won’t worry about making an easy-to convert table. ;)
CREATE TABLE mytable ( myid int(5) NOT NULL auto_increment, ipaddress varchar(20) NOT NULL default ‘unknown’, timestamp varchar(15) NOT NULL default ‘1000000000’, PRIMARY KEY (myid) );It’s pretty obvious what we’re going to do, isn’t it? Yep, we’re going to get the time, user’s IP address and write it to our DB. Yes, a varchar(16) would be sufficient, but this was a nice, round number, and I wasn’t sure if Escapade had any ‘padding’ features. Of course, it doesn’t.
It does have a rather nasty feature, by design, of taking any GET or POST request and making it a local variable. PHPesque register-globals, anyone? This, and the fact that ANYTHING that starts with a ‘$’ is considered a variable means that this is probably not the language for the majority. It’s interepted, it’s slow, it lets you do bad things, oh, and there’s no reasonable way to really do much. It will execute the same statements within an
The HTML is below, and I’ve commented it. Note that it inserts the current user (YOUR) ip address before listing the other 10 maximum users from the list. This is merely by my design. You can do whatever you like.
Note that I used HTML escaped comments, rather than Escapade’s perl/bourne-ish hash comment functions. Hashes for comments in HTML, even if stripped, make me shudder.
It’s pretty featureless, but then again, so is Escapade. Cute concept, thought.
*.$OBSCURE, |
*.$OBSCURE. |
It’s pretty simple in both functionality and use, but aside from veerrry primitive things, I fail to see where this would be benificial – for one, it preinitializes all variables set, which might be a good thing for some applications, but again, being /how/ it works, I doubt it’d take much effort for someone to pass it some bogus data, or just break out of an sql statement and call
The world is going the way of XML, and away from SGML TAG style markup – whist the blocks make some sort of sense, the syntax is horrid, and the execution, well, as you can see above, is rather lacking. For a 0.3.x release (Publicly available is 0.2.1, but on an external site I tested with, they had BETA-0.3.5, dated 10-11-03), it can be useful – but I really struggle to find a suitable fit for this utility: it takes more time to force oneself to work around it’s oversimplified nature than it is to utilize a robust toolkit. My sarcastic nature keeps wanting to convey, “If you make it free, someone will use it.â€, which is nothing to state for myself, or the last half hour I spent on the above program. ;)
I would like to have printed the access time FROM the users connecting, but I absolutely refuse to use the localized time provided by Escapade, and of course the concept of,
<LET HOURS=(($timestamp%604800)%86400)/3600)>
<LET MINUTES=(($timestamp%604800)%86400)/3600/60)>
<LET SECONDS=((($timestamp%604800)%86400)/3600)%60)>
Is waaaaaaay above it’s mathematics abilities. If you want timestamps, you’ll have to use it’s localized functions – myself, should I do anything with this data, I’ll read it back with something else. ;)