[comp.sys.mac.hypercard] Hyper-Hackers digest V1 #7

chuq@plaid.Sun.COM (Chuq Von Rospach) (12/10/87)

                    HYPER-HACKERS Digest Vol. 1 #7
                           December 9, 1987

                              Subjects:
                      XFCN & HyperTalk questions
                            Visual Effects
                            sorting fields

-----------------------------------
Date: 27 Nov 87 10:27 EST
From: science@nems.ARPA (Mark Zimmermann)
Subject: XFCN & HyperTalk questions

     A few quick questions (which might be best answered by
examples of how to do things):
  - how can I return more than 255 characters of results to HyperCard
from my XFCNs?  (e.g., can I use a SetField... call, giving it a simple
pointer to a pointer to my long string -- or is that dangerous?)
  - if I have generated a zero-terminated string in my XFCN, how can I
return (a handle to) it to HyperCard without going through the pair of
calls ZeroToPas and then PasToZero?
  - how can I store information such as file vrefnums, etc., for use in
later calls to my XFCNs, other than in HyperCard global variables which
then have to be translated to/from strings every time?  (i.e., is there
any way for me to pass binary parameters, perhaps arrays?; is there any
way for me to reserve and hang on to a chunk of memory between calls to
my XFCNs?; etc.)
  - how does an XCMD return an "error" condition, so that the user can
get the result string from returnValue?
  - in HyperTalk, is there any way to ask for information from an arbitrary
point within a file (other than sequentially reading up to that point from
the start) -- something like fseek() in <stdio>?
     I am writing some XFCNs in Lightspeed C to retrieve information
from my multi-megabyte inverted index ("Browser") files.  Thanks for any
advice (and especially thanks for any code samples of XFCNs in LSC)!  ^z

-----------------------------------
Date: 	  Mon, 30 Nov 87 15:54:33 PST
From: PUGH@NMFECC.ARPA
Subject:   Visual Effects

To the fellow who doubted my claim that you can stack visual effects and that 
they get queued up.  Try this:

	visual effect scroll left
	visual effect scroll left
	go to prev card

It will scroll left twice.  This means that Hypercard is saving these things 
up until you go somewhere.  That someone also made the comment that doing a

	visual effect dissolve to inverse

does something right away.  This is wrong.  This statement does not do
anything until a go command is issued.  The go command is the only command
that seems to flush the visual effects queue.  There may be some other
statements that clear this queue, but most do not affect it.  I do not have
time to do an in depth analysis of the commands that mess with the visual
effects queue. Theoretically, Keith from Hyperbug@Apple is looking into this
question. Perhaps he can shed some light on the subject. 

-----------------------------------
Date: Sun, 6 Dec 87 23:23:19 est
From: hodas@eniac.seas.upenn.edu (Josh Hodas)
Subject: sorting fields

Fellow Hyperhackers:

    I am in need of a fast method for sorting a field line by line.
I have implemented standard selection sort but its a dog (495 seconds for
175 lines on a Mac II) and have attempted quicksort but it dies with
"too much recursion" or "too many variables" if the field has more than 
 about 15 lines.  I may try shellsort tomorrow; but even if it works, 
it is likely to be slow if written in hypertalk.

	What I really need is a simple xfcn that sorts a given text field.
It should be really simple to implement, I simply haven't got the tools
as yet (still picking a compiler).  

	Has anyone out there written or seen such a function?  Any
help would be greatly apreciated.

				Thanks,
				Josh Hodas
				Hodas@eniac.seas.upenn.edu

PS:  It seems rather horrible that hypertalk should die on such shallow
     recursion.  any clues?
***********************************
End of HYPER-HACKERS Digest