Not shy at all...

Bob Nelson bobnelson at mac.com
Sun Jun 6 12:55:38 EDT 2004


...so let's dive in with both feet.

HyperCard was my friend - and remained my friend until the advent of OS X
and a new machine that won't boot into OS 9.x any more.  Sad, since I used
it for all sorts of cool tricks, especially the massaging of copious amounts
of data that needed a good "cleaning" before dropping it into MySQL or
FileMaker.

A new project came along and prompted me to go hunting.  One of the old
HyperCard sites recommended Revolution or SuperCard, so I've been demo'ing
Revolution for a couple of days to see how the package operates compared to
other options - including RealBASIC.

So I've got a little script that does a moderately simple thing:  Grab a web
page, bring it back, strip useless data out of it (right now, I've just got
it stripping out the extra returns and leading spaces per line) and the next
step will be to kill the HTML on the page so I can mine the data...

My layout and code are fairly simple:

Two fields and two buttons so I can work through the example - the first
field is the 'holder' of the remote URL which has been retrieved
(Imported_Raw) and the second field will be the restructured output when I'm
done.

Here's the code, for those who want to dive deeper...

on mouseUp
  put 0 into i
  repeat forever
    add 1 to i
    if char 1 of line i of field "Imported_Raw" is numToChar(13) then
      delete line i of field "Imported_Raw"
      put "Ate one return at line " & i & " of " & the number of lines of
field "Imported_Raw" & " total lines."
      subtract 1 from i
    end if
    repeat while char 1 of line i of field "Imported_Raw" = " "
      delete char 1 of line i of field "Imported_Raw"
      put "Ate one space at line " & i & " of " & the number of lines of
field "Imported_Raw" & " total lines."
    end repeat
    if line i of field "Imported_Raw" is the last line of field
"Imported_Raw" then
      exit repeat
    end if
  end repeat  
  
end mouseUp


Here's what I noticed about execution:

1.  Importing the URL is awesome - a great feature that makes my life soooo
much easier for this project!  And fast, too!
2.  The page I grabbed consisted of 140,000 lines of code.  After removing
extra line feeds, the number of lines is around 80,000.
3.  This script runs VERY slow, compared to relatively the same script in
HyperCard running under 9.2.1 -- as an example, Revolution has been running
this script for more than 18 hours and still hasn't finished processing.
(And that's running on a Dual 2 GHz, 4 Gb RAM, OS X most current version
with all updates.)  Under HC, the similar script executed in about an hour -
running on an iMac G3/233 with 1 Gb and OS 9.2.1 -- any comments regarding
execution speed?
4.  I don't see any mechanisms for determining progress of the operation --
although I may have certainly missed something.  Are there any progress
bars, etc., that one can use in Revolution?
5.  Looking through all the examples I can find, as well as documentation, I
noted that there aren't many examples related to text manipulation - and
importing/exporting text, etc., in/out of your stack.  I'm sure I missed
something on this front, as I'm sure people would be doing this all the
time...  Can anyone point me in a direction?

Finally, I'm impressed with the professional layout of the product - this
could well be the perfect 'update' (I'm sure they don't like to hear that at
Rev!) to HyperCard.  I'm looking forward to a book, like The Complete
HyperCard Handbook, that lays out the functionality of Revolution as an
awesome reference book.

Thanks for your time!

Bob



More information about the use-livecode mailing list