Showing posts with label MetaCard. Show all posts
Showing posts with label MetaCard. Show all posts

Saturday, October 15, 2005

[MetaCard] Starter Kit script size limit, Part 2

And if anyone was curious what happened to the MetaCard script size issue, Ken Ray said,
>I've been told, via the MetaCard list, that you have a technique for
>getting around the script size limit in MetaCard. If that's so, please
>can you tell me whence I can download the whitepaper about it.

Sorry to disappoint you, Bruce, but I don't. In fact, given that DreamCard is only $99, it seems counterproductive to attempt to get around the script size limits when you can pick up a full development environment very inexpensively.
and Geoff Canyon said
I don't recall that I wrote anything in particular. I did write an exporter for the documentation for earlier versions of Revolution, and they had a small section on dealing with the script limits in the starter kit. The basic point is to understand how to write tight code. You can insert scripts in front and back, and "start using" stacks, and use nested groups to your advantage. You can also store scripts in custom properties and use the "do" command on them.

If you ask on the mailing list, there are several people there who spent significant time working within the script limits who can probably help you with any specific issues. I bought a license early on so I don't have much practical experience.

Finally, if you're concerned about whether Rev is a good fit for what you want to do, ask on the list. People will tell you the truth. There are (many) things Rev is very good for, and (almost as many) things it isn't well suited for.
>I'm told that, sometime late last century, you wrote
>something about side-stepping the script size limit in
>the MetaCard unregistered version.
So the upshot of all this is: spend some money and stop complaining.

Friday, October 07, 2005

[EOC] End of Contract

I've got one more week and then I'm unemployed again.

I feel down. I wish there was something "cutting edge" I could do. Everything I can think of is diametrically opposed to the cutting edge, being either the blunt bit at the back of the knife or the even blunter bit on top of the chisel handle.

Who cares about MetaCard? Who cares about S*BOL but a few diehard fanatics (who are mostly older and greyer than me)? Who cares about Clipper or xHarbour but a few South Americans into retro memorabilia? As for VBScript, this is just one of thousands of websites and I'm a relative newcomer to a tool that's been around for very long time.

Eventually I'll have posted all my MoonRock BASIC, Fitted Software Tools Modula-2, Turbo Pascal 5 and Euphoria code. Whooptie do. Even if I finish my CCNA, learn Haskell, and write Kiwi CatTools equivalents ... who cares?

[MetaCard and Tcl] Blogs.mc

I got asked to describe the stack a little better. Here goes:
My blogs.mc stack has two text fields (fSource and fGenerated) and some buttons at the bottom (create_card, first, prev, next, last, render, preview, delete).

With some marked-up text in the fSource field, I click 'render' and the output of the Tcl script (HTML) is put into the fGenerated field (line 6 of the 'Render' script).

Then when I click on 'preview' the HTML in the fGenerated field gets dumped to a file and passed to Safari. The fGenerated field is modifiable so I can play with things to get what I want and then tweak the Tcl script appropriately afterwards.
About the same time I posted this to the MetaCard list:
On my blog, codeaholic.blogspot.com, I've posted an item about MetaCard (on OS X) using Tcl to more-or-less bypass the script size limit of the unregistered version of MetaCard.
Richard Gaskin wrote back, saying (in part):
since there is no MetaCard anymore anyway, and since Rev only offers a 30-day trial for the engine, I'm not sure how helpful the article will be.

At $99 for the low-end Rev license, is the pricing really so prohibitive?
Also Alejandro Tejada wrote
i do not see how this could get around the 10 lines limit, but Geoff Canyon wrote an extensive tutorial to manage longer scripts within the 10 lines limits.

This tutorial is still useful for developers that want to run longer scripts in their standalone applications.

I get it from Ken Ray's website within the RR v 1.1 docs (saved as a pdf file). i'm not sure if this tutorial is still available in any website.

You could ask directly to Geoff Canyon. Look for his website: inspiredlogic.com
I answered with
> i do not see how this could get around the
> 10 lines limit,

bad choice of words on my part. It doesn't so much get around it as it does acquiesce to the fact and try to use other tools to do what can't otherwise be done. Instead of using MetaCard's HTML mechanism or writin8g something in MetaTalk, I've farmed out the functionality to a Tcl script.

> but Geoff Canyon wrote an
> extensive tutorial to manage longer scripts
> within the 10 lines limits.

of this I was unaware. I have thought about doing something similar. What I usually end up doing however, when I need to hang more closely to MetaCard is to use AppleScript and 'do script' or 'evaluate' the things I need. I will nevertheless make enquiries now that I know better.

Wednesday, September 28, 2005

[MetaCard and Tcl] Broggle's cousin at home on the iBook

MetaCard's great but I can't afford to buy it (not that you can anyway, now that it's been subsumed into Runtime Revolution). But using the demo version means I keep bumping up against an inbuilt limit for scripts. So I hit upon the idea of bypassing the issue by calling external scripts.

The tool I use to write blogs at home (as opposed to the HTA I use elsewhere) is written in MetaCard and does the render and preview passes using Tcl.

[Aside: Not that there's anything about Tcl that lends itself to the job. I could have used Perl, Lua, Python, sed (maybe), awk, or any number of other languages from Algol68 (there's an implementation for Mac OS X believe it or not) right through to Zen BASIC. It's just that Tcl is familiar ground.]

Right, where was I. Oh yes ...

First the script in my "Render" button ...
... which creates a file in the temporary folder (I'm on Mac OS X here ... might work on Linux ... have to do something drastic for Windows), and puts my marked-up text from field fSource into it. Then it shells out to render.tcl and captures its output into the fGenerated field. The temporary file is deleted.

Render.tcl looks like this (in its current incarnation):
This script inhales the file specified on the command line, splits it on newline and works its way through the lines, outputting HTML according to the rules of the markup: @ in column 1 identifies markup and there are currently four types: text, code, quot and end. Very simple, but it does me fine ... for now.

So after this runs, there's HTML in the fGenerated field. If I want to see how it's going to turn out in a browser, then I click on the Preview button. Okay, so it won't have all the CSS definitions that blogspot/blogger would apply but I get a useful approximation.

The script for the Preview button ...
... is similar to that of the Render button except this time I create an .html file in /tmp and and write the contents of the fGenerated field to it. I ignore the output of the shell() command.

I haven't quite figured out how to delete the temporary file because, if I uncomment the "delete file", by the time Safari is ready to load the file it's gone. There might be some way of making the shell synchronous, the way that /WAIT does on Win2k's START command, but then that'd probably mean waiting until Safari quits before I can use my blog writer again ... definitely sub-optimal. Then again, it'd be waiting for "open" to close, which happens as soon as it's launched Safari. And it's 10:48 pm and ...

Well, that's it. I really enjoyed this short break away from the long run of VBScript posts. I've got more stuff cooking here at home including a short foray into Javascript (a language I should have learned ages ago). Till then ...

Thursday, August 25, 2005

[VBScript/HTA] Broggle on Steroids

Big changes to Broggle.hta. No more #code/#endcode etc. Just #text, #code, #quot and #end. Now the HTA is more in line with the MetaCard and Tcl version at home on the iBook. I've also put in a preview button (which should probably be somewhere other than where it is right now) which puts the conversion results into a <DIV> at the bottom (thus the scrollbar at the side.)

Enjoy