using buttons to move between stacks

Working on making the switch to SuperCard? Many here have done it... ask your questions here.

using buttons to move between stacks

Postby DALSOP » Tue Feb 01, 2011 8:32 am

when using go to buttons to move between stacks, once you specified the navigation path in hypercard, it would remember it forever. SuperCard does not seem to remember paths. Am I missing something or is there some way to make SuperCard remember navigation paths???

BigDave
DALSOP
 
Posts: 8
Joined: Tue May 11, 2010 9:33 am

Re: using buttons to move between stacks

Postby LorenzT » Tue Feb 01, 2011 2:11 pm

Hi BigDave

AFAIR in HC you had a home stack with several cards and buttons that linked to a specific stack. And, as you say, you had to register or link a stack to a button. Similarly you can build your own home project in SC by linking a button to a stack or project. You can store the name of the button and the associated path in a hidden list (as I think it was done in HC) or in an userProperty of the button. If, however, you move a stack from the original place (e.g. from a stacks folder) you can ask for the file and restore the new location of the project. You could also rely on relative paths by storing all projects in a folder that resides in the folder of the home project. Then SC or your script could look in the directory of the relevant folder and try to find a 'lost' project. To move back again to the home project you also need to store the path to the home project in a sub-project.
And finally you could also create one large project with several windows that contain the content of the stacks.

Lorenz
LorenzT
 
Posts: 176
Joined: Thu Dec 02, 2010 2:32 am
Location: Switzerland

Re: using buttons to move between stacks

Postby DALSOP » Wed Feb 02, 2011 3:07 pm

Dear Lorenz,

Thanks for your answer. I am an insect collector and taxonomist and was using hypercard because many levels & stacks could be set up, all linked with "GoTo" buttons. For example the topmost level is a single card stack called Insect Directory. On it are the names of the 21 US temperate zone families, each with a GoTo button. The buttons either open up single stacks (for small families) or further directories for the large families. Every stack has a little program written that counts the number of cards in the stack, subtracts 1 (for the face card) and enters this in a field on the face card. This tells me how many species have been identified. When a GoTo button is used to go to a higher level, this number of species identified is carried up to the next higher level. The system is set up so that I know how many species I have described at a given time. To give an idea of how big all of this is, every species has an individual card. Since I have already described over 750 species from my 5 acre property high in the mountains of western North Carolina, it means that I already have over 750 individual cards distributed among about 35 stacks.

Your suggestion looked likely, but I couldn't get it to work even when I put everything down on the desktop. By the way, I am working on a tower G4 with system OSX10.5/
DALSOP
 
Posts: 8
Joined: Tue May 11, 2010 9:33 am

Re: using buttons to move between stacks

Postby LorenzT » Thu Feb 03, 2011 9:01 am

Interesting! I can understand what you are working on since I studied biology and my wife is an entomologist.
If I would have to build this from scratch in SC I would pack everything in one project. There would be one main window with a tree of the systematic classifications. Maybe I would add a few more cards for important branches.
Then I would have only one window with a card for each species. On each card there would be text fields and pictures or links to pictures. I would also allow for opening two or more windows for species cards as I would like to be able to compare one species with another species side by side. And maybe I would store all text data in a big table to have faster access to the records and to be able to create different data view windows. How many text entry fields and how many graphics or pictures do you have associated with each species?
I think with SC and SuperEdit it wouldn't be much work to combine everything in one project that would offer the mentioned advantages and more. If you want to put everything in a nice application environment you could embed it in my SC FrameWork project.
LorenzT
 
Posts: 176
Joined: Thu Dec 02, 2010 2:32 am
Location: Switzerland

Re: using buttons to move between stacks

Postby DALSOP » Fri Feb 04, 2011 11:15 am

OK,

I have started consolidating everything in one stack. I have worked out all of the go-to buttons so that I can move up and down through the taxonomic levels, adjusted all of the counters and reporting of number of species in a group at all levels, and seem to have everything working with one major exception: sorting problem!

So questions: can SuperCard sort cards based on information in each card?? If so, must the sort command always be a global, or can it be confined (in other words, can I tell SuperCard to sort the next 10 cards by card field ID 10??

The reason that this is most necessary is the method of entering information. I have set up my system to (as far as possible) avoid typing errors. So, when I want to enter a new species, I go to the directory card for the family. This card has on it a separate button for each family (or genus), scripted in the following way: When I push the button, I am taken to the next card (the background card that allows entering species information), a new card is made, and the family (or subfamily) is automatically entered in the field, and, if there are only a few genera), the genus is automatically entered in another field.

So, cards go in in a most disordered manner & I need a way to order them. The reason that the sort must be limited is because if the family species counter says 30 species ID'd, then I want to be able in some way to tell SuperCard to limit its sort to the next 30 cards.

Thanks for you answer. By the way, I am a retired Professor of Biology and taught intensive Summer Entomology courses for many years.

And, yes, the plan was (is) if I get all of this straightened out, to then enlarge the cards so that I can paste into the new space either pictures gotten from the web (Bug Guide, etc.) of ones I have either taken with my camera or gotten from a camera microscope.

By the way it was set up as you suggested. The first card (called Insecta) gives all of the insect orders. The button by the name of an order takes me to directory card for the order, and a field next to the order name gives the number of species I have found in that order. The directory cards have counters for the number of species collected in the order, and when the goto button is pushed taking me back to the Insecta directory, the number in the species ID'd field is copied and pasted into the field next to the order name. By the way, the Insecta directory script takes all the numbers written in next to the orders, adds them up and reports total species ID'd (right now, 741). The order directory cards are of two types. For small orders, the families (and in some cases the genera) can be entered on one card. For larger orders there must be 2 or 3 cards, just to list the families and subfamilies. And, then following the directory cards are the individual cards for each species identified belonging to that subfamily or family.
DALSOP
 
Posts: 8
Joined: Tue May 11, 2010 9:33 am

Re: using buttons to move between stacks

Postby LorenzT » Fri Feb 04, 2011 3:25 pm

Hi
Looks like you are proceeding fast in the new environment.

There are a few things I don't understand completly. Why do you need to limit a sort? And do you really need a directory card for each family? How many windows do you use? Only one - for data entry and all the species?
I would set up one general data entry window with list fields for all orders and families. And from that window I would put all the data in a new species card in a different window.

I stared to work on an Insect Selector window that lists orders, families and genera to see how on could do that. All names are stored in userProperties of the respective list fields. I'll post the InsectSelector project in the Sample & Demo Projects section. (Why can't we post zip filese here?)
LorenzT
 
Posts: 176
Joined: Thu Dec 02, 2010 2:32 am
Location: Switzerland

Re: using buttons to move between stacks

Postby DALSOP » Fri Feb 04, 2011 5:05 pm

Lorenz,

No, I don't have many directory cards for families. The lowest I go is order directories which lead to families, and in a very few cases (Beetles, Butterflies and Moths, True Bugs, and True Orthopera) these lead to subfamily cards (which may have genera buttons on them).

You bring up something that I don't know about - windows - what are these and how are they used??

The reason (right now) that I need limited sorts is that after, for example a family or subfamily card, I place all of the species cards, just so that I can know easily, in alphabetical fashion, what I have collected in that group (needed because when I am identifying what I have just collected I need easily to know if I have already or not gotten that species.

Lorenz - we need an easier, and more secure way to communicate (like email), because I would like to send you what I have done and maybe arrange stuff better. Would a communication through tech services maybe work. And, am very glad that you wife is an entomologist!! She would make a great suggestor of stuff to be done better.

And, I'm early in all of this - what is storing stuff in user properties? You know, I find the SuperCard User Guide most unhelpful.

And = (Why can't we post zip files here?). What and where is this - don't even know about zip files - I thought that these were IBM terms!
DALSOP
 
Posts: 8
Joined: Tue May 11, 2010 9:33 am

Re: using buttons to move between stacks

Postby LorenzT » Sat Feb 05, 2011 1:38 am

You bring up something that I don't know about - windows - what are these and how are they used??


That's one of the best advantage of SC over HC. HC can only have cards in one stack (or window). SC has one level above this. In a SC project you can have several windows or stacks that can interact with each other. You can build palette windows and each project can have menus as any other Mac application. Therefore SC can be used to build real applications. For you, this could mean that you have a palette window that contains lists of orders and/or families to select from for searches in a window beside it. And even better for your use is that you are able to show two species cards side by side, each card in its own window. Lots of advantages compared to a linear HC stack!

we need an easier, and more secure way to communicate

You can find my mail link on my SC page: http://web.me.com/ltschudi/SuperCard-Page/Welcome.html or you can get in contact with me via a private message in the members section.

The question about zip files (compressed files) was directed at Scott, our list moderator. I think we can only post ziped SC projects in certain areas of this forum and apparently not in this section. Zip files can be created with the Finder in Mac OS X (menu File:Compress).
LorenzT
 
Posts: 176
Joined: Thu Dec 02, 2010 2:32 am
Location: Switzerland

Re: using buttons to move between stacks

Postby DALSOP » Sat Feb 05, 2011 12:52 pm

Lorenz,

After much consideration I have given up on SuperCard because of its many limitations for my work. I set up pull-down menus for the orders, only to realize that the face card for my stack id the Insecta directory, which also receives counts from all of the Order directories and totals them. Everything I have done so far with SuperCard is to work around its limitations. Therefore, assembled into one stack everything except Flies (Diptera), Beetles (Coleoptera), and Butterflies & Moths (Lepidoptera). These are very large stacks in themselves, and I had wanted to have everything working right before i did the massive copy-pasting to assemble them into the main stack. For me, the breaking point has been finding that in SuperCard "sort" is a global command. You cannot limit it to the next X cards, or limit it to cards #'s x, y, z, etc. Now, if I had left all of the ordinal stacks separate, this would not have been a problem. But, If I left all of the stacks separate, then I would have to spend endless amounts of time having to tell SuperCard where to go.

So, unless SuperCard progresses in the direction I want, I will go back to managing my collection from a HyperCard folder that opens under System 9 on a older G4 computer that I have OS10.3X installed on that permits me to open System 9 programs.

If you can think of anyway to work around my sorting problem, I would be glad to hear from you.
DALSOP
 
Posts: 8
Joined: Tue May 11, 2010 9:33 am

Re: using buttons to move between stacks

Postby LorenzT » Sat Feb 05, 2011 2:33 pm

There are two ways of doing this:
1) Cut the cards to be sorted to another window and sort the cards in a that window and then copy the cards back to the main stack window. (awkward)
2) Better: Put the data from the cards to be sorted in a variable. Sort the data with the function sortFieldByItem (this function can be found in the SC Help library Xtend) and then put the data back in the fields.

Both solutions can be handled by a generalized function (e.g. get sortCards(sortField,from,to).

Anyway, I don't think that this is the best and most flexible approach to solve your database needs. By always keeping all data in a large table you could do many things much faster and more flexible if you want to use more advanced searches with your data.
LorenzT
 
Posts: 176
Joined: Thu Dec 02, 2010 2:32 am
Location: Switzerland

Re: using buttons to move between stacks

Postby DALSOP » Sat Feb 05, 2011 3:54 pm

Lorenz,
Thanks for answering: Unfortunately everything represents a "work around" to attempt to solve a problem already solved in HyperCard. So, I list workarounds: (1) in converting a HyperCard stack to SpuperCard, the face card (Class, Order, Family) always had part of the background (used for entering all the taxonomic stuff for each species, as well as the collecting data. So, first thing was to find if I could take a background card and paint on a white foreground face on it. Well, I found that in regular SuperCard the paint tools are disabled and could only be used in SuperEdit ($100 extra). So, I then pasted the clear background cards into the stacks, and had to rewrite all scripts on the face cards to say "go next card" before making a new entry card. SO I DID IT! (2) SuperCard unable to remember paths between stacks, even if they are in the same folder. Well, you answered and tech services answered that SuperCard does not remember paths. SO I FOLLOWED YOUR SUGGESTION! (3) I went through the tedious process of converting most of the converted HyperCard stack into one stack (this is mind-numbing - it requires first copying then pasting each card onto the new (growing) stack. And it must be done by continually pulling down menus because there are no menu shortcuts for doing this, and then (4) Sorting card problem! Because I can't have separate stacks for each family, but now must have everything in one stack, an ABSOLUTE necessity is non-global sorts. Well, I read every page of the manual today (printed out 100+ pages), and read 3 times everyone of the allowed commands, and there is just no way to do it without the most extreme workarounds. The problem with workarounds, is that they take time!!! And, I don't have time to waste - I have my HyperCard stacks working perfectly, and have just discovered a most promising way to connect them with species pictures I have stored in iPhoto. So, as I said unless SuperCard finds a simple way to solve either (2) above or (4) above, I will continue to use HyperCard
DALSOP
 
Posts: 8
Joined: Tue May 11, 2010 9:33 am

Re: using buttons to move between stacks

Postby codegreen » Sat Feb 05, 2011 6:22 pm

DALSOP wrote:Unfortunately everything represents a "work around" to attempt to solve a problem already solved in HyperCard. So, I list workarounds: (1) in converting a HyperCard stack to SpuperCard, the face card (Class, Order, Family) always had part of the background (used for entering all the taxonomic stuff for each species, as well as the collecting data. So, first thing was to find if I could take a background card and paint on a white foreground face on it. Well, I found that in regular SuperCard the paint tools are disabled and could only be used in SuperEdit ($100 extra).

You are seriously misinformed -- the paint tools are NOT disabled in the runtime environment.

So, I then pasted the clear background cards into the stacks, and had to rewrite all scripts on the face cards to say "go next card" before making a new entry card.

Without seeing your scripts it's hard to comment intelligently on this issue, but it sounds like you're overcomplicating things.

(2) SuperCard unable to remember paths between stacks, even if they are in the same folder. Well, you answered and tech services answered that SuperCard does not remember paths.

As long as any project in a folder is open, you can address other projects in the folder without specifying a full path. SuperCard no longer remembers paths to any folder outside the default search path set after the last project in it is closed simply because as file systems grew larger and more complex this behavior caused too much grief for users (due to accidental references to the wrong project) and therefore was removed. It's trivial to script around this safeguard, but without seeing your code we can't offer much help.

(3) I went through the tedious process of converting most of the converted HyperCard stack into one stack (this is mind-numbing - it requires first copying then pasting each card onto the new (growing) stack. And it must be done by continually pulling down menus because there are no menu shortcuts for doing this

Importing multiple cards takes just a couple of clicks if you have SuperEdit (part of the SuperCard Suite), but even if you don't you could write a simple script in about ten seconds to do the whole job (or you could add your own keyboard shortcut to the menu item in question if you prefer).

(4) Sorting card problem! Because I can't have separate stacks for each family, but now must have everything in one stack, an ABSOLUTE necessity is non-global sorts.

You wouldn't have this problem if you'd done what others suggested and imported each of your stacks into its own window. Even with them all in the same window though it's not hard to sort any arbitrary subset of them separately using techniques described elsewhere in this forum. It just takes a few extra lines of script...

Well, I read every page of the manual today (printed out 100+ pages), and read 3 times everyone of the allowed commands, and there is just no way to do it without the most extreme workarounds. The problem with workarounds, is that they take time!!! And, I don't have time to waste - I have my HyperCard stacks working perfectly, and have just discovered a most promising way to connect them with species pictures I have stored in iPhoto. So, as I said unless SuperCard finds a simple way to solve either (2) above or (4) above, I will continue to use HyperCard

Clearly reading and understanding are different things altogether. Unfortunately we can't solve problems that exist mainly between your keyboard and chair unless you post code for us to look at. If you weren't so busy obstinately doing things the hard way, you'd have plenty of time to consider the trivial workarounds needed here. And if you bothered to ask better questions (i.e., ones with actual code in them) you'd get much more useful answers...

-Mark
codegreen
 
Posts: 1510
Joined: Mon Jul 14, 2008 11:03 pm

Re: using buttons to move between stacks

Postby vinnie-bob » Sun Feb 06, 2011 7:14 am

DALSOP wrote:Lorenz,
So, I then pasted the clear background cards into the stacks, and had to rewrite all scripts on the face cards to say "go next card" before making a new entry card. SO I DID IT!


To rewrite the scripts easily, next time, try and write a script to do it.
put the number of cards in the window into a variable, go to first card, set up a repeat loop to go from cd 1 to total number of cds and then set the script of btn x to "on mouseup" & return & "go next card" & return & "end mouseup"

That isn't a workaround, it is a solution.

DALSOP wrote:(2) SuperCard unable to remember paths between stacks, even if they are in the same folder. Well, you answered and tech services answered that SuperCard does not remember paths. SO I FOLLOWED YOUR SUGGESTION!


Saying that Supercard cannot remember paths is fundamentally incorrect. It can remember anything you put into a variable or a userobject. Persistence of variable contents between launches is easy if you simply write those variables to a text file, and read them back in when the project launches.

DALSOP wrote:(3) I went through the tedious process of converting most of the converted HyperCard stack into one stack (this is mind-numbing - it requires first copying then pasting each card onto the new (growing) stack. And it must be done by continually pulling down menus because there are no menu shortcuts for doing this, and then


See the language guide under "do menu". A script to automate this task is trivial.

DALSOP wrote:(4) Sorting card problem! Because I can't have separate stacks for each family, but now must have everything in one stack, an ABSOLUTE necessity is non-global sorts. Well, I read every page of the manual today (printed out 100+ pages), and read 3 times everyone of the allowed commands, and there is just no way to do it without the most extreme workarounds.


Yes, but now everything is conveniently located in one project, and your families should be in separate windows. Separate windows = separate hypercard stacks. You are getting bogged down on semantics. With separate windows you can sort each family as you please. Combining all the families into one giant conglomeration is a simple matter of scripting a copy and paste routine, which can be sorted differently than all the separate family windows.

DALSOP wrote:The problem with workarounds, is that they take time!!! And, I don't have time to waste

Supercard has its fair share of time saving "built ins" which don't require a lot of work. What can't be done with built in features are easily accomplished with a little scripting. You may call this "workaround" but most people would call this "programming". That's the way it is... and if you don't like it, when your OS 9 hardware dies, you'll be looking at using Filemaker or XCode to do your project. Then you will truly learn the definition of "workaround" and pain.
------
vince
------
User avatar
vinnie-bob
 
Posts: 218
Joined: Sun Jul 06, 2008 10:55 am
Location: Des Moines, Iowa, USA

Re: using buttons to move between stacks

Postby Dan_Kelleher » Sun Feb 06, 2011 9:34 am

I used Hypercard very little but in SuperCard (and perhaps in HyperCard ?) the projectPath function is very useful in composing paths to files in the same folder as the project.
It returns the path to the folder to which the file name can be appended to yield the path to the file:

get projectpath(this project)
put it & "myFileName" into pathToMyFile

In addition, the "findFolder" External function in the Xtend project that comes with superCard can return the path to a large number of folders on the Mac. Use the Resource Manager to both open the Xtend project and to Copy the external into the data fork of your project.
HTH
-Dan
Daniel.Kelleher@umassmed.edu
SC4.7.3 OSX 10.7.2 Mac Pro
User avatar
Dan_Kelleher
 
Posts: 438
Joined: Sun Jul 06, 2008 2:45 pm
Location: Worcester (wouster as in would) Massachusetts USA

Re: using buttons to move between stacks

Postby Scott » Sun Feb 06, 2011 10:47 am

DALSOP wrote:I don't have time to waste - I have my HyperCard stacks working perfectly

I am not sure I would consider the prospect of bringing a HyperCard stack you depend on up to date a waste of time. You are obviously intelligent. You have the tools to significantly enrich this project and bring it into the 21st century, but you need to realize the two environments are not identical. There are a handful of things HyperCard does that SuperCard does not, and there are hundreds of things SuperCard does that HyperCard does not.

In my experience, folks coming to SuperCard from HyperCard have long forgotten their initial struggle to get up to speed in that environment. They just want their stack working and do not explore what is possible in the richer environment that is SuperCard.

You can give up if you want to, but that seems a pity as you already have the tool but are choosing to continue to live on borrowed time. Plus, there are folks here willing to help, but as previously pointed out, you ask questions in a manner similar to "it is broken, tell me how I fix it". No one here can read your mind, so without knowing exactly what you are doing they are going to be hard pressed to offer any kind of solution short of playing guessing games. And that "is" a waste of time.
User avatar
Scott
Site Admin
 
Posts: 1217
Joined: Sat Jul 05, 2008 1:37 pm
Location: Northern Sierra Nevada

Re: using buttons to move between stacks

Postby DALSOP » Sun Feb 06, 2011 4:27 pm

To all late answering people,

I have been working on Macs and Mac programs since the first version of Mac+. I am an expert on HyperCard programming and have heavily used all programs like Canvas and Photoshop, etc during my career. For your information I am currently working with my 15th, 16th and 17th Macs - all of which are tower G4's.

So, when I click on paint tools, and have open a card that has only background information on it and am working in the foreground, and then set the foreground color to white, then take a selection tool and select the entire surface of the entire card, then select the paint bucket, bring it over the selected space and click on it, I expect to end up with a card with a white foreground color on it. NOPE!! No coverage!! So, I conclude that my paint tools have been disabled - wouldn't you?

As for SuperCard remembering everything in the folder in which it was opened. Again NOPE, What I would get is "where is this folder" and see that it had opened desktop, and then gotten to the folder, and not opened it. It wouldn't open it even if I gave it the entire string - my name:desktop:collection folder:insect directory.

From all of the comments I have gotten to the contrary of my statements, I am beginning to feel that what I bought/was sent & downloaded from SuperCard was in part a disabled copy.

And, OK how does one make one to many converted stacks part of the same window?? I mean, what is the process and how does one do it?? And, I meant it when I said that the SuperCard guide was of very little help! If I could get everything into one window, then almost all of my problems would be solved. There is also the small problem of handling the almost all of 800+ cards whichhold different information, and are being constantly added to because I am describing newly found species at the current rate of almost 200/year!!
DALSOP
 
Posts: 8
Joined: Tue May 11, 2010 9:33 am

Re: using buttons to move between stacks

Postby vinnie-bob » Sun Feb 06, 2011 9:05 pm

DALSOP wrote:As for SuperCard remembering everything in the folder in which it was opened. Again NOPE, What I would get is "where is this folder" and see that it had opened desktop, and then gotten to the folder, and not opened it. It wouldn't open it even if I gave it the entire string - my name:desktop:collection folder:insect directory.


Mark's point about uploading some code is a good one. That gives people here something to work with and the possibility of seeing where things went awry. What you describe above isn't very clear and there really isn't much there for people to give input on. Since you really don't want to be dealing with several separate projects, the point is moot. (As a general rule, if SC is asking you to find a folder, chances are the file path is not correct.)

DALSOP wrote:And, OK how does one make one to many converted stacks part of the same window?? I mean, what is the process and how does one do it?? And, I meant it when I said that the SuperCard guide was of very little help! If I could get everything into one window, then almost all of my problems would be solved. There is also the small problem of handling the almost all of 800+ cards whichhold different information, and are being constantly added to because I am describing newly found species at the current rate of almost 200/year!!


OK, so the scenario is you have several windows of your old hypercard stacks which you want to incorporate into a single Supercard project which contains windows holding the various hypercard stacks.

1) Easy way: Open New proj in SuperEdit (available in the developer's edition) which will be the composite project. Open the other projects (your various hypercard stacks) in SuperEdit. Copy the main window from the various bug stacks into the Main project. Done.

2) "Harder" way: in Supercard Runtime Editor, open the main composite project and make a new window, then open one of the bug stacks. Now you need to write a script for a button which roughly does something like this (and I am winging it here as I haven't used Supercard for several months):

Code: Select all
on mouseup
  trace -- trace is your friend...step through to see if things are working as expected
  -- next get number of cards you need to import. use message box to get the complete path
  -- by typing 'the long name of window 1 of this proj' in msg box and return after you have brought
  -- the window you are interested in to the front.
  put the number of cards in window "Antifungals" of proj "OS X:Users:vangelon:Documents:Supercard stuff:antifungals 3.0 copy" into cdNum
  repeat with i = 1 to cdNum
    -- tell SC which window you are talking to...there are two available, so you have to specify
    setwindow window "Antifungals" of proj "OS X:Users:vangelon:Documents:Supercard stuff:antifungals 3.0 copy"
    go cd i
    copy card
    setwindow window 1 of proj "OS X:Users:vangelon:Desktop:test1.sc45"
     -- the new empty window you are copying to. notice the complete path includes the file extension here!
    go last card
    paste card
  end repeat
trace off
end mouseup


This will probably work with a few minor tweaks for what you want to do. After you trace through it on a test project, remove the trace statements and let 'er rip. If you want the process to be MUCH faster, you should add "set the lockscreen to true" right after the on mouseup statement and "set lockscreen to false" just before the end mouseup. This will prevent the screen from redrawing after every paste, so it will be quicker, but if you want the reassurance of seeing the pastes happen, you can leave it out.

HTH
------
vince
------
User avatar
vinnie-bob
 
Posts: 218
Joined: Sun Jul 06, 2008 10:55 am
Location: Des Moines, Iowa, USA

Re: using buttons to move between stacks

Postby codegreen » Sun Feb 06, 2011 10:56 pm

DALSOP wrote:So, when I click on paint tools, and have open a card that has only background information on it and am working in the foreground, and then set the foreground color to white, then take a selection tool and select the entire surface of the entire card, then select the paint bucket, bring it over the selected space and click on it, I expect to end up with a card with a white foreground color on it. NOPE!! No coverage!! So, I conclude that my paint tools have been disabled - wouldn't you?

There are two reasons for the behavior you are encountering. The first is that in SuperCard a paint graphic which consists entirely of white pixels is considered to be empty, and by default empty paint objects are automatically discarded when closed. You can override that by setting the allowEmptyPaint to true. The second reason is that the default ink for paint graphics is mask, and in mask mode all white pixels are transparent. Thus you'll need to set the ink of the graphic to something else (e.g., srcCopy) for the white pixels to show up.

However using a paint graphic to cover a card with white is a terribly inefficient way of doing it. You should consider using a draw rectangle for this instead. Draw graphics occupy the same handful of bytes in your project file no matter how big they are.

As for SuperCard remembering everything in the folder in which it was opened. Again NOPE, What I would get is "where is this folder" and see that it had opened desktop, and then gotten to the folder, and not opened it. It wouldn't open it even if I gave it the entire string - my name:desktop:collection folder:insect directory.

This doesn't sound like the expected behavior, but again without actual code to look at we can only guess why things are going off into the weeds.

And, OK how does one make one to many converted stacks part of the same window??

Once again, you DON'T want to make all your stacks part of the same window! Generally this will complicate things if you're trying to adapt a collection of separate stacks, especially if you're going to want to sort them separately. The suggestion was to put the contents of each stack into a SEPARATE window, which will have the benefit of collecting all your data into a single project file and allow you to make references to their contents without any file paths at all.

That's not the only solution of course. You could easily leave all your converted stacks as separate projects and just tweak the old code a little bit to include file paths in the references to them, or keep them in the same folder as your master project (which would eliminate any need to specify full paths). If this isn't working for you then you're doing something wrong, but without seeing your scripts we can't help you much with that...

I mean, what is the process and how does one do it?? And, I meant it when I said that the SuperCard guide was of very little help! If I could get everything into one window, then almost all of my problems would be solved. There is also the small problem of handling the almost all of 800+ cards whichhold different information, and are being constantly added to because I am describing newly found species at the current rate of almost 200/year!!

If you want to import a series of separate stacks as separate windows, you could do something like this:

Code: Select all
on importStack
  answer file "Select a project to import:"
  if it is empty then exit script
  put it into theFile
  lock messages
  set the itemDel to ":"
  get last item of theFile
  set the itemDel to "."
  put item 1 of it into theName
  new invisible window
  push cd
  put the long id of this wd into targetWd
  set the name of this window to theName
  open invisible proj theFile
  repeat with i = 1 to the num of cards
    open invisible cd i of wd 1 of proj theFile
    copy cd
    do "setWindow" && targetWd
    paste cd
  end repeat
  close proj theFile
  pop cd
  delete card
  close this wd
end importStack

Now wherever your scripts referenced card <n> of stack <blah> they can instead reference cd <n> of wd <blah>, and you can sort them just the way you did before since each wd contains exactly what the original imported stack did...

The one place where this may cause you problems is that when you paste a card in the SC runtime (but not SuperEdit), if the id of the background you're pasting doesn't match the id of a background in the target window, a new background will be added to the target window. Thus unless you're lucky enough that the source bkgnd's ID number happens to already exist in the target wd, each paste will also create a fresh copy of the pasted card's background. Currently there's no runtime fix for that, since backgrounds can only be reassigned in SuperEdit. Thus if you want to import multiple cards that share the same background, you'll most likely either have to buy the full SC Suite (formerly known as the Developer Edition) or else persuade someone who has it to do the import for you (which shouldn't be too hard if you ask nicely, since most people here are pretty helpful and it will only take them a few seconds to do...).

HTH,
-Mark
codegreen
 
Posts: 1510
Joined: Mon Jul 14, 2008 11:03 pm

Re: using buttons to move between stacks

Postby Dan_Kelleher » Mon Feb 07, 2011 5:10 am

Very helpful post.

set the itemDel to "."


Mark, Is this to eliminate any possible "extension" incorporated into the stack name ?
User avatar
Dan_Kelleher
 
Posts: 438
Joined: Sun Jul 06, 2008 2:45 pm
Location: Worcester (wouster as in would) Massachusetts USA

Re: using buttons to move between stacks

Postby codegreen » Mon Feb 07, 2011 5:12 am

Dan_Kelleher wrote:Very helpful post.

set the itemDel to "."


Mark, Is this to eliminate any possible "extension" incorporated into the stack name ?

Exactly.

-Mark
codegreen
 
Posts: 1510
Joined: Mon Jul 14, 2008 11:03 pm


Return to Upgrading From HyperCard

Who is online

Users browsing this forum: No registered users and 1 guest