home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #16 / NN_1992_16.iso / spool / comp / sys / mac / hypercar / 2900 < prev    next >
Encoding:
Text File  |  1992-07-28  |  2.3 KB  |  63 lines

  1. Newsgroups: comp.sys.mac.hypercard
  2. Path: sparky!uunet!cis.ohio-state.edu!magnus.acs.ohio-state.edu!usenet.ins.cwru.edu!gatech!cc.gatech.edu!news
  3. From: byrne@cc.gatech.edu (Michael Byrne)
  4. Subject: Re: XCMD and filename HELP!!!
  5. Message-ID: <1992Jul28.122205.13229@cc.gatech.edu>
  6. Sender: news@cc.gatech.edu
  7. Organization: College of Computing
  8. References: <1992Jul28.111201.21732@nuscc.nus.sg>
  9. Date: Tue, 28 Jul 1992 12:22:05 GMT
  10. Lines: 51
  11.  
  12. In article <1992Jul28.111201.21732@nuscc.nus.sg> taihou@shankar.iss.nus.sg (Tng Tai Hou) writes:
  13. >Hi.
  14. >
  15. >I am writing an XCMD that that takes in a targa file and displays
  16. >it on the HyperCard/SuperCard window. I am not using any fancy
  17. >HyperCard 2.x xwindow calls. The syntax is
  18. >
  19. >ShowTarga filename, x, y
  20. >
  21. >Unfortunatelly, I run into some coding problems in manipulating
  22. >files. Internally, my code must require both the correct
  23. >vRefNum and a pascal filename: 
  24. >
  25. >OSErr ShowTarga (short vRefNum, StringPtr fn, short x, short y);
  26. >
  27. >I really don't understand it at all. The only way I got this to
  28. >work was to follow exactly the following:
  29. >
  30. >1.  Make sure that my folder or stack is 1 level in the hard disk and
  31. >    not anywhere else, including the desktop.
  32. >2.  I must write my code such that vRefNum is zer0 for the default volume.
  33. >3.  Then from HyperCard, I must specify the FULL path:
  34. >    "Volume:MyFolder:MyTargaFile"
  35. >
  36. >Is there a more generic way of writing this? I need both the vRefNum,
  37. >and the filename.
  38. >
  39. >Please help me with this. I need this code example very badly, not
  40. >just for the targa display, but for other formats as well.
  41. >
  42. >Thanks a zillion in advance.
  43. >
  44. >Tai Hou
  45. >Singapore
  46.  
  47. Your XCMD can work cleanly regardless of where the targa file is. (BTW,
  48. what is a "targa" file?).  
  49.  
  50. First, the XCMD must be passed the FULL pathname.  This is easy to get
  51. with the "answer file" command.  Your XCMD should take this full path
  52. and parse out the volume name (everything up to the colon).  Then call
  53. GetVol to get the vRefNum for the volume in question.  You should then
  54. be set to pass the vRefNum and file path to the ShowTarga call.
  55.  
  56. ============================================================
  57. Mike Byrne                               byrne@cc.gatech.edu
  58. Grad student in Psychology/Cognitive Science
  59. 25947 GA Tech Station, Atlanta, GA 30332
  60.  
  61. ----->>>>    "Only the mediocre are always at their best."
  62.                     
  63.