[comp.sys.mac.programmer] SFGetFile problems in compiled THINK pascal application

msanford@umaxc.weeg.uiowa.edu (Michael Sanford) (05/03/91)

The following is my code:
FUNCTION StandardFile (opCode: StandardType; oldName: Str255;
                       fType: OSType; VAR vRef: integer) : Str255;
VAR
  where: Point;
  reply: SFReply;
  textType: SFTypeList;

BEGIN
  where.h := 80;
  where.v ;= 55;
  textType[0] := fType;
  IF opCode = StandardGet THEN
    BEGIN
      ShowText; {For debugging purposes}
      writeln('Before.');
      SFGetFile(where, Null, NIL, 1, textType, NIL, reply);{BOMB!!}
      writeln('After.');
    END
   ELSE
    SFPutFile(where, Null, OldName, NIL, reply);
  .
  .
  .
END;

Problem:  I get a bomb in the compiled appliaction immediately following
          the execution of the SFGetFile procedure.
Backround:  The problems happens on many different Macintosh platforms.
            I have tried THINK Pascal 3.0.1 and THINK Pascal 2.0.3.
            Problems occurrs in both Finder and Multifinder.
            RUNS FINE IN THE INTERPRETER, BUT NOT IN THE COMPILED APPLICATION.
            I have Initialized the Dialog Manager.

In the application I get the "Before." to print, but BOMBS before the "After."
is printed.

I appreciate the repsonse from people who were kind and knowledgeable enough
to write the last time. Unfortunately, those suggestions did not work and
I NEED HELP FAST...PLEASE, Anyone!

--
+===========================================================================+
| Mike Sanford, University of Iowa, 319-339-1689                            |
| msanford@umaxc.weeg.uiowa.edu                                             |
+===========================================================================+