home *** CD-ROM | disk | FTP | other *** search
/ PC Gamer 3.14 / 1998-05_Disc_3.14.bin / addons / p2edit / lineconv.zip / LINECONV.CPP next >
C/C++ Source or Header  |  1998-02-04  |  839b  |  38 lines

  1. /*
  2.    This is a short program to convert the value of edit /70 to the byte
  3. location.
  4.  
  5.     This source is copyright (c) Perspective Video & Electronics,
  6.     http://www.pvid.com
  7.  
  8.     Permission granted to use, abuse, re-write, distribute, and delete
  9.     this code in any means you wish.
  10.    
  11. */
  12.  
  13. #include <conio.h>
  14. #include <stdio.h>
  15. #include <iostream.h>
  16.  
  17. main()
  18. {
  19.    unsigned long int lines, col, byteoffset;
  20.    int width;
  21.  
  22.  
  23.    printf("Note, the line width is the number you use after edit.\n");
  24.    printf("i.e. edit /70 filename.ext would be a width of 70\n\n");
  25.    printf("Line: ");
  26.       cin >> lines;
  27.    printf("COL : ");
  28.       cin >> col;
  29.    printf("Line width: ");
  30.       cin >> width;
  31.  
  32.    byteoffset = lines * width + col - width - 1;
  33.    printf("Byte location: %ld\n", byteoffset);
  34.  
  35.  
  36. return(0);
  37. }
  38.