There are two ways to create menus in MetaCard, and neither of them is
similar to the way you create menus in SuperCard (neither UNIX nor
Windows systems have a single "menu" that you can refer to from
scripts). The easiest way is to create a button, set its style to
"pulldown", and then enter the menu items you need into the "Contents"
field on the last tab of the button properties palette. You would
then handle the menuPick message in that button's script and do the
appropriate thing depending on which menu item was chosen.
The second way is to create stack with separate buttons for each menu
item and set the menuName property of the button to the name of that
stack. This technique is handy if you want to put things other than
simple buttons in menus, or want to do something dynamic with the menu
(e.g., you can hide, show, or rename buttons in the openStack handler
of the menu panel). In this case, you usually put "mouseUp" handlers
in the scripts of the individual menu items instead of putting a
menuPick handler in the script of the button that opens the menu.
Since you have to set all of the properties correctly to make this
style work, I recommend cloning the MetaCard Menu Bar objects (using
the Message Box):
copy button "File" of stack "MetaCard Menu Bar"
paste
clone stack "MC File Menu"
> The second problem is reading in a text file, currently I'm fliping
> through the provided help stack one card at a time (if there is a search
> function please let me know!)
Use the Find palette...
> and trying to get info but to no avail. I
> can get as far as getting the location of the "filename" but cannot for
> the life of me read in its contents into a variable or into a field.
A common idiom is:
open file "whatever" for read
read from file "whatever" until eof
close file "whatever"
This will run much faster than using "read for" or "read until" unless
you're dealing with truly huge files (more than a couple of MB).
> Thanks in advance.
>
> PS: I'm working with a non-licensed homestack while I wait for the PO to
> be accepted. If working with a non-licensed homestack has anything to do
> with why I'm having problems with reading in text files and editing
> scripts of "menu items" please let me know.
These both should work in the unlicensed version.
> --
> [---------------------------] Simon Lord
> [Important letters that.....] Database Engineer, CAE Electronics
> [contain no errors will.....] tel: (514) 341-2000 x3861
> [develop errors in the mail.] fax: (514) 340-5496
> [---------------------------] email: simonl@cae.ca
>
-- *************************************************************** Scott Raney raney@metacard.com http://www.metacard.com Tcl and ksh: syntactic gymnastics MetaCard: it does what you think