home *** CD-ROM | disk | FTP | other *** search
/ DP Tool Club 31 / CDASC_31_1996_juillet_aout.iso / vrac / del2faq.zip / ALLFAQ.ZIP / DELSEC17.FAQ < prev    next >
Text File  |  1996-02-07  |  8KB  |  191 lines

  1. SECTION 17 - TP/BP DOS Programming
  2.                            
  3. This document contains information that is most often provided
  4. to users of this section.  There is a listing of common
  5. Technical Information Documents that can be downloaded from the
  6. libraries, and a listing of the five most frequently asked
  7. questions and their answers.
  8.          
  9. TI1184   Overview of Borland Pascal 7.0 and Turbo Pascal 7.0
  10. TI1722   Declaring an array on the heap
  11. TI1760   Creating a temporary stack in real or protected mode
  12. TI1171   Problem Report Form
  13. TI1719   Booting Clean
  14. TI432   Printing graphics to an HP LaserJet
  15. TI433   Printing graphics to an Epson
  16. TI407   Using the serial port in a Pascal application
  17. TI152   Interupt handler for 3.X and lower
  18. TI226   Async routines for versions 3.X and lower
  19. TI232   Absolute disk read for version 3.x and lower
  20.  
  21. LC2P01.FAQ   Linking C to Pascal Frequently Asked Questions
  22. EZDPMI.ZIP   Unit encapsulating common DPMI requests for
  23.              protected mode programming 
  24. BIGSTU.PAS   How to cope with memory allocations > 64K 
  25. PASALL.ZIP   Collection of Technical Information Sheets from 
  26.              1986 on
  27. NEWRTM.ZIP   Latest RMT.EXE and DPMI16BI.OVL
  28. MOUSE.ZIP    General purpose mouse unit for text/graphic modes
  29.  
  30.  
  31. Q:   "How do I link an object file that is a library of
  32.      functions created in C?"
  33.  
  34. A:   Download the file "LC2P01.FAQ:  The C run-time library is
  35.      needed by the object file.  Since Pascal can't link the C
  36.      RTL as is, you will need the RTL source and will need to
  37.      modify it so that it can be linked by TP.
  38.  
  39. Q:   "How do I get the ASCII key numbers for the Arrow keys?"
  40.  
  41. A:   Below is a short program that reveals this information.
  42.  
  43.      program DisplayAscii;
  44.      uses Crt;
  45.      var
  46.        ch:char;
  47.      begin
  48.        repeat               { repeat until Ctrl-C }
  49.             ch := Readkey;
  50.             Write(Ord(CH):4);
  51.        until ch = ^C;          
  52.      end.
  53.  
  54.      The program can be terminated by pressing Ctrl-C.  You'll
  55.      see that keypresses such as UpArrow actually generated two
  56.      bytes:  a zero followed by the extended key code. 
  57.  
  58. Q:   "Why do I get runtime error 4 while using the following
  59.      line:  reset(InFile)?"
  60.  
  61. A:   The error message means that you have run out of file
  62.      handles.  The FILES= statement in your CONFIG.SYS doesn't
  63.      change the fact that a process can, by default, open a
  64.      maximum of 20 files (and DOS grabs 5 of those).  The
  65.      SetHandleCount() API function can be used to increase the
  66.      number of handles useable by your application.
  67.  
  68. Q:   "I am using overlays with BP7 with Objects.  If Overlay A
  69.      calls a procedure or function in Overlay B, does Overlay A
  70.      stay in memory while Overlay B runs?  Or does Overlay B
  71.      wipe out Overlay A, and when Overlay B finishes, it reloads
  72.      Overlay A?"
  73.  
  74. A:   It depends on the size of the overlays and the size of the
  75.      overlay buffer you set up.  In general you can think of the
  76.      overlay buffer as a pool of memory where overlaid units can
  77.      be stored.  Every time you call a routine in an overlaid
  78.      unit, that overlay is loaded into the buffer.  If the
  79.      buffer is already full, then the oldest unit in the buffer
  80.      is discarded to make room for the new one.  If you've got a
  81.      small overlay buffer and large overlaid units, they may
  82.      well kick each other out as they load.  If you've got a
  83.      large overlay buffer the program may well keep everything
  84.      in memory the entire time.
  85.  
  86. Q:   "I am getting DosError = 8 when using EXEC() to execute a 
  87.      program from within my program.  How do I correct this?"
  88.  
  89. A:   DosError = 8 means that there is not enough memory 
  90.      available to run the program being EXEC'ed.  Normally your
  91.      program grabs all available memory and doesn't leave any 
  92.      for the program being EXEC'ed.  Be sure to use the $M 
  93.      directive which minimizes the memory required by your
  94.      program.  
  95.  
  96. Q:   "I am getting DosError = 2 when using EXEC() to copy a 
  97.      file from one directory to another.  The file does exist
  98.      and the command line is correct.  What is the problem?"
  99. A:   You might have assumed that because COMMAND.COM is on your
  100.      path, EXEC will find it.  Nope.  EXEC needs the full path
  101.      name.  You can use GetEnv('COMSPEC') to get the value of
  102.      the environment variable COMSPEC which should be the full
  103.      path.  
  104.      
  105. Q:   "Does Turbo Pascal run in Super VGA modes?"
  106.  
  107. A:   Yes, if you have a VESA compatable video card you can use
  108.      the VESA16.BGI file to get high resolutions such as 1024X768
  109.      or 800X600. If you also want 256 color support, you should
  110.      turn to a third party solution. There are some helpful
  111.      files, including freeware drivers, available here on the
  112.      forum.
  113.  
  114. Q:   "How can I print my graphics code?"
  115.  
  116. A:   Download the files labeled TI432.ZIP and TI433.ZIP from 
  117.      the libraries. Additional support is available from third 
  118.      party vendors. You could pose a question in the forum asking
  119.      for recommendations regarding third party graphics support 
  120.      for printing.
  121.  
  122. Q:   "When will Borland upgrad the GRAPHICS TOOLBOX?"
  123.  
  124. A:   The GRAPHICS TOOLBOX is no longer available from Borland in
  125.      any form, and there are absolutely no plans to upgrade it.
  126.      It should, however, recompile with recent versions of
  127.      Pascal including Versions 6.0 and 7.0.
  128.  
  129. Q:   "How can I use BGI calls in Windows?"
  130.  
  131. A:   Windows is a graphical operating environment, so there is
  132.      no longer any need for the BGI when programming Windows. You
  133.      will find that Windows has built in support for graphics
  134.      that is much superior to anything available in the BGI unit.
  135.      To get started, try using using the manuals and on-line docs
  136.      to read about the Windows GDI.
  137.  
  138. Q:   "How can I add a mouse to my Graphics programs?"
  139.  
  140. A:   Outside of Windows and Turbo Vision, Borland offers no built
  141.      in support for the mouse in your programs. However, adding 
  142.      mouse support is extremely simply. Those who know ASSEMBLER
  143.      can add mouse support with the INT33 interface, others will
  144.      find MOUSE libraries available here in the CIS libraries.
  145.  
  146. Q:   "Are any of the ToolBox programs that shipped with versions
  147.      3.0 and 4.0 still available.  For instance, can I get an
  148.      upgraded copy of the Database ToolBox or the Editor
  149.      ToolBox."
  150.  
  151. A:   No. These programs are no longer in any form from any
  152.      company. If you want to get a copy of them, you would need
  153.      to purchase them from a current owner.
  154.  
  155. Q:   "Can the ToolBox programs be used from version 7.0?"
  156.  
  157. A:   It depends. As a rule, the answer is yes, all you need to do
  158.      is recompile and they will run fine. This is totally
  159.      fortuitous, however, and Borland has, and will, do nothing
  160.      to update these programs. See TI1728 for help upgrading the
  161.      Editor ToolBox.
  162.  
  163. Q:   "How can I convert my Turbo Pascal 3.0 program to version
  164.      7?"
  165.  
  166. A:   There is a file called up UPGRADE.ZIP which is available on
  167.      the forums. This can help in the process of upgrading the
  168.      files. Most of the code from version 3.0 will run fine under
  169.      7.0, but not all of it.
  170.  
  171. Q:   "When I use the Turbo Vision editors unit from Version 6.0 I
  172.      never see the numbers 3, 4, 6 and 7 when I try to type them
  173.      in."  
  174.  
  175. A:   This was a bug in the first version of TP6.0. The fix is
  176.      available in EDITOR.PAT, found in LIB1.
  177.  
  178. Q:   "What ever happened to FreeMin and FreePtr?"
  179.  
  180. A:   These Turbo Pascal 5.x identifiers are no longer used by the
  181.      heap manager.  Simply delete references to FreeMin from your
  182.      code. If you're using routines that use FreePtr to compress
  183.      the heap or perform other implementation-dependent
  184.      operations on the heap, you'll need to update these
  185.      routines. (If you just need to lower the top of memory in
  186.      order to do an Exec, you can call the SetMemTop procedure
  187.      from the Turbo Vision Memory unit.) See the Programmer's
  188.      Guide for more information about how the heap manager
  189.      works.
  190.  
  191.