[comp.sys.mac.hypercard] A good book for desscribing nitty gritty of XCMDs and language use

pkahn@meridian.UUCP (05/21/88)

I'm sure this has circultaed before, but what is a good technical
source for XCMD writing?  I want to write C or Pascal code to control
a Data Translation video digitizer board, and then I want these
operations to execute out of Hypercard (e.g., GET DIGITIZED VIDEO).
Goodman's book and two others (purportedly on HyperTalk, hah!) had
nothing that I could find on this.  Also, is there an advantage to C
versus Pascal for this stuff?  Any help on this is greatly
appreciated.

Phil Kahn

chuq@plaid.Sun.COM (Chuq Von Rospach) (05/22/88)

>I'm sure this has circultaed before, but what is a good technical
>source for XCMD writing?

The only documentaion I'm aware of right now is the APDA technical specs.
Dan Shafer is going to have a book out later this year, probably aroudn the
time of the Boston Expo in August. And considering the sheer number of
HyperTalk books that have been published so far, I'd expect at least 400
XCMD books to be published in the next year.

>Goodman's book and two others (purportedly on HyperTalk, hah!) had
>nothing that I could find on this.

Hypertalk has nothing to do with XCMDS or XFCNS. HyperTalk is the HyperCard
programming language. XCMDS and XFCNS is an interface that allows external
programmed modules to be stuck into HyperCard. Completely different beasts


Chuq Von Rospach			chuq@sun.COM		Delphi: CHUQ

	Robert A. Heinlein: 1907-1988. He will never truly die as long as we
                           read his words and speak his name. Rest in Peace.

dan@Apple.COM (Dan Allen) (05/23/88)

There is no REALLY good book on XCMD writing.  The best current source
is APDA.  There is a disk with some sample XCMDs in C and Pascal with a
bit of brief on-disk documentation.  There is also the "HyperCard Script
Language Reference Manual" which has an appendix on XCMDs.  There will
be a new version of this manual in book form by Addison-Wesley later
this year (late summer, early fall) which will have some improved
material.

There will be an article in a special Dr. Dobb's Macintosh Issue coming
out on newstands sometime in mid June about writing XCMDs which I wrote,
so I will not comment more at this time.

As far as C verses Pascal and XCMDs, MPW Pascal has the advantage over
MPW C that strings and the like are not global data, but are in C.
HyperCard itself is written in Pascal, for what that's worth, but XCMDs
in C seem to work fine.  The Dr. Dobb's article I wrote uses C because
of its apparent popularity these days.

Hope this helps some.

Dan Allen
Software Explorer
Apple Computer

GFX@PSUVM.BITNET (05/25/88)

>There is no REALLY good book on XCMD writing.  The best current source
>is APDA.  There is a disk with some sample XCMDs in C and Pascal with a
>bit of brief on-disk documentation.

I have been introduced to XCMDs syntax by the XCMD.SIT available from
Borland's forum.  The examples provided are relatively clear, except
for the correct procedure one should use to pass arrays, instead of
single parameters to XFCNs.

Which source would be the most appropriate and how do we get it?  Eg. ->
I have been especially puzzled by the following:

PROGRAM test;

 $R-
 $U-
 $D PasXFCN

USES   MemTypes, QuickDraw, OSIntf, HyperXCmd;

  PROCEDURE PasXFCN(paramPtr:#XCmdPtr);     (* THE # SHOULD READ AS A CARET *)

   VAR
    str    : Str255;

 $I Xcmdglue.Inc

   BEGIN;
    zeroToPas(paramPtr#.params[2]#,str);    (* THE # SHOULD READ AS CARET *)
    paramPtr#.returnValue := PasToZero(str);(* THE # SHOULD READ AS CARET *)
   END;

BEGIN
END.

If called with:       Put test(1,2) into someContainer
the XFCN returns 2, as expected.  However, if the string 1,2 is in a container,
a call such as:       Put test(field someField) into someOtherContainer
returns garbage of the form :  W>>W>>W>> (etc.)

What happens?  Can someone tell me how to transfer arrays residing in
HYPERCARD fields to an XFCN, and back?
-------

Stephane Gauvin : GFX@PSUVM : (814) 237-4979 : Compuserve 73057,1763
Interests: Marketing: New products, Mathematical Models, Game Theory
           Computing: AI, MacIntosh, Hypercard