home *** CD-ROM | disk | FTP | other *** search
/ Power CD-ROM!! 7 / POWERCD7.ISO / prgmming / clipper / peekstrn.c < prev    next >
C/C++ Source or Header  |  1993-10-14  |  1KB  |  64 lines

  1. /*
  2.  * File......: PEEKSTRN.C
  3.  * Author....: David Pearson
  4.  * BBS.......: The Dark Knight Returns
  5.  * Net/Node..: 050/069
  6.  * User Name.: Dave Pearson
  7.  * Date......: 25/03/93
  8.  * Revision..: 1.0
  9.  *
  10.  * This is an original work by Dave Pearson and is placed in the public
  11.  * domain.
  12.  *
  13.  * Modification history:
  14.  * ---------------------
  15.  *
  16.  * $Log$
  17.  *
  18.  */
  19.  
  20. #include "GT_Mem.H"
  21. #include <Extend.H>
  22.  
  23. /*
  24.  *  $DOC$
  25.  *  $FUNCNAME$
  26.  *      GT_PEEKSTN()
  27.  *  $CATEGORY$
  28.  *      Memory
  29.  *  $ONELINER$
  30.  *      Get a specific length string from memory.
  31.  *  $SYNTAX$
  32.  *      GT_PeekStN(<nSegment>,<nOffset>,<nLength>) --> cString
  33.  *  $ARGUMENTS$
  34.  *      <nSegment> is the segment of the string in memory.
  35.  *
  36.  *      <nOffset>  is the offset of the string in memory.
  37.  *
  38.  *      <nLength>  is the length of the string.
  39.  *  $RETURNS$
  40.  *      The string found at <nSegment>:<nOffset>.
  41.  *  $DESCRIPTION$
  42.  *      GT_PeekStN() can be used for getting strings from specific areas
  43.  *      of memory that are not NULL terminated.
  44.  *  $EXAMPLES$
  45.  *      // Print the ROM BIOS date.
  46.  *
  47.  *      ? GT_PeekStN(61440,65525,8)
  48.  *  $SEEALSO$
  49.  *      GT_PEEKSTZ()
  50.  *  $END$
  51.  */
  52.  
  53. CLIPPER GT_PeekStN()
  54. {
  55.         if (PCOUNT == 3 && ISNUM(1) && ISNUM(2) && ISNUM(3))
  56.         {
  57.                 _retclen((char *)_GT_MK_FP(_parni(1),_parni(2)),_parni(3));
  58.         }
  59.         else
  60.         {
  61.                 _retc("");
  62.         }
  63. }
  64.