home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.sys.mac.hypercard
- Path: sparky!uunet!cis.ohio-state.edu!magnus.acs.ohio-state.edu!usenet.ins.cwru.edu!gatech!cc.gatech.edu!news
- From: byrne@cc.gatech.edu (Michael Byrne)
- Subject: Re: XCMD and filename HELP!!!
- Message-ID: <1992Jul28.122205.13229@cc.gatech.edu>
- Sender: news@cc.gatech.edu
- Organization: College of Computing
- References: <1992Jul28.111201.21732@nuscc.nus.sg>
- Date: Tue, 28 Jul 1992 12:22:05 GMT
- Lines: 51
-
- In article <1992Jul28.111201.21732@nuscc.nus.sg> taihou@shankar.iss.nus.sg (Tng Tai Hou) writes:
- >Hi.
- >
- >I am writing an XCMD that that takes in a targa file and displays
- >it on the HyperCard/SuperCard window. I am not using any fancy
- >HyperCard 2.x xwindow calls. The syntax is
- >
- >ShowTarga filename, x, y
- >
- >Unfortunatelly, I run into some coding problems in manipulating
- >files. Internally, my code must require both the correct
- >vRefNum and a pascal filename:
- >
- >OSErr ShowTarga (short vRefNum, StringPtr fn, short x, short y);
- >
- >I really don't understand it at all. The only way I got this to
- >work was to follow exactly the following:
- >
- >1. Make sure that my folder or stack is 1 level in the hard disk and
- > not anywhere else, including the desktop.
- >2. I must write my code such that vRefNum is zer0 for the default volume.
- >3. Then from HyperCard, I must specify the FULL path:
- > "Volume:MyFolder:MyTargaFile"
- >
- >Is there a more generic way of writing this? I need both the vRefNum,
- >and the filename.
- >
- >Please help me with this. I need this code example very badly, not
- >just for the targa display, but for other formats as well.
- >
- >Thanks a zillion in advance.
- >
- >Tai Hou
- >Singapore
-
- Your XCMD can work cleanly regardless of where the targa file is. (BTW,
- what is a "targa" file?).
-
- First, the XCMD must be passed the FULL pathname. This is easy to get
- with the "answer file" command. Your XCMD should take this full path
- and parse out the volume name (everything up to the colon). Then call
- GetVol to get the vRefNum for the volume in question. You should then
- be set to pass the vRefNum and file path to the ShowTarga call.
-
- ============================================================
- Mike Byrne byrne@cc.gatech.edu
- Grad student in Psychology/Cognitive Science
- 25947 GA Tech Station, Atlanta, GA 30332
-
- ----->>>> "Only the mediocre are always at their best."
-
-