TweetFollow Us on Twitter

ScriptTips
Volume Number:4
Issue Number:9
Column Tag:HyperChat®

ScriptTips

By Fred Stauder, HyperCard Editor, Zurich, Switzerland

on HyperChat

-- HyperEditorial

When to HyperTalk

People say that Hypercard is not a real programing language. Well what is a program? A program is a series of instructions that are processed by a computer to yield a result. We have established that Hypercard is a programing language; now people say it is not powerful. What is meant by a powerful programing language? Does it mean flexible, or easy to use, or even the fastest way to get a result?

The most flexible language is of course binary because that is the native language of the computer. I don’t think anyone would call binary a powerful language, it would take too long to do anything really useful with it. Hypercard can do some graphic manipulations easier than Pascal or C. There are many things that can be done in Pascal and C that are too cumbersome in Hypertalk or even impossible. In the past I have shown things that have been thought to be impossible in Hypertalk. The effort was greater than doing them with external commands, but it could be done.

I believe we are entering an Era of what I call “Russian Doll” programing environments. A Russian Doll is a large wooden doll which you can open up to find a smaller doll. This process goes on many times. The analogy serves programing well. The first level is very simple we can, for instance, change command key equivalents (like QuickKeys). The next level we can move objects around (like buttons in Hypercard); the next level we can program the objects with scripts. We then get to the next level where we can add external code (C or Pascal). We should also be able to change the properties of the level above i.e. Hypercard objects. Unfortunately we can’t. We are however at the point where we might soon be able to use one script or piece of code in different applications.

Now I come to my definition of a powerful programing environment: “A programing environment is powerful if it lets you have the flexibility to communicate to other environments and utilize routines that have been developed for other purposes.” This is why MPW is regarded as a powerful programing tool. The developer still has to choose when it is best to use Assembly or Pascal or C. If the developer does not have the experience necessary in Assembly he can get some other person to do it. A similar thing happens in Hypertalk with external commands. Wouldn’t it be nice to use some of your great scripts and buttons you have developed in Hypercard, in MacWrite?

This month we look at the similarities and differences between Hypertalk and Pascal in an article by Paul Merrill. Don Koscheka in XCMD Cookbook shows you an example when it is best to use Hypertalk and when to use XCMD’S.

--ScriptTips

Last month I brought you AutoHyperEdit the response has been great and I am glad to hear that it is finding uses especially for the handicapped. Using AutoScriptEdit a person can edit scripts quickly one handed. This month I had a request how to make buttons 1 or two pixels high. That was easy, you just type in the command set the height of btn x to 2 . I wanted an easy way, so I added the following italic text to my arrowkey handler in AutoHyperEdit. So all you have to do is to shift select the button or field, then double click outside an object to get into the action mode and hold down the shiftkey and use the arrow keys to make the button or field smaller or larger. I could have made it act on groups of objects but I wanted to make it modular. I leave it to you, to make it work on groups, as an exercise.

{1}
on arrowkey whichkey-**AutoHyperEdit**--
  global CWSList
 if the shiftkey is down then
      put item 1 of cwslist into T
    put the width of T into TW
      put the height of T into TH
      if whichkey is “down” then set the height of  T to TH - 1
      if whichkey is “up” then set the height of  T to TH + 1
      if whichkey is “left” then set the width of  T to TW - 1
      if whichkey is “right” then set the width of  T to TW + 1
  end if
  if the mouse is down then
    if whichkey = “left” then
      put the mouseH into L
      repeat with i = 1 to the number of items in CWSList
        put the width of item i of Cwslist into w
        set the left of item i of Cwslist to L
        set the width of item i of Cwslist to w
      end repeat
    end if
    
    if whichkey = “right” then
      put the mouseH into R
      repeat with i = 1 to the number of items in CWSList
        put the width of item i of Cwslist into w
        set the right of item i of Cwslist to R
        set the width of item i of Cwslist to w
      end repeat
    end if
    
    if whichkey = “up” then
      put the mouseV into T
      repeat with i = 1 to the number of items in CWSList
        put the height of item i of Cwslist into h
        set the top of item i of Cwslist to T
        set the height of item i of Cwslist to h
      end repeat
    end if
    
    if whichkey = “down” then
      put the MouseV into B
      repeat with i = 1 to the number of items in CWSList
        put the height of item i of Cwslist into h
        set the bottom of item i of Cwslist to B
        set the height of item i of Cwslist to h
      end repeat
    end if
    exit arrowkey
  end if
  pass arrowkey
end arrowkey --**AutoHyperEdit**--

The second script tip deals with searching in large numbers of cards for a checked item. If you have to check for the hilite of a button in 2000 cards, it takes a while. If you use a field with a check mark and search for the character in the field it is much, much faster because it uses Hypercards fast search algorithms. Simply lock the field and put this script into it. You could also use an “X” mark.

{2}
on mouseup
  if me is empty
  then put “ ”  into me
  else put empty into me
end mouseUp

on HyperChat

 

Community Search:
MacTech Search:

Software Updates via MacUpdate

Latest Forum Discussions

See All

The secrets of Penacony might soon come...
Version 2.2 of Honkai: Star Rail is on the horizon and brings the culmination of the Penacony adventure after quite the escalation in the latest story quests. To help you through this new expansion is the introduction of two powerful new... | Read more »
The Legend of Heroes: Trails of Cold Ste...
I adore game series that have connecting lore and stories, which of course means the Legend of Heroes is very dear to me, Trails lore has been building for two decades. Excitedly, the next stage is upon us as Userjoy has announced the upcoming... | Read more »
Go from lowly lizard to wicked Wyvern in...
Do you like questing, and do you like dragons? If not then boy is this not the announcement for you, as Loongcheer Game has unveiled Quest Dragon: Idle Mobile Game. Yes, it is amazing Square Enix hasn’t sued them for copyright infringement, but... | Read more »
Aether Gazer unveils Chapter 16 of its m...
After a bit of maintenance, Aether Gazer has released Chapter 16 of its main storyline, titled Night Parade of the Beasts. This big update brings a new character, a special outfit, some special limited-time events, and, of course, an engaging... | Read more »
Challenge those pesky wyverns to a dance...
After recently having you do battle against your foes by wildly flailing Hello Kitty and friends at them, GungHo Online has whipped out another surprising collaboration for Puzzle & Dragons. It is now time to beat your opponents by cha-cha... | Read more »
Pack a magnifying glass and practice you...
Somehow it has already been a year since Torchlight: Infinite launched, and XD Games is celebrating by blending in what sounds like a truly fantastic new update. Fans of Cthulhu rejoice, as Whispering Mist brings some horror elements, and tests... | Read more »
Summon your guild and prepare for war in...
Netmarble is making some pretty big moves with their latest update for Seven Knights Idle Adventure, with a bunch of interesting additions. Two new heroes enter the battle, there are events and bosses abound, and perhaps most interesting, a huge... | Read more »
Make the passage of time your plaything...
While some of us are still waiting for a chance to get our hands on Ash Prime - yes, don’t remind me I could currently buy him this month I’m barely hanging on - Digital Extremes has announced its next anticipated Prime Form for Warframe. Starting... | Read more »
If you can find it and fit through the d...
The holy trinity of amazing company names have come together, to release their equally amazing and adorable mobile game, Hamster Inn. Published by HyperBeard Games, and co-developed by Mum Not Proud and Little Sasquatch Studios, it's time to... | Read more »
Amikin Survival opens for pre-orders on...
Join me on the wonderful trip down the inspiration rabbit hole; much as Palworld seemingly “borrowed” many aspects from the hit Pokemon franchise, it is time for the heavily armed animal survival to also spawn some illegitimate children as Helio... | Read more »

Price Scanner via MacPrices.net

Apple Magic Keyboards for iPads are on sale f...
Amazon has Apple Magic Keyboards for iPads on sale today for up to $70 off MSRP, shipping included: – Magic Keyboard for 10th-generation Apple iPad: $199, save $50 – Magic Keyboard for 11″ iPad Pro/... Read more
Apple’s 13-inch M2 MacBook Airs return to rec...
Apple retailers have 13″ MacBook Airs with M2 CPUs in stock and on sale this weekend starting at only $849 in Space Gray, Silver, Starlight, and Midnight colors. These are the lowest prices currently... Read more
Best Buy is clearing out iPad Airs for up to...
In advance of next week’s probably release of new and updated iPad Airs, Best Buy has 10.9″ M1 WiFi iPad Airs on record-low sale prices for up to $200 off Apple’s MSRP, starting at $399. Sale prices... Read more
Every version of Apple Pencil is on sale toda...
Best Buy has all Apple Pencils on sale today for $79, ranging up to 39% off MSRP for some models. Sale prices for online orders only, in-store prices may vary. Order online and choose free shipping... Read more
Sunday Sale: Apple Studio Display with Standa...
Amazon has the standard-glass Apple Studio Display on sale for $300 off MSRP for a limited time. Shipping is free: – Studio Display (Standard glass): $1299.97 $300 off MSRP For the latest prices and... Read more
Apple is offering significant discounts on 16...
Apple has a full line of 16″ M3 Pro and M3 Max MacBook Pros available, Certified Refurbished, starting at $2119 and ranging up to $600 off MSRP. Each model features a new outer case, shipping is free... Read more
Apple HomePods on sale for $30-$50 off MSRP t...
Best Buy is offering a $30-$50 discount on Apple HomePods this weekend on their online store. The HomePod mini is on sale for $69.99, $30 off MSRP, while Best Buy has the full-size HomePod on sale... Read more
Limited-time sale: 13-inch M3 MacBook Airs fo...
Amazon has the base 13″ M3 MacBook Air (8GB/256GB) in stock and on sale for a limited time for $989 shipped. That’s $110 off MSRP, and it’s the lowest price we’ve seen so far for an M3-powered... Read more
13-inch M2 MacBook Airs in stock today at App...
Apple has 13″ M2 MacBook Airs available for only $849 today in their Certified Refurbished store. These are the cheapest M2-powered MacBooks for sale at Apple. Apple’s one-year warranty is included,... Read more
New today at Apple: Series 9 Watches availabl...
Apple is now offering Certified Refurbished Apple Watch Series 9 models on their online store for up to $80 off MSRP, starting at $339. Each Watch includes Apple’s standard one-year warranty, a new... Read more

Jobs Board

Licensed Practical Nurse - Womens Imaging *A...
Licensed Practical Nurse - Womens Imaging Apple Hill - PRN Location: York Hospital, York, PA Schedule: PRN/Per Diem Sign-On Bonus Eligible Remote/Hybrid Regular Read more
DMR Technician - *Apple* /iOS Systems - Haml...
…relevant point-of-need technology self-help aids are available as appropriate. ** Apple Systems Administration** **:** Develops solutions for supporting, deploying, Read more
Operating Room Assistant - *Apple* Hill Sur...
Operating Room Assistant - Apple Hill Surgical Center - Day Location: WellSpan Health, York, PA Schedule: Full Time Sign-On Bonus Eligible Remote/Hybrid Regular Read more
Solutions Engineer - *Apple* - SHI (United...
**Job Summary** An Apple Solution Engineer's primary role is tosupport SHI customers in their efforts to select, deploy, and manage Apple operating systems and Read more
DMR Technician - *Apple* /iOS Systems - Haml...
…relevant point-of-need technology self-help aids are available as appropriate. ** Apple Systems Administration** **:** Develops solutions for supporting, deploying, Read more
All contents are Copyright 1984-2011 by Xplain Corporation. All rights reserved. Theme designed by Icreon.