home *** CD-ROM | disk | FTP | other *** search
/ Microsoft Programmer's Library 1.3 / Microsoft-Programers-Library-v1.3.iso / books / qcuprun.db < prev    next >
Encoding:
Text File  |  1991-03-01  |  131.1 KB  |  2,518 lines

  1. %@1@%%@AB@%Microsoft  QuickC  Compiler - UP AND RUNNING%@AE@%%@EH@%%@NL@%
  2.                                       %@NL@%
  3.                                       %@NL@%
  4.                                       %@NL@%
  5.                                       %@NL@%
  6.                                       %@NL@%
  7.                                       %@NL@%
  8.                                       %@NL@%
  9.  
  10. ────────────────────────────────────────────────────────────────────────────%@NL@%
  11.              %@AB@%Microsoft (R) QuickC (R) Compiler - UP AND RUNNING%@AE@%%@NL@%
  12.                                       %@NL@%
  13.                                 %@AB@%VERSION 2.5%@AE@%%@NL@%
  14. ────────────────────────────────────────────────────────────────────────────%@NL@%
  15.                                       %@NL@%
  16.                                       %@NL@%
  17.                            MICROSOFT CORPORATION %@NL@%
  18.                                       %@NL@%
  19.                                       %@NL@%
  20. %@NL@%
  21. %@NL@%
  22. %@NL@%%@NL@%
  23. %@NL@%
  24.  
  25.  
  26. Information in this document is subject to change without notice and does
  27. not represent a commitment on the part of Microsoft Corporation. The
  28. software described in this document is furnished under a license agreement
  29. or nondisclosure agreement. The software may be used or copied only in
  30. accordance with the terms of the agreement. It is against the law to copy
  31. the software on any medium except as specifically allowed in the license or
  32. nondisclosure agreement. No part of this manual may be reproduced or trans-
  33. mitted in any form or by any means, electronic or mechanical, including
  34. photocopying and recording, for any purpose without the express written
  35. permission of Microsoft.  
  36. (C) Copyright Microsoft Corporation, 1988, 1990. All rights reserved.%@NL@%
  37. %@NL@%
  38.  
  39. Printed and bound in the United States of America.%@NL@%
  40. %@NL@%
  41.  
  42. Microsoft, MS, MS-DOS, CodeView, and QuickC are registered 
  43. trademarks of Microsoft Corporation.%@NL@%
  44. %@NL@%
  45. Amdek is a registered trademark of Amdek Corporation.%@NL@%
  46. %@NL@%
  47. BRIEF is a registered trademark of UnderWare, Inc.%@NL@%
  48. %@NL@%
  49. COMPAQ is a registered trademark of Compaq Computer Corporation.%@NL@%
  50. %@NL@%
  51. Epsilon is a trademark of Lugaru Software, Inc.%@NL@%
  52. %@NL@%
  53. Hercules is a registered trademark of Hercules Computer 
  54. Technology.%@NL@%
  55. %@NL@%
  56. IBM is a registered trademark of International Business 
  57. Machines Corporation.%@NL@%
  58. %@NL@%
  59. Norton Guides is a trademark of Peter Norton Computing.%@NL@%
  60. %@NL@%
  61. WordStar is a registered trademark of MicroPro International 
  62. Corporation.%@NL@%
  63. %@NL@%
  64. Document No. SY10424-0290
  65. OEM D703-2Z
  66. 10 9 8 7 6 5 4 3 2 1 %@AI@%%@AE@%%@NL@%
  67. %@NL@%
  68. %@NL@%
  69. %@NL@%
  70. %@NL@%
  71. %@NL@%
  72. %@NL@%
  73. %@1@%%@AB@%Table of Contents%@AE@%%@EH@%%@NL@%
  74. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%%@NL@%
  75. %@NL@%
  76.  
  77. %@NL@%
  78. %@AB@%Introduction%@AE@%%@BO:        162e@%%@NL@%
  79.      Read This Manual First%@BO:        1a07@%%@NL@%
  80.      Features New to Version 2.5%@BO:        1fd1@%%@NL@%
  81. %@NL@%
  82. %@AB@%Chapter 1%@AE@%%@BO:        2290@%  %@AB@%Unpacking QuickC(R)%@AE@%%@NL@%
  83. %@NL@%
  84.      System Requirements%@BO:        2429@%%@NL@%
  85.      The QuickC Package%@BO:        275e@%%@NL@%
  86. %@NL@%
  87. %@AB@%Chapter 2%@AE@%%@BO:        2edc@%  %@AB@%Installing QuickC%@AE@%%@NL@%
  88. %@NL@%
  89.      A Quick Overview%@BO:        3293@%%@NL@%
  90.      Running SETUP%@BO:        39e7@%%@NL@%
  91.             SETUP Stage One%@BO:        48f4@%%@NL@%
  92.             SETUP Stage Two%@BO:        771f@%%@NL@%
  93.             SETUP Stage Three%@BO:        794e@%%@NL@%
  94. %@NL@%
  95. %@AB@%Chapter 3%@AE@%%@BO:        88fb@%  %@AB@%Using QuickC%@AE@%%@NL@%
  96. %@NL@%
  97.      The QuickC Environment%@BO:        8cf5@%%@NL@%
  98.      Using Windows and Menus%@BO:        9321@%%@NL@%
  99.             Getting Started%@BO:        9482@%%@NL@%
  100.             Using the Mouse and Keyboard%@BO:        9fb0@%%@NL@%
  101.             Windows%@BO:        a206@%%@NL@%
  102.             Menus%@BO:        ba8c@%%@NL@%
  103.             Dialog Boxes%@BO:        dc0c@%%@NL@%
  104.      Using the Editor%@BO:        e8d1@%%@NL@%
  105.             Moving Around in a Source File%@BO:        e9c1@%%@NL@%
  106.             Customizing the Editor%@BO:        f375@%%@NL@%
  107.             Using Another Editor%@BO:        fdf9@%%@NL@%
  108.      Compiling and Linking%@BO:       10559@%%@NL@%
  109.             Building within the QuickC Environment%@BO:       10879@%%@NL@%
  110.             Building from Multiple Source Files%@BO:       11ca2@%%@NL@%
  111.             Compiling and Linking from the Command Line%@BO:       135cb@%%@NL@%
  112.      The Debugger%@BO:       1418c@%%@NL@%
  113. %@NL@%
  114. %@AB@%Chapter 4%@AE@%%@BO:       14c92@%  %@AB@%Getting Help%@AE@%%@NL@%
  115. %@NL@%
  116.      Structure of the Microsoft Advisor%@BO:       14f2f@%%@NL@%
  117.      Navigating through the Microsoft Advisor%@BO:       15266@%%@NL@%
  118.             Using the Help Menu%@BO:       15507@%%@NL@%
  119.             Using the F1 Key%@BO:       15ccc@%%@NL@%
  120.             Using Hyperlinks%@BO:       16197@%%@NL@%
  121.             Using Help Windows and Dialog Boxes%@BO:       16896@%%@NL@%
  122.             Accessing Different Types of Information%@BO:       17ef8@%%@NL@%
  123. %@NL@%
  124. %@AB@%Chapter 5%@AE@%%@BO:       189c8@%  %@AB@%Where to Go from Here%@AE@%%@NL@%
  125. %@NL@%
  126. %@NL@%
  127. %@AB@%Appendix A%@AE@%%@BO:       19f81@%  %@AB@%Editor Functions%@AE@%%@NL@%
  128. %@NL@%
  129. %@NL@%
  130. %@AB@%Appendix B%@AE@%%@BO:       1dbc5@%  %@AB@%QuickC Differences%@AE@%%@NL@%
  131. %@NL@%
  132.      QuickC Version 2.0 Additions%@BO:       1dea4@%%@NL@%
  133.      QuickC Version 2.5 Additions and Changes%@BO:       1e19a@%%@NL@%
  134.             Interface and Environment Changes%@BO:       1e2a6@%%@NL@%
  135.             Language and Compiler Changes%@BO:       1e573@%%@NL@%
  136. %@NL@%
  137. %@NL@%
  138. %@CR:C6A-Intro   @%%@1@%%@AB@%Introduction%@AE@%%@EH@%%@NL@%
  139. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  140. %@NL@%
  141. Welcome to the Microsoft(R) QuickC(R) Compiler version 2.5, a powerful and
  142. sophisticated yet easy-to-use integrated environment for writing programs in
  143. the C language.  %@NL@%
  144. %@NL@%
  145. In recent years, the popularity of C has grown tremendously. C programs
  146. often can be ported from one computer to another. C programs are fast. C
  147. source code is compact and concise. The language encourages, but does not
  148. enforce, modular and structured programming styles. For these and other
  149. reasons, many programmers and professional software developers prefer C to
  150. any other language.  %@NL@%
  151. %@NL@%
  152. Microsoft QuickC combines the power of C with an environment that makes C
  153. easy to learn and to use. You can write code, compile and link it, run the
  154. program, and debug it, all without leaving the QuickC environment.  %@NL@%
  155. %@NL@%
  156. %@NL@%
  157. %@2@%%@CR:C6A00000001 @%%@AB@%Read This Manual First%@AE@%%@EH@%%@NL@%
  158. %@NL@%
  159. This manual contains all the information you need to install and begin using
  160. QuickC on your computer. There are five chapters:  %@NL@%
  161. %@NL@%
  162. %@AB@%Unpacking QuickC%@AE@% - Chapter 1 lists the system requirements (hardware that
  163. you provide) and the contents of this package (software and documentation
  164. that we provide).%@NL@%
  165. %@NL@%
  166. %@AB@%Installing QuickC%@AE@% - Before you can start using QuickC, you must install it.
  167. Although the installation process is quick and easy, you may want more
  168. information about libraries and memory models. Chapter 2 guides you through
  169. installation and provides answers to commonly asked questions.%@NL@%
  170. %@NL@%
  171. %@AB@%Using QuickC%@AE@% - Chapter 3 explains how to run QuickC and introduces the
  172. window and menu environment. Next, it presents an example of a typical
  173. development cycle: writing, compiling, linking, running, and debugging a
  174. short program.%@NL@%
  175. %@NL@%
  176. %@AB@%Getting Help%@AE@% - The Microsoft QuickC Advisor (online help) provides important
  177. reference information at the click of a button or press of a key. Chapter 4
  178. illustrates the many facets of QuickC's powerful online help system.%@NL@%
  179. %@NL@%
  180. %@AB@%Where to Go from Here%@AE@% - Once you have unpacked QuickC, installed it on your
  181. system, and compiled a sample program, you will probably want to investigate
  182. QuickC further. Chapter 5 provides some suggestions on what to do next. %@NL@%
  183. %@NL@%
  184. %@NL@%
  185. %@2@%%@CR:C6A00000002 @%%@AB@%Features New to Version 2.5%@AE@%%@EH@%%@NL@%
  186. %@NL@%
  187. If you have used an earlier version of QuickC, you'll find a variety of new
  188. features in version 2.5. These features include  %@NL@%
  189. %@NL@%
  190. %@NL@%
  191.   ■   Language compatibility with Microsoft C version 6.0%@NL@%
  192. %@NL@%
  193.   ■   Increased ANSI standard C compatibility%@NL@%
  194. %@NL@%
  195.   ■   Support for the tiny memory model (.COM files)%@NL@%
  196. %@NL@%
  197.   ■   Enhanced %@AI@%C for Yourself%@AE@%%@NL@%
  198. %@NL@%
  199.   ■   New Quickwatch debugging feature%@NL@%
  200. %@NL@%
  201.   ■   Customized color window support%@NL@%
  202. %@NL@%
  203. %@NL@%
  204. For a comprehensive list of new features, refer to Appendix B.  %@NL@%
  205. %@NL@%
  206. %@NL@%
  207. %@NL@%
  208. %@NL@%
  209. %@NL@%
  210. %@NL@%
  211. %@CR:C6A00010001 @%%@1@%%@AB@%Chapter 1  Unpacking QuickC(R)%@AE@%%@EH@%%@NL@%
  212. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  213. %@NL@%
  214. You're probably eager to install the QuickC Compiler immediately. But you
  215. should first take a few minutes to make sure your system meets minimum
  216. requirements and to determine that your package is complete.  %@NL@%
  217. %@NL@%
  218. %@NL@%
  219. %@2@%%@CR:C6A00010002 @%%@AB@%System Requirements%@AE@%%@EH@%%@NL@%
  220. %@NL@%
  221. QuickC requires the following minimum configuration:  %@NL@%
  222. %@NL@%
  223. %@NL@%
  224.   ■   An IBM(R) Personal Computer or compatible running DOS version 2.1 or
  225.       later.%@NL@%
  226. %@NL@%
  227.   ■   One hard-disk drive and one floppy-disk drive. %@NL@%
  228. %@NL@%
  229.   ■   448K (kilobytes) of available memory (512K is recommended for medium
  230.       to large projects).
  231. %@NL@%
  232. ────────────────────────────────────────────────────────────────────────────%@NL@%
  233. NOTE
  234.  
  235. %@AI@%Microsoft documentation uses the term "DOS" to refer to both the Microsoft
  236. %@AI@%and the IBM Disk Operating Systems (MS-DOS%@AI@%(R)%@AE@%%@AI@% and PC-DOS).%@AE@%%@AE@%%@NL@%
  237. ────────────────────────────────────────────────────────────────────────────%@NL@%%@NL@%
  238. %@NL@%
  239. %@NL@%
  240. %@NL@%
  241. %@NL@%
  242. %@NL@%
  243. %@2@%%@CR:C6A00010003 @%%@AB@%The QuickC Package%@AE@%%@EH@%%@NL@%
  244. %@NL@%
  245. Check your QuickC package to see if everything is there. If any pieces are
  246. missing, contact the retailer from whom you bought QuickC. In the package,
  247. you should find the following items:  %@NL@%
  248. %@NL@%
  249. %@AI@%Registration card:%@AE@% there are many advantages to being a registered owner of
  250. QuickC version 2.5, including notification of future software releases and
  251. easy access to customer assistance. Please take the time to fill out and
  252. mail the registration card now.  %@NL@%
  253. %@NL@%
  254. %@AI@%Disks:%@AE@% eight 5.25-inch floppy disks or four 3.5-inch floppy disks. The
  255. distribution disk labeled "Setup" contains a file named PACKING.LST that
  256. lists the location and description of all disk files in the Microsoft QuickC
  257. package.  %@NL@%
  258. %@NL@%
  259. %@AI@%Up and Running:%@AE@% the book you're reading now. It explains how to install and
  260. use QuickC.  %@NL@%
  261. %@NL@%
  262. %@AI@%C for Yourself:%@AE@% this book is written for programmers who know at least one
  263. language (such as BASIC or Pascal) but who don't know C. Part 1, "Learning
  264. C," is a tutorial that explains how to program in C. Many examples are
  265. included. Part 2, "Using C," examines further the library functions that
  266. perform input and output, the functions that create graphics, and new
  267. features such as real coordinate graphics, presentation graphics, fonts, and
  268. in-line assembly. The appendixes summarize the C language and QuickC library
  269. functions.  %@NL@%
  270. %@NL@%
  271. %@AI@%Microsoft QuickC Tool Kit:%@AE@% this book explains the individual tools and
  272. utilities that accompany QuickC. Beginners probably won't need to refer to
  273. this book while they're learning the fundamentals of C. Advanced C
  274. programmers should turn to this book for detailed information about
  275. compiling, linking, creating libraries, maintaining multiple-module
  276. programs, and more.  %@NL@%
  277. %@NL@%
  278. %@NL@%
  279. %@NL@%
  280. %@NL@%
  281. %@NL@%
  282. %@NL@%
  283. %@CR:C6A00020001 @%%@1@%%@AB@%Chapter 2  Installing QuickC%@AE@%%@EH@%%@NL@%
  284. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  285. %@NL@%
  286. This chapter tells you how to install the QuickC Compiler on your system.
  287. The SETUP.EXE program on the Setup distribution disk performs the
  288. installation.  %@NL@%
  289. %@NL@%
  290. SETUP.EXE does two things. First, it copies several programs (the compiler,
  291. the linker, the library manager, the help system, and others) from the
  292. distribution disks to your hard disk. Second, it creates one or more
  293. combined libraries. You can't program in C without a library.  %@NL@%
  294. %@NL@%
  295. This chapter also explains why it's necessary to build combined libraries
  296. and how the components fit together.  %@NL@%
  297. %@NL@%
  298. If you follow the instructions, when you finish the chapter you'll have a
  299. working version of QuickC on your system and you'll be ready to start
  300. programming in C.  %@NL@%
  301. %@NL@%
  302. %@NL@%
  303. %@2@%%@CR:C6A00020002 @%%@AB@%A Quick Overview%@AE@%%@EH@%%@NL@%
  304. %@NL@%
  305. There are four steps to installing QuickC:  %@NL@%
  306. %@NL@%
  307. %@NL@%
  308.   1.  Make backup copies of all distribution disks.%@NL@%
  309. %@NL@%
  310.   2.  Read the first section of the README.DOC file for information on
  311.       installing QuickC. If there are any corrections to this book, they're
  312.       listed at the beginning of README.DOC.%@NL@%
  313. %@NL@%
  314.   3.  Run SETUP.EXE, which is an interactive program. The questions you
  315.       answer determine the QuickC environment that is installed. Default
  316.       answers are listed in brackets. At the bottom of each screen is a
  317.       brief synopsis of what each question means.%@NL@%
  318. %@NL@%
  319.   4.  Adjust your system and environment variables. SETUP.EXE creates two
  320.       files: NEW-VARS.BAT and NEW-CONF.SYS. Add the information from the
  321.       NEW-VARS.BAT file to your AUTOEXEC.BAT file. If you'd prefer not to
  322.       make the changes permanent, you can run NEW-VARS.BAT as a batch file.
  323.       Change your CONFIG.SYS file if the %@AS@% files %@AE@% value and %@AS@% buffers %@AE@% value
  324.       are currently smaller than the values in NEW-CONF.SYS. After modifying
  325.       these files, reboot.%@NL@%
  326. %@NL@%
  327. %@NL@%
  328. The process is not difficult and each screen provides helpful guidance. If
  329. you have enough DOS and programming experience to complete these four steps
  330. without further assistance, we encourage you to do so. (If you get stuck,
  331. return to this chapter.) You may then skip ahead to Chapter 3, "Using
  332. QuickC."  %@NL@%
  333. %@NL@%
  334. ────────────────────────────────────────────────────────────────────────────%@NL@%
  335. NOTE
  336.  
  337. %@AI@%If you make a mistake during the setup process, just run the program again.
  338. %@AI@%SETUP.EXE never erases files from the distribution disks.%@AE@%%@NL@%
  339. ────────────────────────────────────────────────────────────────────────────%@NL@%%@NL@%
  340. %@NL@%
  341. %@NL@%
  342. %@2@%%@CR:C6A00020003 @%%@AB@%Running SETUP%@AE@%%@EH@%%@NL@%
  343. %@NL@%
  344. Before you run SETUP, back up the distribution disks using the DOS COPY
  345. command or the DISKCOPY program. Then read the first part of the README.DOC
  346. file by loading it into a word processor or by using the TYPE command:  %@NL@%
  347. %@NL@%
  348. %@AS@%  TYPE README.DOC | MORE%@AE@%%@NL@%
  349. %@NL@%
  350. When you are ready to install QuickC, insert the Setup disk in drive A and
  351. then change to that drive (type %@AS@% A:%@AE@% ). At the DOS command line, type  %@NL@%
  352. %@NL@%
  353. %@AS@%  SETUP%@AE@%%@NL@%
  354. %@NL@%
  355. ────────────────────────────────────────────────────────────────────────────%@NL@%
  356. NOTE
  357.  
  358. %@AI@%The following instructions assume that you plan to install QuickC on a
  359. %@AI@%system that has at least one floppy-disk drive and one hard-disk drive.%@AE@%%@NL@%
  360. ────────────────────────────────────────────────────────────────────────────%@NL@%%@NL@%
  361. %@NL@%
  362. %@NL@%
  363. %@4@%%@AB@%Correcting Mistakes%@AE@%%@EH@%%@NL@%
  364. %@NL@%
  365. Each setup screen ends by asking if you want to change any of the options.
  366. If you press Y, you can correct any of the answers you entered.  %@NL@%
  367. %@NL@%
  368. To exit the SETUP program at any time, press CTRL+C.  %@NL@%
  369. %@NL@%
  370. %@NL@%
  371. %@4@%%@AB@%Understanding Libraries%@AE@%%@EH@%%@NL@%
  372. %@NL@%
  373. Compared to other programming languages, C is very lean. It contains only a
  374. few dozen keywords and operators. To print something on the screen, for
  375. example, you call the %@AB@%printf%@AE@% function, which is %@AI@%not%@AE@% a keyword or an
  376. operator. It's not included in the C language proper. Strictly speaking,
  377. %@AB@%printf%@AE@% is a "library function."  %@NL@%
  378. %@NL@%
  379. When you link a program, the linker looks in the current library for any
  380. functions that were not defined in the program. If your source file calls
  381. %@AB@%printf%@AE@%, for example, the linker looks in the library for the machine code
  382. that executes the function, adds it to the executable program, and resolves
  383. any references to %@AB@%printf%@AE@%.  %@NL@%
  384. %@NL@%
  385. A library, then, is just a set of commonly used functions that have been
  386. gathered into one place. The American National Standards Institute (ANSI)
  387. defines a great number of library functions (including %@AB@%printf%@AE@%). Microsoft
  388. QuickC adds even more. In C, the keywords and operators number in the
  389. dozens, while the library functions number in the hundreds. Incidentally,
  390. you can add your own heavily used functions to the library (or combine them
  391. into a separate library) if you wish. See %@AI@%Microsoft QuickC Tool Kit%@AE@% for more
  392. information on using the Library Manager (LIB.EXE).  %@NL@%
  393. %@NL@%
  394. One of the key jobs performed by SETUP.EXE is building at least one large
  395. "combined library." Individual smaller parts of the library are called
  396. "component libraries." The two component libraries you must have are the
  397. memory model library and the math package library. The two additional
  398. component libraries containing graphics functions are optional.  %@NL@%
  399. %@NL@%
  400. You'll ultimately use one of the combined libraries when you compile and
  401. link a program.  %@NL@%
  402. %@NL@%
  403. %@NL@%
  404. %@4@%%@AB@%SETUP Options%@AE@%%@EH@%%@NL@%
  405. %@NL@%
  406. SETUP has two options for shortcuts: /H and /L. You should %@AI@%not%@AE@% use these
  407. options the first time you run SETUP.  %@NL@%
  408. %@NL@%
  409. Use the /L option after you have already installed QuickC and you want to
  410. build additional combined libraries without going through the entire setup
  411. process.  %@NL@%
  412. %@NL@%
  413. Combined libraries are described above (see "Understanding Libraries"). If
  414. you wish to add more libraries in the future, use the /L option:  %@NL@%
  415. %@NL@%
  416. %@AS@%  SETUP /L%@AE@%%@NL@%
  417. %@NL@%
  418. The /H option suppresses the SETUP help information sent to the screen. If
  419. you install QuickC again, you can bypass the help information by using the
  420. /H option:  %@NL@%
  421. %@NL@%
  422. %@AS@%  SETUP /H%@AE@%%@NL@%
  423. %@NL@%
  424. %@NL@%
  425. %@3@%%@CR:C6A00020004 @%%@AB@%SETUP Stage One%@AE@%%@EH@%%@NL@%
  426. %@NL@%
  427. Before SETUP can install QuickC, it needs some information about your system
  428. and the type of programming you intend to do. This first stage of SETUP is a
  429. series of questions split into three screens.  %@NL@%
  430. %@NL@%
  431. %@NL@%
  432. %@4@%%@AB@%First Screen: The Libraries%@AE@%%@EH@%%@NL@%
  433. %@NL@%
  434. The first screen asks these questions:  %@NL@%
  435. %@NL@%
  436. %@AS@%  Source of disk images [A:]:
  437. %@AS@%  Math Options: Emulator [Y]:8087 [N]:
  438. %@AS@%  Memory Models:Small[Y]:Medium[N]:Compact[N]:Large[N]:
  439. %@AS@%  Delete the component libraries when finished [Y]:
  440. %@AS@%  Include in combined libraries: GRAPHICS.LIB [N]:PGCHART.LIB [N]
  441. %@AS@%  
  442. %@AS@%  Do you want to change any of the above options [Y]:%@AE@%%@NL@%
  443. %@NL@%
  444. The questions appear on the screen one at a time. An explanation of each
  445. option appears at the bottom of the screen, unless you added the /H option
  446. when you ran SETUP. Answer the questions by typing in your responses and
  447. pressing ENTER.  %@NL@%
  448. %@NL@%
  449. Each question ends with a default answer inside square brackets (%@AS@%[Y]%@AE@%, for
  450. example). Press ENTER to accept the default. %@AI@%If you are unsure of the proper
  451. %@AI@%reply for any of these questions, consider the default a good place to
  452. %@AI@%start.%@AE@% If you later find you would have preferred to make another choice,
  453. you can always run SETUP again.  %@NL@%
  454. %@NL@%
  455. Each screen concludes by asking if you want to change any of your choices.
  456. When you're satisfied, press N (the default answer is Y, which returns you
  457. to the first question on the screen). If you start over, the default answers
  458. become the choices you made previously.  %@NL@%
  459. %@NL@%
  460. %@NL@%
  461. %@4@%%@AB@%Which Disk Drive?%@AE@%%@EH@%%@NL@%
  462. %@NL@%
  463. The first question on the first screen asks where you're starting from (the
  464. drive containing the distribution disks):  %@NL@%
  465. %@NL@%
  466. %@AS@%  Source of disk images [A:]:%@AE@%%@NL@%
  467. %@NL@%
  468. %@NL@%
  469. %@4@%%@AB@%Which Math Library?%@AE@%%@EH@%%@NL@%
  470. %@NL@%
  471. Your answer to the second question determines which math component libraries
  472. will be included in the combined library:  %@NL@%
  473. %@NL@%
  474. %@AS@%  Math Options: Emulator [Y]:    8087 [N]:%@AE@%%@NL@%
  475. %@NL@%
  476. Some computers contain an 8087 or 80287 math coprocessor chip and some
  477. don't.  %@NL@%
  478. %@NL@%
  479. If your machine is equipped with a coprocessor, linking your programs with
  480. the combined library tailored for the 8087 will speed up all floating-point
  481. calculations. However, these programs will run only on a machine that has an
  482. 8087 or 80287 chip.  %@NL@%
  483. %@NL@%
  484. Programs linked with the emulator library, on the other hand, will run on
  485. any computer, whether it has a coprocessor or not. The emulator library does
  486. check for the presence of a math coprocessor. If the computer has a
  487. coprocessor, it performs all floating-point math operations. If no
  488. coprocessor is installed, the emulator library "emulates" (imitates) the
  489. actions of a coprocessor.  %@NL@%
  490. %@NL@%
  491. If you're not sure which math library to include, choose the emulator
  492. library because it's the most flexible.  %@NL@%
  493. %@NL@%
  494. You may include both math libraries, but doing so doubles the number of
  495. combined libraries SETUP builds, thus doubling the time it takes to install
  496. QuickC. If you intend to install all possible library configurations, you'll
  497. need approximately 6 megabytes of available space on your hard disk. If you
  498. install just one library, you'll need about 2.7 megabytes of free space.  %@NL@%
  499. %@NL@%
  500. %@NL@%
  501. %@4@%%@AB@%Which Memory Model?%@AE@%%@EH@%%@NL@%
  502. %@NL@%
  503. The next question asks which memory models you plan to use:  %@NL@%
  504. %@NL@%
  505. %@AS@%  Memory Models: Small [Y]:   Medium [N]:   Compact [N]:   Large [N]:%@AE@%%@NL@%
  506. %@NL@%
  507. The small memory model is the default. If you're in a hurry to install
  508. QuickC, accept the default answer by pressing ENTER four times and bypass
  509. the explanation below. Should you discover that you need additional memory
  510. for your programs, you can run the SETUP program again. If you're curious
  511. about memory models, read on.  %@NL@%
  512. %@NL@%
  513. The 8086 processor and its relatives access memory in 64K blocks called
  514. "segments." To move outside of the current 64K segment requires additional
  515. machine instructions. Also, an address within the 64K segment can be
  516. specified with only two bytes. If you wish to access more than 64K of memory
  517. locations, their addresses must include additional bytes (which makes
  518. pointer variables longer and program execution slower).  %@NL@%
  519. %@NL@%
  520. C programs have two parts: the code (machine instructions) and the data
  521. (variables and constants). If you write programs that fit either the code or
  522. the data entirely within one 64K segment of memory, the program will execute
  523. faster and use less memory. However, if you need to use multiple memory
  524. segments for the code or the data, you may, although the program will run
  525. more slowly.  %@NL@%
  526. %@NL@%
  527. The various configurations of memory usage are called "memory models."
  528. QuickC supports six standard memory models. Table 2.1 illustrates the
  529. relationship between the six available memory models and the limits placed
  530. on their code and data segments.  %@NL@%
  531. %@NL@%
  532. %@AB@%Table 2.1  %@AB@%Memory Models%@AE@%%@AE@%
  533.  
  534. %@TH:   9   538 02 14 25 37 @%
  535. Memory Model  Code Segment Limit       Data Segment Limit
  536. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  537. Tiny          64K total Code and Data  ─
  538. Small         64K                      64K
  539. Medium        None                     64K
  540. Compact       64K                      None
  541. Large         None                     None
  542. Huge          None                     None
  543. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  544. %@TE:   9   538 02 14 25 37 @%
  545.  
  546. For a great many applications, the small memory model suffices. The tiny
  547. memory model is similar to the small model except it is limited to 64K per
  548. program (including both code and data) and it produces .COM files instead of
  549. .EXE files. If you're working on a large database manager, you might want
  550. one of the models that provides unlimited data segments (compact, large, or
  551. huge). If you're writing a program with many functions, you might want to
  552. remove the limit on the code segment (medium, large, or huge).  %@NL@%
  553. %@NL@%
  554. The huge memory model uses the same library as the large model, so the SETUP
  555. program offers only four choices. The difference between large and huge is
  556. that  %@NL@%
  557. %@NL@%
  558. the huge model allows individual arrays to exceed 64K, whereas the large
  559. model limits arrays to 64K.  %@NL@%
  560. %@NL@%
  561. Any or all of these memory models may be selected, but SETUP.EXE will build
  562. a separate combined library for each model. For example, if you choose the
  563. small memory model and the math emulator, the library file SLIBCE.LIB is
  564. created. If you choose the medium model and the 8087 math package,
  565. MLIBC7.LIB is created. The small memory model libraries start with the
  566. letter "S," medium with "M," compact with "C," and large with "L."
  567. Similarly, the emulator math package is shown by a final "E" in the file
  568. name, the 8087 package by a "7."  %@NL@%
  569. %@NL@%
  570. Given four memory models and two math packages, you can create a total of
  571. eight combined libraries. But the more combined libraries you create, the
  572. more space they'll take on your hard disk and the longer the installation
  573. process will take.  %@NL@%
  574. %@NL@%
  575. The first time you install QuickC, create only one or two combined
  576. libraries. If you find a need for other memory models or math packages, just
  577. run the SETUP program again.  %@NL@%
  578. %@NL@%
  579. %@NL@%
  580. %@4@%%@AB@%Include Graphics Libraries?%@AE@%%@EH@%%@NL@%
  581. %@NL@%
  582. The graphics library GRAPHICS.LIB contains numerous functions for drawing
  583. lines, rectangles, circles, and other shapes. If you plan to write programs
  584. that use these functions, press Y to answer the first of these two
  585. questions:  %@NL@%
  586. %@NL@%
  587. %@AS@%  Include in combined libraries:GRAPHICS.LIB[N]: PGCHART.LIB[N]: %@AE@%%@NL@%
  588. %@NL@%
  589. However, if you plan to write programs that use text output only, then you
  590. probably don't need GRAPHICS.LIB taking up room on your disk. Press N to
  591. omit the graphics library. (If you very rarely need graphics functions, you
  592. can omit the graphics library and, whenever you need the functions,
  593. explicitly link the graphics library GRAPHICS.LIB. See the %@AI@%Microsoft QuickC
  594. %@AI@%Tool Kit%@AE@% manual for more information about linking with a specific library.)
  595. %@NL@%
  596. %@NL@%
  597. The PGCHART.LIB library contains presentation graphics functions for
  598. creating high-resolution graphs (line graphs, bar charts, column charts,
  599. scatter diagrams, and pie charts). Again, if you want to display such
  600. graphics in your programs, press Y to include this component library. If
  601. you'll use presentation graphics rarely or not at all, press N to omit this
  602. library.  %@NL@%
  603. %@NL@%
  604. %@NL@%
  605. %@4@%%@AB@%Second Screen: Extra Files%@AE@%%@EH@%%@NL@%
  606. %@NL@%
  607. The next screen asks the following questions about copying additional files
  608. to your hard disk:  %@NL@%
  609. %@NL@%
  610. %@AS@%  Install Microsoft Mouse [Y]:
  611. %@AS@%  Copy documentation files [Y]:
  612. %@AS@%  Copy the DOS patch files [N]:
  613. %@AS@%  Copy sample C programs [N]:
  614. %@AS@%  Copy the QuickC tutorial files [N]:
  615. %@AS@%  
  616. %@AS@%  Do you want to change any of the above options [Y]:%@AE@%%@NL@%
  617. %@NL@%
  618. SETUP will copy these extra files to your hard disk if you want them.  %@NL@%
  619. %@NL@%
  620. As before, each of these questions is accompanied by an explanation at the
  621. bottom of your screen to help you decide if these files would be useful.  %@NL@%
  622. %@NL@%
  623. %@NL@%
  624. %@4@%%@AB@%Third Screen: The Directories%@AE@%%@EH@%%@NL@%
  625. %@NL@%
  626. The final set of questions asks for the names of directories in which to
  627. store the various files.  %@NL@%
  628. %@NL@%
  629. %@AS@%  Directory for Executable files [C:\QC25\BIN]:
  630. %@AS@%  Directory for Libraries [C:\QC25\LIB]:
  631. %@AS@%  Directory for Include files [C:\QC25\INCLUDE]:
  632. %@AS@%  Directory for Sample files [C:\QC25\SAMPLES]:
  633. %@AS@%  Directory for Tutorial files [C:\QC25\TUTORIAL]:
  634. %@AS@%  
  635. %@AS@%  Do you want to change any of the above options [Y]:%@AE@%%@NL@%
  636. %@NL@%
  637. You don't have to choose any of the default options. You might decide you
  638. want your executable programs in C:\QC25\BIN and your source files in
  639. C:\C_CODE, for example. Type in the names of directories you want SETUP to
  640. use (including the drive name in the path). If the directories don't exist,
  641. SETUP asks if you want to create them.  %@NL@%
  642. %@NL@%
  643. QuickC can be used in conjunction with the Microsoft C Professional
  644. Development System version 6.0. To use QuickC with Microsoft C, choose the
  645. directories where Microsoft C stores executable files, libraries, and header
  646. files: their default names are C:\C600\BIN, C:\C600\LIB, and
  647. C:\C600\INCLUDE; corresponding QuickC directories are C:\QC25\BIN,
  648. C:\QC25\LIB, and C:\QC25\INCLUDE.  %@NL@%
  649. %@NL@%
  650. %@NL@%
  651. %@4@%%@AB@%Checking the Available Disk Space%@AE@%%@EH@%%@NL@%
  652. %@NL@%
  653. Before moving on to stage two, the SETUP program checks your hard disk to
  654. see how much free space is available. If you don't have enough room to
  655. install QuickC (the amount needed varies according to the options you've
  656. chosen), an error message tells you how much space is required for the files
  657. you've requested. If you attempt to install all possible libraries, you'll
  658. need approximately 6 megabytes. If you install just one combined library,
  659. you'll need roughly 2.7 megabytes.  %@NL@%
  660. %@NL@%
  661. If you don't have enough room on your hard disk, you have two choices.
  662. First, you can delete files from the hard disk until there's enough room for
  663. the libraries you want to create. Second, you can reduce the number of
  664. libraries you request (or you can choose not to copy the samples and
  665. documentation files) to cut down the amount of space you need. Either way,
  666. you'll have to run SETUP again.  %@NL@%
  667. %@NL@%
  668. %@NL@%
  669. %@3@%%@CR:C6A00020005 @%%@AB@%SETUP Stage Two%@AE@%%@EH@%%@NL@%
  670. %@NL@%
  671. Now that you've specified your system and programming needs, SETUP goes to
  672. work. This stage requires you to swap the distribution disks in and out of
  673. the drive. Insert the disks as SETUP asks for them and press ENTER. If you
  674. put in the wrong disk, SETUP will ask again for the proper disk.  %@NL@%
  675. %@NL@%
  676. At this point, all SETUP needs is the go-ahead from you. It starts building
  677. the combined libraries you requested, placing them in the directories you
  678. specified.  %@NL@%
  679. %@NL@%
  680. %@NL@%
  681. %@3@%%@CR:C6A00020006 @%%@AB@%SETUP Stage Three%@AE@%%@EH@%%@NL@%
  682. %@NL@%
  683. When SETUP finishes creating the combined libraries, it creates two files:
  684. NEW-VARS.BAT and NEW-CONF.SYS. To install these files permanently, you must
  685. now adjust the DOS environment and modify both your AUTOEXEC.BAT and
  686. CONFIG.SYS files.  %@NL@%
  687. %@NL@%
  688. ────────────────────────────────────────────────────────────────────────────%@NL@%
  689. NOTE
  690.  
  691. %@AI@%If you use other languages that have their own LINK.EXE program, you may not
  692. %@AI@%want to put the QuickC linker in your path. If this is the case, you can
  693. %@AI@%modify CONFIG.SYS and run NEW-VARS.BAT each time you use QuickC.%@AE@%%@NL@%
  694. ────────────────────────────────────────────────────────────────────────────%@NL@%%@NL@%
  695. %@NL@%
  696. %@NL@%
  697. %@4@%%@AB@%Changing AUTOEXEC.BAT%@AE@%%@EH@%%@NL@%
  698. %@NL@%
  699. The file NEW-VARS.BAT created by SETUP might look something like this:  %@NL@%
  700. %@NL@%
  701. %@AS@%  PATH=C:\QC25\BIN;C:\DOS;C:\MYEXE;C:\WIN386;C:\WORD
  702. %@AS@%  set LIB=C:\QC25\LIB
  703. %@AS@%  set INCLUDE=C:\QC25\INCLUDE%@AE@%%@NL@%
  704. %@NL@%
  705. PATH is a system variable that tells your computer where to find executable
  706. programs. The LIB and INCLUDE variables tell QuickC where to find the
  707. libraries and the include files.  %@NL@%
  708. %@NL@%
  709. To make the change permanent, load your current AUTOEXEC.BAT file into an
  710. editor or word processor (you'll find AUTOEXEC.BAT in the root directory),
  711. add the new path names, and save the modified file.  %@NL@%
  712. %@NL@%
  713. You can edit the AUTOEXEC.BAT file with the QuickC editor if you wish.
  714. Change to the directory containing the QC.EXE program (for example, type %@AS@% CD
  715. %@AS@%\QC25\BIN%@AE@% ) and type %@AS@% QC \AUTOEXEC.BAT %@AE@%(the backslash indicates that the
  716. file is in the root directory). Then use the File menu Merge command to
  717. merge NEW-VARS.BAT into AUTOEXEC.BAT.  %@NL@%
  718. %@NL@%
  719. In most cases, it is best to change the AUTOEXEC.BAT file and reboot.
  720. How-ever, if you use other languages and other compilers, you may wish to
  721. leave the AUTOEXEC.BAT file alone and run the NEW-VARS.BAT file before each
  722. QuickC session.  %@NL@%
  723. %@NL@%
  724. If you want to use the 8087 math library instead of the emulator library,
  725. use the /FPi87 option as a custom flag within the QuickC Linker Flags dialog
  726. box or at the command line using QCL. If you compile and link from the
  727. QuickC environment, either add the line below to your AUTOEXEC.BAT file or
  728. type it at the command line:  %@NL@%
  729. %@NL@%
  730. %@AS@%  SET CL=/FPi87%@AE@%%@NL@%
  731. %@NL@%
  732. To maintain compatibility between the QuickC and Microsoft C compilers, the
  733. CL environment variable is used. If you include options that the Microsoft C
  734. compiler recognizes but QuickC doesn't, QuickC issues an error message.  %@NL@%
  735. %@NL@%
  736. %@NL@%
  737. %@4@%%@AB@%Modifying CONFIG.SYS%@AE@%%@EH@%%@NL@%
  738. %@NL@%
  739. The NEW-CONF.SYS file might look like this:  %@NL@%
  740. %@NL@%
  741. %@AS@%  files=20
  742. %@AS@%  buffers=10%@AE@%%@NL@%
  743. %@NL@%
  744. You need to be sure that the %@AS@% files %@AE@% and %@AS@% buffer %@AE@% values are large enough to
  745. contain QuickC. Load your CONFIG.SYS file into an editor or word processor
  746. (again, it should be in the root directory), change the two lines that refer
  747. to files and buffers, and save the modified file. If your current CONFIG.SYS
  748. file has higher numbers ( %@AS@%files = 30%@AE@%, for example), you can leave the higher
  749. value in effect. The numbers in NEW-CONF.SYS are minimums; you may safely
  750. use higher values.  %@NL@%
  751. %@NL@%
  752. ────────────────────────────────────────────────────────────────────────────%@NL@%
  753. NOTE
  754.  
  755. %@AI@%Merely changing the AUTOEXEC.BAT and CONFIG.SYS files does not affect the
  756. %@AI@%current DOS environment. To put the changes into effect, you must reboot
  757. %@AI@%your machine by powering off and then on or by pressing CTRL+ALT+DEL%@AI@%.%@AE@%%@AE@%%@NL@%
  758. ────────────────────────────────────────────────────────────────────────────%@NL@%%@NL@%
  759. %@NL@%
  760. After installing QuickC, changing the files, and rebooting, you can proceed
  761. to Chapter 3, "Using QuickC."  %@NL@%
  762. %@NL@%
  763. %@NL@%
  764. %@NL@%
  765. %@NL@%
  766. %@NL@%
  767. %@NL@%
  768. %@CR:C6A00030001 @%%@1@%%@AB@%Chapter 3  Using QuickC%@AE@%%@EH@%%@NL@%
  769. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  770. %@NL@%
  771. If you followed the instructions in Chapter 2, "Installing QuickC," you now
  772. have a working version of the QuickC Compiler and are ready to write your
  773. first program. This chapter introduces the QuickC environment─a powerful
  774. tool to help you write and test programs.  %@NL@%
  775. %@NL@%
  776. In this chapter you'll work through a sample compiling and linking session.
  777. When you finish, you will have written, saved, built, and tested a working
  778. program.  %@NL@%
  779. %@NL@%
  780. If you'd prefer to experiment on your own or if you've previously used an
  781. older version of QuickC, you can skip this chapter (or skim through it). We
  782. strongly suggest, however, that if you do nothing else, review the next
  783. chapter, "Getting Help." In addition, we recommend that all QuickC users run
  784. the LEARN program, which teaches how to use the QuickC environment.  %@NL@%
  785. %@NL@%
  786. %@NL@%
  787. %@2@%%@CR:C6A00030002 @%%@AB@%The QuickC Environment%@AE@%%@EH@%%@NL@%
  788. %@NL@%
  789. QuickC is a window-based programming environment that integrates a text
  790. editor, a compiler, a linker, a debugger utility, a make utility, and an
  791. on-line help database. This chapter introduces and describes the following
  792. aspects of QuickC:  %@NL@%
  793. %@NL@%
  794. %@AB@%Windows and Menus%@AE@% - The menu system allows you to quickly find the command
  795. or action you need. The first part of this chapter explains how to open and
  796. close windows and how to navigate the menus. It also defines certain terms
  797. used throughout the chapter.%@NL@%
  798. %@NL@%
  799. %@AB@%Editor%@AE@% - When you're writing source code, you'll spend a lot of time using
  800. the QuickC editor. If you know WordStar(R) commands, you'll know how to use
  801. the QuickC editor. If you'd prefer to customize the editor, you can use the
  802. MKKEY utility, which is explained in the "Customizing the Editor" section.%@NL@%
  803. %@NL@%
  804. %@AB@%Compiler/Linker%@AE@% - You can compile, link, and test a program without ever
  805. leaving the editor. QuickC's integrated environment saves you hours of
  806. development time. This part of the chapter defines and illustrates the
  807. various compiling and linking options.%@NL@%
  808. %@NL@%
  809. %@AB@%Debugger%@AE@% - The debugger allows you to set breakpoints, to monitor the status
  810. of key variables, and to trace program execution line by line. This section
  811. of the chapter provides a brief overview of the debugger utility. The LEARN
  812. program includes a lesson that provides more details about the new, advanced
  813. debugging enhancements.%@NL@%
  814. %@NL@%
  815. %@NL@%
  816. %@2@%%@CR:C6A00030003 @%%@AB@%Using Windows and Menus%@AE@%%@EH@%%@NL@%
  817. %@NL@%
  818. Even if you've never used windows and menus before, you'll find the QuickC
  819. programming environment easy to learn.  %@NL@%
  820. %@NL@%
  821. This section introduces the QuickC environment. You'll learn how to control
  822. windows and to choose commands from the menus.  %@NL@%
  823. %@NL@%
  824. %@NL@%
  825. %@3@%%@CR:C6A00030004 @%%@AB@%Getting Started%@AE@%%@EH@%%@NL@%
  826. %@NL@%
  827. To run QuickC, type  %@NL@%
  828. %@NL@%
  829. %@AS@%  QC%@AE@%%@NL@%
  830. %@NL@%
  831. at the DOS prompt. You'll immediately enter the QuickC editor.  %@NL@%
  832. %@NL@%
  833. If you enter a file name after the %@AS@% QC %@AE@% command, for example,  %@NL@%
  834. %@NL@%
  835. %@AS@%  QC MYFILE%@AE@%%@NL@%
  836. %@NL@%
  837. QuickC automatically adds the extension .C that marks a C source file.
  838. Typing the line above causes QuickC to load MYFILE.C.  %@NL@%
  839. %@NL@%
  840. If QuickC can't find the file you specified in the current directory, it
  841. asks if you want to create a new file.  %@NL@%
  842. %@NL@%
  843. If you do not enter a file name after the %@AS@% QC %@AE@% command, QuickC opens an
  844. empty file named UNTITLED.C, which you can rename later or save with another
  845. name.  %@NL@%
  846. %@NL@%
  847. %@NL@%
  848. %@4@%%@AB@%Command-Line Options%@AE@%%@EH@%%@NL@%
  849. %@NL@%
  850. Depending on your particular hardware, you may be required to include one of
  851. the following options on the command line after the %@AS@% QC %@AE@% command but before
  852. the file name, for example, %@AS@% QC /b MYPROG%@AE@%.  %@NL@%
  853. %@NL@%
  854. %@AB@%Option%@AE@%                            %@AB@%Hardware%@AE@%
  855. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  856. %@AS@%/b%@AE@%                                For black-and-white systems, including 
  857.                                   Hercules(R) monochrome monitors, LCD 
  858.                                   screens, and black-and- white monitors.
  859.  
  860. %@AS@%/g%@AE@%                                For AT-compatible systems that refresh 
  861.                                   the screen at a slower rate than the 
  862.                                   standard AT (including some COMPAQ(R) 
  863.                                   systems).
  864.  
  865. %@AS@%/h%@AE@%                                For systems equipped with EGA-, VGA-, or
  866.                                   MCGA-compatible graphics cards capable 
  867.                                   of displaying more than 25 lines of text.
  868.                                   EGA cards can display 43 lines of text, 
  869.                                   VGA cards can display 50. You can use a
  870.                                   Microsoft (or fully compatible) mouse 
  871.                                   with this option. If you encounter 
  872.                                   problems, contact the manufacturer of 
  873.                                   the mouse.
  874.  
  875. %@AS@%/k%@AE@%                                Loads a key file with customized QuickC 
  876.                                   editor
  877.                                   commands.
  878.  
  879. %@AS@%/nohi%@AE@%                             For systems that don't support 
  880.                                   high-intensity colors (including LCD 
  881.                                   monochrome monitors and some Amdek(R) 
  882.                                   color monitors).
  883.  
  884. %@NL@%
  885. %@3@%%@CR:C6A00030005 @%%@AB@%Using the Mouse and Keyboard%@AE@%%@EH@%%@NL@%
  886. %@NL@%
  887. You can enter all commands from the keyboard. If you own a Microsoft (or
  888. fully compatible) Mouse, you can choose to use either the keyboard or the
  889. mouse to enter commands. When this book explains a command, the two options
  890. are marked with icons of a key or a mouse as follows:  %@NL@%
  891. %@NL@%
  892. Press the ALT key.  %@NL@%
  893. %@NL@%
  894. Click the File menu, then click Save.  %@NL@%
  895. %@NL@%
  896. Unless the right button is specifically mentioned, "clicking" means that you
  897. click the mouse's left button once.  %@NL@%
  898. %@NL@%
  899. %@NL@%
  900. %@3@%%@CR:C6A00030006 @%%@AB@%Windows%@AE@%%@EH@%%@NL@%
  901. %@NL@%
  902. The system of windows and menus is simple to use and intuitive. Many
  903. programmers can learn how to use the QuickC environment without learning the
  904. terms that describe the various menus and buttons. In addition, if you're
  905. confused about windows or menus, you can almost always call up a help window
  906. that explains how a menu works (see Chapter 4, "Getting Help"). However, if
  907. you want to read further in this chapter, you'll have to understand the
  908. terms that are used.  %@NL@%
  909. %@NL@%
  910. Figure 3.1 shows a typical QuickC screen, with labels that describe its
  911. parts. Some of the parts provide information only. For example, if the CAPS
  912. LOCK key is on, a letter %@AS@% C %@AE@% appears in the bottom right corner. The letter %@AS@%
  913. %@AS@%C %@AE@% is informational (it tells you the CAPS LOCK key is on). Other parts of a
  914. window perform actions triggered by a specific key or mouse action. For
  915. example, if you click the little box in the upper-left corner of a window,
  916. the window closes. The box is not informational; it's active.  %@NL@%
  917. %@NL@%
  918. %@AU@%(This figure may be found in the printed book.)%@AE@%%@NL@%
  919. %@NL@%
  920. The parts of a window, their status, and their use are listed in Table 3.1.
  921. %@NL@%
  922. %@NL@%
  923. %@AB@%Table 3.1  %@AB@%Parts of a Window%@AE@%%@AE@%
  924.  
  925. %@TH:  25  1346 02 17 22 37 @%
  926. Name             Status                Use
  927. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  928. Close button     Active                Closes the current window (the 
  929.                                        source window cannot be closed). 
  930.                                        Appears in upper-left corner.
  931.  
  932. Menu bar         Active                Lists names of the available menus.
  933.  
  934. Title bar        Informational         Shows name of the window (the 
  935.                                        source window title bar lists the 
  936.                                        file currently being edited).
  937.  
  938. Source window    Active                Contains source code for the 
  939.                                        program you're writing. Seven other
  940.                                        windows are supported: Debug, Help,
  941.                                        Locals, Registers, Notepad, Output,
  942.                                        and Errors.
  943.  
  944. Maximize button  Active                Shrinks or enlarges the current 
  945.                                        window.
  946.  
  947. Reference bar    Informational/        Lists shortcut keystrokes (keyboard
  948.                  Active                users) and direct commands to 
  949.                                        QuickC (mouse users).
  950.  
  951. %@TE:  25  1346 02 17 22 37 @%
  952.  
  953. %@AB@%Table   %@AB@%3.1 (continued)%@AE@%%@AE@%
  954.  
  955. %@TH:  25  1519 02 24 15 37 @%
  956. Name                    Status         Use
  957. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  958. Scroll bars             Active         Indicate your position in the 
  959.                                        current file. If you click in the 
  960.                                        gray area on either side of the 
  961.                                        position marker, you move in that 
  962.                                        direction. If you click the arrows,
  963.                                        you move one line (or one character)
  964.                                        in that direction. If you click and
  965.                                        drag the position indicator, you 
  966.                                        can move anywhere within the file.
  967.  
  968. Line/Column             Informational  Show the current line and column of
  969. indicators                             the text cursor. 
  970.                                        C means CAPS LOCK is on. 
  971.                                        N means NUM LOCK is on.
  972.  
  973. File status indicators  Informational  R means the file is set to Read 
  974.                                        Only status. 
  975.                                        D means Debugging History is on. 
  976.                                        I means the debugging history 
  977.                                        includes user input.
  978.  
  979. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  980.  
  981. %@TE:  25  1519 02 24 15 37 @%
  982.  
  983. %@NL@%
  984. %@4@%%@AB@%Using the Menu Bar%@AE@%%@EH@%%@NL@%
  985. %@NL@%
  986. To choose a command from a menu, you "pull down" or "open" the menu and
  987. choose the command you want:  %@NL@%
  988. %@NL@%
  989. %@NL@%
  990.   1.  Press the ALT key to activate the menu bar.%@NL@%
  991. %@NL@%
  992.   2.  Press the highlighted character in the menu name (F = File, for
  993.       example).%@NL@%
  994. %@NL@%
  995.   3.  Press the highlighted character in the item name (in the File menu, S
  996.       = Save, for example).%@NL@%
  997. %@NL@%
  998. %@NL@%
  999. Or follow these steps:  %@NL@%
  1000. %@NL@%
  1001. %@NL@%
  1002.   1.  Press the ALT key.%@NL@%
  1003. %@NL@%
  1004.   2.  Use the RIGHT and LEFT arrow keys to move to the menu you want.%@NL@%
  1005. %@NL@%
  1006.   3.  Use the UP and DOWN arrow keys to highlight the command.%@NL@%
  1007. %@NL@%
  1008.   4.  Press ENTER.%@NL@%
  1009. %@NL@%
  1010. %@NL@%
  1011. Or:  %@NL@%
  1012. %@NL@%
  1013. %@NL@%
  1014.   1.  Open the menu by clicking the menu name.%@NL@%
  1015. %@NL@%
  1016.   2.  Click the command.%@NL@%
  1017. %@NL@%
  1018. %@NL@%
  1019. %@NL@%
  1020. %@4@%%@AB@%Making the Menu Disappear%@AE@%%@EH@%%@NL@%
  1021. %@NL@%
  1022. If at any point you decide that you don't want to choose a command from a
  1023. menu, you can make the menu disappear:  %@NL@%
  1024. %@NL@%
  1025. Press the ESC key.  %@NL@%
  1026. %@NL@%
  1027. Click somewhere on the screen outside of the menu.  %@NL@%
  1028. %@NL@%
  1029. %@NL@%
  1030. %@4@%%@AB@%Shortcut Keys%@AE@%%@EH@%%@NL@%
  1031. %@NL@%
  1032. In the menus below, you'll notice that certain menu items are followed by
  1033. names of keys. These are the "shortcut keys" for heavily used commands. For
  1034. example, the Run menu Restart command is followed by SHIFT+F5, which means
  1035. that instead of opening the Run menu and choosing the Restart command, you
  1036. can instead hold down the SHIFT key and press F5.  %@NL@%
  1037. %@NL@%
  1038. ────────────────────────────────────────────────────────────────────────────%@NL@%
  1039. NOTE
  1040.  
  1041. %@AI@%The reference bar displays commonly used shortcut keys. In addition, the
  1042. %@AI@%inside front cover of this book lists the important shortcut keys for easy
  1043. %@AI@%reference.%@AE@%%@NL@%
  1044. ────────────────────────────────────────────────────────────────────────────%@NL@%%@NL@%
  1045. %@NL@%
  1046. %@NL@%
  1047. %@3@%%@CR:C6A00030007 @%%@AB@%Menus%@AE@%%@EH@%%@NL@%
  1048. %@NL@%
  1049. The menu bar contains ten menus, which you can pull down at any time. If you
  1050. don't know what a menu does, invoke the online help system by highlighting
  1051. the menu title (or highlighting a command within a menu) and pressing F1 or
  1052. clicking the right mouse button. QuickC uses the following menus:  %@NL@%
  1053. %@NL@%
  1054. %@TH:  85  5504 01 37 39 @%
  1055. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  1056. %@AU@%(Please refer to the printed book.)%@AE@%  The File menu controls files, 
  1057.                                      allowing you to clear the source 
  1058.                                      window (New), load an existing source
  1059.                                      file (Open), append a file to the 
  1060.                                      source code in memory (Merge), save 
  1061.                                      the current file (Save), rename the 
  1062.                                      current file (Save As), print the 
  1063.                                      source code (Print), temporarily quit
  1064.                                      to DOS (DOS Shell) and return to 
  1065.                                      QuickC by typing EXIT at the command 
  1066.                                      line, or permanently exit QuickC 
  1067.                                      (Exit).
  1068.  
  1069. %@AU@%(Please refer to the printed book.)%@AE@%  From the Edit menu you manipulate 
  1070.                                      text by deleting, cutting, copying, 
  1071.                                      and pasting lines of code. You can 
  1072.                                      also set Read Only status to protect 
  1073.                                      source files.
  1074.  
  1075. %@AU@%(Please refer to the printed book.)%@AE@%  The View menu controls the visible 
  1076.                                      screen. You can rapidly switch 
  1077.                                      between multiple modules (Source), 
  1078.                                      read through include files (Include) 
  1079.                                      make visible the output screen 
  1080.                                      (Output Screen), expand the source 
  1081.                                      window (Maximize), or open and close 
  1082.                                      the various windows (Windows).
  1083.  
  1084. %@AU@%(Please refer to the printed book.)%@AE@%  The Search menu invokes the commands 
  1085.                                      that find or replace text or 
  1086.                                      functions in source files. It also 
  1087.                                      moves to a specified line and 
  1088.                                      searches for the next source line 
  1089.                                      that caused a compiler error.
  1090.  
  1091. %@AU@%(Please refer to the printed book.)%@AE@%  The Make menu allows you to compile 
  1092.                                      (Compile) or to compile and link 
  1093.                                      (Build) programs. From this menu, you
  1094.                                      also create or edit program lists 
  1095.                                      that name the components of a 
  1096.                                      multimodule program.
  1097.  
  1098. %@AU@%(Please refer to the printed book.)%@AE@%  Once a program is compiled and 
  1099.                                      residing in memory, use the Run menu 
  1100.                                      to run it. You can run it from 
  1101.                                      beginning to end, selectively run 
  1102.                                      individual sections, or trace through
  1103.                                      the program line by line.
  1104.  
  1105. %@AU@%(Please refer to the printed book.)%@AE@%  If your program contains logic errors,
  1106.                                      the Debug menu allows you to set 
  1107.                                      breakpoints, watchpoints, and watch 
  1108.                                      values. In addition, you can keep 
  1109.                                      track of variables and their changing
  1110.                                      values. (This feature means there's 
  1111.                                      no need to sprinkle %@AB@%printf%@AE@% functions 
  1112.                                      throughout your program just to watch
  1113.                                      variables as they change values.)
  1114.  
  1115. %@AU@%(Please refer to the printed book.)%@AE@%  The Utility menu allows you to run 
  1116.                                      DOS commands and programs from within
  1117.                                      the QuickC environment. You can run 
  1118.                                      the online QuickC tutorial ("Learn 
  1119.                                      QuickC"), or if you find that you use
  1120.                                      certain programs often, you may want 
  1121.                                      to add them to the Utility menu 
  1122.                                      (Customize Menu). For example, you 
  1123.                                      can add your favorite program editor 
  1124.                                      to this menu if you wish.
  1125.  
  1126. %@AU@%(Please refer to the printed book.)%@AE@%  The items on the Options menu control
  1127.                                      the integrated environment. For 
  1128.                                      example, the Options menu Color 
  1129.                                      command allows you to change the 
  1130.                                      colors used on the screen. The 
  1131.                                      Options menu Make command controls 
  1132.                                      flags that affect the actions of the 
  1133.                                      compiler and linker.
  1134.  
  1135. %@AU@%(Please refer to the printed book.)%@AE@%  The Help menu is one route to the 
  1136.                                      online help system. For more about 
  1137.                                      this topic, see Chapter 4, "Getting 
  1138.                                      Help."
  1139.  
  1140. %@TE:  85  5504 01 37 39 @%
  1141.  
  1142. %@NL@%
  1143. %@4@%%@AB@%Short Menus and Full Menus%@AE@%%@EH@%%@NL@%
  1144. %@NL@%
  1145. If you open the Options menu, you'll see one of the two menus below:  %@NL@%
  1146. %@NL@%
  1147. %@TH:   2   220 01 37 39 @%
  1148. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  1149. %@AU@%(Please refer to the printed book.)%@AE@%  %@AU@%(Please refer to the printed book.)%@AE@%
  1150. %@TE:   2   220 01 37 39 @%
  1151.  
  1152. When six commands are listed under Options and a dot appears beside Full
  1153. Menus, it means full menus are turned on. When the Options menu holds only
  1154. two commands and Full Menus has no dot, short menus are in effect.  %@NL@%
  1155. %@NL@%
  1156. To change from full menus to short menus or vice versa, choose the Full
  1157. Menus command. The command is a toggle button; that is, it changes from on
  1158. to off, or off to on, when pressed.  %@NL@%
  1159. %@NL@%
  1160. The short menus contain all the commands you need to write, compile, and run
  1161. a C program. The short menus may seem easier to use, especially for
  1162. beginners. If you prefer to see every possible option, you should enable
  1163. Full Menus. The choice is yours.  %@NL@%
  1164. %@NL@%
  1165. ────────────────────────────────────────────────────────────────────────────%@NL@%
  1166. NOTE
  1167.  
  1168. %@AI@%When you set preferences from the Options menu─full menus, memory models,
  1169. %@AI@%compile options, and so on─your choices are saved in the current directory
  1170. %@AI@%in a file called QC.INI. If you set an option, it stays set from one QuickC
  1171. %@AI@%session to the next, or until you change it.%@AE@%%@NL@%
  1172. ────────────────────────────────────────────────────────────────────────────%@NL@%%@NL@%
  1173. %@NL@%
  1174. %@NL@%
  1175. %@4@%%@AB@%Shaded Commands%@AE@%%@EH@%%@NL@%
  1176. %@NL@%
  1177. When a command within a menu is shaded, it is unavailable. You can't use it.
  1178. %@NL@%
  1179. %@NL@%
  1180. For example, when you first run QuickC and haven't yet compiled or linked a
  1181. program, you can open the Search menu and see that both Next Error and
  1182. Previous Error are shaded. You haven't done anything to generate errors, so
  1183. there are no errors to view.  %@NL@%
  1184. %@NL@%
  1185. %@NL@%
  1186. %@4@%%@AB@%Ellipses%@AE@%%@EH@%%@NL@%
  1187. %@NL@%
  1188. When a command is followed by three periods (an ellipsis), it means QuickC
  1189. needs more information before it executes the command. If a command is not
  1190. followed by an ellipsis, choosing the command causes it to execute
  1191. immediately.  %@NL@%
  1192. %@NL@%
  1193. For example, the File menu contains both the Save and Save As... commands.
  1194. Choosing Save causes QuickC to save the current file with the current name
  1195. (the file name appearing at the top of the source window). Choosing Save
  1196. As... causes a dialog box to appear (see the following section). Within that
  1197. dialog box, you type the new name for your file.  %@NL@%
  1198. %@NL@%
  1199. %@NL@%
  1200. %@3@%%@CR:C6A00030008 @%%@AB@%Dialog Boxes%@AE@%%@EH@%%@NL@%
  1201. %@NL@%
  1202. Very often, invoking a menu command causes a dialog box to appear. For
  1203. example, Figure 3.2 shows the dialog box opened by the Options menu Display
  1204. command.  %@NL@%
  1205. %@NL@%
  1206. %@AU@%(This figure may be found in the printed book.)%@AE@%%@NL@%
  1207. %@NL@%
  1208. ────────────────────────────────────────────────────────────────────────────%@NL@%
  1209. NOTE
  1210.  
  1211. %@AI@%Dialog boxes usually offer a set of shortcut keys. Press %@AI@%ALT %@AE@%%@AI@%to see which
  1212. %@AI@%keys are active within a dialog box.%@AE@%%@AE@%%@NL@%
  1213. ────────────────────────────────────────────────────────────────────────────%@NL@%%@NL@%
  1214. %@NL@%
  1215. Dialog boxes can contain one or more of the items on the following list. Use
  1216. the TAB key to move between the various items in a dialog box.  %@NL@%
  1217. %@NL@%
  1218. Option Buttons ()                 Option buttons offer a list of choices, 
  1219.                                   of which you choose only one. Use the 
  1220.                                   arrow keys to move between the choices. 
  1221.                                   In Figure 3.2, four option buttons allow
  1222.                                   you to pick the screen color you prefer.
  1223.                                   These are sometimes called "radio 
  1224.                                   buttons" because they're similar to the 
  1225.                                   buttons on a car radio: pushing in one 
  1226.                                   button causes the others to pop out.
  1227.  
  1228. Check Box [X]                     A check box is a yes/no switch. If the 
  1229.                                   box is empty, the feature is turned off.
  1230.                                   If it contains a letter X, the feature 
  1231.                                   is on. Press the SPACEBAR to turn a 
  1232.                                   check box on or off. Use the TAB key to 
  1233.                                   move between check boxes.
  1234.  
  1235. Text Box [          ]             A text box contains text that you enter.
  1236.                                   In Figure 3.2, the setting for Tab Stops
  1237.                                   requires you to type in the number of 
  1238.                                   spaces to be inserted when you press the
  1239.                                   TAB key.
  1240.  
  1241. Command Buttons                   Command buttons enclosed in angle 
  1242. < OK >                            brackets pass commands to the dialog box.
  1243.                                   The OK button means you're satisfied 
  1244.                                   with the choices you've made. The Cancel
  1245.                                   button allows you to exit the dialog box
  1246.                                   with no changes. If one of the command 
  1247.                                   buttons is highlighted, pressing ENTER 
  1248.                                   invokes that command.
  1249.  
  1250. List Boxes                        Certain dialog boxes display the current
  1251.                                   disk directory inside a list box. If the
  1252.                                   number of files is too large for the 
  1253.                                   list box, you may use the arrow keys and
  1254.                                   PGUP/PGDN (keyboard) or click the scroll
  1255.                                   bar to move around the list (mouse).
  1256.  
  1257. %@NL@%
  1258. %@2@%%@CR:C6A00030009 @%%@AB@%Using the Editor%@AE@%%@EH@%%@NL@%
  1259. %@NL@%
  1260. QuickC's program editor is an important part of the QuickC environment. This
  1261. part of the chapter provides a brief overview of its many functions.  %@NL@%
  1262. %@NL@%
  1263. %@NL@%
  1264. %@3@%%@CR:C6A00030010 @%%@AB@%Moving Around in a Source File%@AE@%%@EH@%%@NL@%
  1265. %@NL@%
  1266. Many of the keys within the editor act as you would expect. The PGDN and
  1267. PGUP keys advance you forward or back within the source code. The HOME key
  1268. moves the cursor to the beginning of the current line. The END key moves the
  1269. cursor to the end of the current line. The arrow keys move the cursor one
  1270. character at a time. QuickC also has a command for moving around in a source
  1271. file: The Go to command in the Search menu moves the cursor to a specified
  1272. line number.  %@NL@%
  1273. %@NL@%
  1274. ────────────────────────────────────────────────────────────────────────────%@NL@%
  1275. NOTE
  1276.  
  1277. %@AI@%For a complete list of editor commands, use online help. Open the Help menu,
  1278. %@AI@%choose the Contents command, then get help about the Keyboard under the
  1279. %@AI@%Orientation heading.%@AE@%%@NL@%
  1280. ────────────────────────────────────────────────────────────────────────────%@NL@%%@NL@%
  1281. %@NL@%
  1282. You can invoke many of the editor commands in two different ways. For
  1283. example, to move one word to the right, you can press either CTRL+RIGHT or
  1284. CTRL+F. The second choice is part of the WordStar-compatible command set. If
  1285. you're familiar with WordStar commands, you already know how to use the
  1286. QuickC editor. There is one difference you should know: you don't use
  1287. separate commands to mark the beginning and end of a block of text.  %@NL@%
  1288. %@NL@%
  1289. %@NL@%
  1290. %@4@%%@AB@%Defining a Block%@AE@%%@EH@%%@NL@%
  1291. %@NL@%
  1292. While you're working on a C program, you may want to delete a large block of
  1293. text or copy it to another place in the program. To do this, you must define
  1294. the block:  %@NL@%
  1295. %@NL@%
  1296. Move the cursor to the beginning of the block. Hold down the SHIFT key and
  1297. move to the end of the block. Use the other editing keys (HOME, END,
  1298. CTRL+RIGHT, and so on) while you're holding down SHIFT to extend the block.
  1299. %@NL@%
  1300. %@NL@%
  1301. Move the mouse cursor to the beginning of the block. While holding down the
  1302. left button, move to the end of the block.  %@NL@%
  1303. %@NL@%
  1304. After defining a block, you can do several things: use the DELETE key to
  1305. erase it or use SHIFT+DEL to copy it into the Paste buffer (then use
  1306. SHIFT+INS to insert the buffer into the source file at the current cursor
  1307. location).  %@NL@%
  1308. %@NL@%
  1309. While a block is defined, anything you type will replace the defined text.  %@NL@%
  1310. %@NL@%
  1311. You can also press the TAB key to indent the entire block an additional tab
  1312. setting or SHIFT+TAB to remove all tab settings.  %@NL@%
  1313. %@NL@%
  1314. %@NL@%
  1315. %@3@%%@CR:C6A00030011 @%%@AB@%Customizing the Editor%@AE@%%@EH@%%@NL@%
  1316. %@NL@%
  1317. If you'd prefer to use another set of editing commands, QuickC comes with
  1318. four "key" files, which are files that define the keystrokes for editor
  1319. commands, along with a utility for making your own key file. The four key
  1320. files are QC.KEY, ME.KEY, BRIEF.KEY, and EPSILON.KEY. Refer to Appendix A
  1321. for a complete list of the commands they control (for example, the QuickC
  1322. and Microsoft editors use CTRL+E to move the cursor up, while Epsilon(tm)
  1323. uses CTRL+P).  %@NL@%
  1324. %@NL@%
  1325. To change to a new key file, use the /k: option when you run QuickC. For
  1326. example, to load the BRIEF.KEY file, enter this line, using just the file
  1327. name and not the fully qualified path:  %@NL@%
  1328. %@NL@%
  1329. %@AS@%  QC /k:BRIEF.KEY%@AE@%%@NL@%
  1330. %@NL@%
  1331. Your preference is automatically saved in the QC.INI file. In future editing
  1332. sessions, you won't need to specify the key file.  %@NL@%
  1333. %@NL@%
  1334. %@NL@%
  1335. %@4@%%@AB@%Creating Your Own Key File%@AE@%%@EH@%%@NL@%
  1336. %@NL@%
  1337. The MKKEY program allows you to make your own key file. You must use three
  1338. options: -c, -i, and -o. The first (-c) specifies the type of conversion:
  1339. ASCII to binary (ab) or binary to ASCII (ba). The two others specify the
  1340. input file (-i) and the output file (-o).  %@NL@%
  1341. %@NL@%
  1342. To modify the default QC.KEY file, you first convert it to an editable ASCII
  1343. file:  %@NL@%
  1344. %@NL@%
  1345. %@AS@%  MKKEY -c ba -i QC.KEY -o MYEDITOR.TXT%@AE@%%@NL@%
  1346. %@NL@%
  1347. You can use any text editor (including QuickC's) to edit the file named
  1348. MYEDITOR.TXT, which lists the keystrokes that perform certain actions. For
  1349. example, you press CTRL+G to delete a character. The line in MYEDITOR.TXT
  1350. looks like this:  %@NL@%
  1351. %@NL@%
  1352. %@AS@%  Del : CTRL+G%@AE@%%@NL@%
  1353. %@NL@%
  1354. You could change that command to any other keystroke (CTRL+D, for example),
  1355. as long as the key isn't already assigned to another function. Elsewhere in
  1356. the file, CTRL+D is assigned to CharRight, so you'd have to delete or change
  1357. that line if you wanted to use CTRL+D for the Del function.  %@NL@%
  1358. %@NL@%
  1359. When you're satisfied with the new functions, you must convert the ASCII
  1360. file to binary, so that it can be loaded into the QuickC editor:  %@NL@%
  1361. %@NL@%
  1362. %@AS@%  MKKEY -c ab -i MYEDITOR.TXT -o MYEDITOR.KEY%@AE@%%@NL@%
  1363. %@NL@%
  1364. Finally, to load the new key file, use the /k: option described above.  %@NL@%
  1365. %@NL@%
  1366. ────────────────────────────────────────────────────────────────────────────%@NL@%
  1367. NOTE
  1368.  
  1369. %@AI@%If you customize the QuickC editor by creating a key file, you are not
  1370. %@AI@%allowed to assign functions to CTRL+@%@AI@%.%@AE@%%@AE@%%@NL@%
  1371. ────────────────────────────────────────────────────────────────────────────%@NL@%%@NL@%
  1372. %@NL@%
  1373. %@NL@%
  1374. %@3@%%@CR:C6A00030012 @%%@AB@%Using Another Editor%@AE@%%@EH@%%@NL@%
  1375. %@NL@%
  1376. If you'd prefer to use your favorite word processor or text editor for
  1377. writing programs, use the Customize Menu command in the Utility menu. This
  1378. allows you to run any other program (including word processors) from within
  1379. the QuickC environment. When you exit the program, you'll return to QuickC.
  1380. %@NL@%
  1381. %@NL@%
  1382. To use another editor, choose the Customize Menu command in the Utility
  1383. menu. Highlight the Custom &Editor item and select the Edit button. List the
  1384. path and the name of the editor in the Path Name text box. (It isn't
  1385. necessary to include the .EXE extension.) For example, you could list
  1386. \BIN\B,\EDITORS\EPS or MYDIR\M. If you're using Brief, Epsilon, or the
  1387. Microsoft Editor, read the appropriate section below.  %@NL@%
  1388. %@NL@%
  1389. %@NL@%
  1390. %@4@%%@AB@%Brief%@AE@%%@EH@%%@NL@%
  1391. %@NL@%
  1392. Type the following in the Arguments text box:  %@NL@%
  1393. %@NL@%
  1394. %@AS@%  -m"editat $LINE $COL" $FILE%@AE@%%@NL@%
  1395. %@NL@%
  1396. Add the following macro to your Brief macro file:  %@NL@%
  1397. %@NL@%
  1398. %@AS@%  ;*** editat ─ interface to QC Utility.Edit menu
  1399. %@AS@%  ; SYNOPSIS
  1400. %@AS@%  ; b -m"editat $LINE $COL" $FILE
  1401. %@AS@%  ; DESCRIPTION
  1402. %@AS@%  ; editat positions Brief at the specified line and column in the
  1403. %@AS@%  ; current file.  It is invoked from the command line (i.e -m).
  1404. %@AS@%  ;*
  1405. %@AS@%  
  1406. %@AS@%  (macro editat
  1407. %@AS@%     (
  1408. %@AS@%        (int line col)
  1409. %@AS@%  
  1410. %@AS@%        (get_parm 0 line)
  1411. %@AS@%        (get_parm 1 col)
  1412. %@AS@%        (move_abs line col)
  1413. %@AS@%     )
  1414. %@AS@%  )%@AE@%%@NL@%
  1415. %@NL@%
  1416. %@NL@%
  1417. %@4@%%@AB@%Epsilon%@AE@%%@EH@%%@NL@%
  1418. %@NL@%
  1419. Type the following in the Arguments text box:  %@NL@%
  1420. %@NL@%
  1421. %@AS@%  $FILE +$LINE%@AE@%%@NL@%
  1422. %@NL@%
  1423. %@NL@%
  1424. %@4@%%@AB@%M Editor%@AE@%%@EH@%%@NL@%
  1425. %@NL@%
  1426. Type the following in the Arguments text box:  %@NL@%
  1427. %@NL@%
  1428. %@AS@%  /e "Arg \"$LINE\" Mark" $FILE%@AE@%%@NL@%
  1429. %@NL@%
  1430. %@NL@%
  1431. %@2@%%@CR:C6A00030013 @%%@AB@%Compiling and Linking%@AE@%%@EH@%%@NL@%
  1432. %@NL@%
  1433. Your ultimate goal in writing C programs is to create an executable program.
  1434. To convert a C source file to a runnable program, you must compile and link
  1435. it. This section introduces the commands that compile and link programs, a
  1436. process called "building."  %@NL@%
  1437. %@NL@%
  1438. When QuickC builds a program, it performs two steps:  %@NL@%
  1439. %@NL@%
  1440. %@NL@%
  1441.   1.  It compiles the .C source file into an object (.OBJ) file.%@NL@%
  1442. %@NL@%
  1443.   2.  It links the object file with other object files or libraries to
  1444.       create an executable (.EXE) file.%@NL@%
  1445. %@NL@%
  1446. %@NL@%
  1447. Although you have the option of going through these two steps, it's
  1448. generally easier and more convenient to build a program with a single
  1449. command.  %@NL@%
  1450. %@NL@%
  1451. %@NL@%
  1452. %@3@%%@CR:C6A00030014 @%%@AB@%Building within the QuickC Environment%@AE@%%@EH@%%@NL@%
  1453. %@NL@%
  1454. This section illustrates how to compile and link a C program. First, type in
  1455. this program and use the Save As command in the File menu to save the file
  1456. as HI.C:  %@NL@%
  1457. %@NL@%
  1458. %@AS@%  /* HI.C: Prints hello and a name */
  1459. %@AS@%  
  1460. %@AS@%  #include <stdio.h>
  1461. %@AS@%  
  1462. %@AS@%  main()
  1463. %@AS@%  {
  1464. %@AS@%     char name[80];
  1465. %@AS@%  
  1466. %@AS@%     printf( "Type your name, please.\n" );
  1467. %@AS@%     gets( name );
  1468. %@AS@%     printf( "Hello, %s\n", name );
  1469. %@AS@%  }%@AE@%%@NL@%
  1470. %@NL@%
  1471. The output of this simple program tells you to type your name. You enter any
  1472. string of characters, and it says hello to you.  %@NL@%
  1473. %@NL@%
  1474. The program calls two library functions: %@AB@%printf%@AE@% and %@AB@%gets%@AE@%. For more
  1475. information about what these functions do, use the online help system.
  1476. Position the cursor on the function name and press F1. To close the Help
  1477. window, press ESC. Online help is explained in greater detail in the next
  1478. chapter.  %@NL@%
  1479. %@NL@%
  1480. ────────────────────────────────────────────────────────────────────────────%@NL@%
  1481. NOTE
  1482.  
  1483. %@AI@%By default, QuickC names a new file UNTITLED.C. You should always explicitly
  1484. %@AI@%name your file before you compile.%@AE@%%@NL@%
  1485. ────────────────────────────────────────────────────────────────────────────%@NL@%%@NL@%
  1486. %@NL@%
  1487. %@NL@%
  1488. %@4@%%@AB@%Compiling and Linking%@AE@%%@EH@%%@NL@%
  1489. %@NL@%
  1490. To build a program, open the Make menu and choose Build Program. Or use one
  1491. of these shortcuts:  %@NL@%
  1492. %@NL@%
  1493. Press SHIFT+F5 to build the program.  %@NL@%
  1494. %@NL@%
  1495. Click the %@AS@%<Shift+F5=Restart>%@AE@% button on the reference bar at the bottom of
  1496. the screen.  %@NL@%
  1497. %@NL@%
  1498. A dialog box appears on the screen to show you how far the compiler and
  1499. linker have progressed. The compiler or linker may halt if anything goes
  1500. wrong. When the source file contains errors, the Errors window appears and
  1501. the offending line is highlighted in the source window.  %@NL@%
  1502. %@NL@%
  1503. Note that incremental linking uses expanded memory, as defined by the
  1504. Lotus-Intel-Microsoft (LIM) specification versions 3.2 and higher, if it is
  1505. available. If you have installed additional memory on an 80286 or 80386
  1506. system, you may encounter problems when linking incrementally, especially if
  1507. you have configured the board to use both extended and expanded memory. In
  1508. particular, your computer may lock up if you use incremental linking in
  1509. conjunction with a Talltrees AT3 expanded memory board. (Other boards may or
  1510. may not be subject to this problem.) If this happens, you have several
  1511. choices:  %@NL@%
  1512. %@NL@%
  1513. %@NL@%
  1514.   ■   Contact the manufacturer of the memory board for information on
  1515.       solving this problem.%@NL@%
  1516. %@NL@%
  1517.   ■   Remove the Expanded Memory Manager (EMM) device driver and continue to
  1518.       link incrementally.%@NL@%
  1519. %@NL@%
  1520.   ■   Disable extended memory (used by VDISK) and continue to link
  1521.       incrementally.%@NL@%
  1522. %@NL@%
  1523.   ■   Leave the memory device driver in place, but turn off incremental
  1524.       linking. From the QuickC environment, choose the Make command in the
  1525.       Options menu and select the Linker Flags button. From the command
  1526.       line, avoid the /Li option.%@NL@%
  1527. %@NL@%
  1528.   ■   Contact Microsoft Product Support for additional suggestions.%@NL@%
  1529. %@NL@%
  1530. %@NL@%
  1531. %@NL@%
  1532. %@4@%%@AB@%Running the Program%@AE@%%@EH@%%@NL@%
  1533. %@NL@%
  1534. When the program has been built, the reference bar displays several new
  1535. items, including %@AS@% <F5=Run>%@AE@%. To run the program, open the Run menu and choose
  1536. Go. Or use the shortcuts:  %@NL@%
  1537. %@NL@%
  1538. Press F5.  %@NL@%
  1539. %@NL@%
  1540. Click %@AS@% <F5=Run> %@AE@% on the reference bar.  %@NL@%
  1541. %@NL@%
  1542. %@NL@%
  1543. %@4@%%@AB@%Compiling, Linking, and Running%@AE@%%@EH@%%@NL@%
  1544. %@NL@%
  1545. It's not necessary to press SHIFT+F5 (to build the program) before you press
  1546. F5 (to run it). If you simply press F5, the QuickC editor knows if the
  1547. source code in memory has changed. If it %@AI@%has%@AE@% changed, you'll be asked if you
  1548. want to rebuild the program.  %@NL@%
  1549. %@NL@%
  1550. %@NL@%
  1551. %@4@%%@AB@%Viewing the Output Window%@AE@%%@EH@%%@NL@%
  1552. %@NL@%
  1553. When you choose Go from the Run menu (or press F5), the output is
  1554. automatically directed to the output screen. To see this output:  %@NL@%
  1555. %@NL@%
  1556. Press F4 to toggle between the two screens.  %@NL@%
  1557. %@NL@%
  1558. Open the View window and choose Output Screen. Click once to return to the
  1559. source window.  %@NL@%
  1560. %@NL@%
  1561. If you'd prefer to have both the Output and source windows visible at the
  1562. same time, choose the Windows command from the View menu and then choose
  1563. Output.  %@NL@%
  1564. %@NL@%
  1565. %@NL@%
  1566. %@4@%%@AB@%Saving the Program%@AE@%%@EH@%%@NL@%
  1567. %@NL@%
  1568. To save the source file using the current name, go to the File menu and
  1569. choose either Save or Save As. If you use Save, QuickC automatically saves
  1570. the file under the name listed on the top line of the source window. If you
  1571. prefer to use another name, choose Save As. The following dialog box
  1572. appears:  %@NL@%
  1573. %@NL@%
  1574. %@AU@%(This figure may be found in the printed book.)%@AE@%%@NL@%
  1575. %@NL@%
  1576. Type in the new name of the source file. If you don't add an extension,
  1577. QuickC automatically adds .C (HI becomes HI.C, for example).  %@NL@%
  1578. %@NL@%
  1579. %@NL@%
  1580. %@3@%%@CR:C6A00030015 @%%@AB@%Building from Multiple Source Files%@AE@%%@EH@%%@NL@%
  1581. %@NL@%
  1582. Now we'll make things a little more complicated by writing a multiple-module
  1583. program.  %@NL@%
  1584. %@NL@%
  1585. First, edit the HI.C program, adding a few lines:  %@NL@%
  1586. %@NL@%
  1587. %@AS@%  /* HIA.C: Illustrates external functions */
  1588. %@AS@%  
  1589. %@AS@%  #include <stdio.h>
  1590. %@AS@%  
  1591. %@AS@%  main()
  1592. %@AS@%  {
  1593. %@AS@%     char name[80];
  1594. %@AS@%  
  1595. %@AS@%     welcome();
  1596. %@AS@%     outsider();
  1597. %@AS@%     printf( "Type your name, please.\n" );
  1598. %@AS@%     gets( name );
  1599. %@AS@%     printf( "Hello, %s\n", name );
  1600. %@AS@%  }
  1601. %@AS@%  welcome()
  1602. %@AS@%  {
  1603. %@AS@%     printf( "Welcome to the program.\n" );
  1604. %@AS@%  }%@AE@%%@NL@%
  1605. %@NL@%
  1606. The %@AS@% main %@AE@% function calls two new functions: %@AS@% welcome %@AE@% and %@AS@% outsider%@AE@%. Unlike
  1607. %@AS@% printf %@AE@% and %@AS@% gets%@AE@%, which are library functions, %@AS@% welcome %@AE@% and %@AS@%outsider%@AE@% are
  1608. functions defined within the program. Note the definition of %@AS@% welcome %@AE@% below
  1609. the %@AS@% main %@AE@% function.  %@NL@%
  1610. %@NL@%
  1611. Don't compile the program yet. Save it as HIA.C and then choose New from the
  1612. File menu. Type in this second program:  %@NL@%
  1613. %@NL@%
  1614. %@AS@%  /* HIB.C: Second program for HIA.C */
  1615. %@AS@%  
  1616. %@AS@%  outsider()
  1617. %@AS@%  {
  1618. %@AS@%     printf( "This line is from the HIB.C file.\n" );
  1619. %@AS@%  }%@AE@%%@NL@%
  1620. %@NL@%
  1621. Save it as HIB.C. Now there are two source files on your disk: HIA.C and
  1622. HIB.C.  %@NL@%
  1623. %@NL@%
  1624. There are several reasons to split a file into multiple modules. If you
  1625. write a function that's used in several programs, you can give it its own
  1626. source file. If you write long programs, splitting the file up makes editing
  1627. easier. In addition, the Build Program command takes less time because it
  1628. recompiles only the source files you've changed, instead of the entire
  1629. program.  %@NL@%
  1630. %@NL@%
  1631. %@NL@%
  1632. %@4@%%@AB@%Creating a Program List%@AE@%%@EH@%%@NL@%
  1633. %@NL@%
  1634. Since the example program now uses two source files, we must create a
  1635. program list (also called a "make file") that tells QuickC which source
  1636. files should be compiled.  %@NL@%
  1637. %@NL@%
  1638. Open the Make menu and choose Set Program List (you must have Full Menus
  1639. enabled). Type the name HIA.MAK as the name of the file containing the
  1640. program list (the MAK extension is used for make files), and when QuickC
  1641. asks if it should create the file, press ENTER.  %@NL@%
  1642. %@NL@%
  1643. The following dialog box appears:  %@NL@%
  1644. %@NL@%
  1645. %@AU@%(This figure may be found in the printed book.)%@AE@%%@NL@%
  1646. %@NL@%
  1647. Now you must add both HIA.C and HIB.C to the list of programs.  %@NL@%
  1648. %@NL@%
  1649. Press TAB until the cursor is within the list box containing the directory
  1650. of C source files (another list box lists the directory names). Use the
  1651. arrow keys to move to the HIA.C file. Press ENTER and the file name will
  1652. appear in the program list below. Repeat this action to add HIB.C to the
  1653. program list. (A second option is to type the file names in the text box at
  1654. the top of the screen.) When you're finished, press TAB until the Save List
  1655. command button is highlighted, and then press ENTER.  %@NL@%
  1656. %@NL@%
  1657. Click HIA.C once and click the Add/Delete button (or just double-click
  1658. HIA.C). Do the same for HIB.C. When both programs appear in the program
  1659. list, click the Save List command button to save the make file.  %@NL@%
  1660. %@NL@%
  1661. This program list tells QuickC that several source files are to be combined
  1662. into one program.  %@NL@%
  1663. %@NL@%
  1664. ────────────────────────────────────────────────────────────────────────────%@NL@%
  1665. NOTE
  1666.  
  1667. %@AI@%Within a program list, you can include source files (ending with the .C
  1668. %@AI@%extension), object files (.OBJ), or libraries (.LIB). For example, if you
  1669. %@AI@%didn't include graphics in the combined library when you ran the SETUP
  1670. %@AI@%program, you can place GRAPHICS.LIB in the program list to gain access to
  1671. %@AI@%graphics functions.%@AE@%%@NL@%
  1672. ────────────────────────────────────────────────────────────────────────────%@NL@%%@NL@%
  1673. %@NL@%
  1674. Notice that the base name of the program list (HIA.MAK) matches the name of
  1675. one of the source files (HIA.C). Because the names match, when you load
  1676. HIA.C in the future, QuickC will ask if you wish to use the program list
  1677. HIA.MAK. You don't have to give the source file and the make file the same
  1678. names, but it's a good idea to do so.  %@NL@%
  1679. %@NL@%
  1680. The order that you list the files is inconsequential. It doesn't matter
  1681. which file is first or second.  %@NL@%
  1682. %@NL@%
  1683. When you choose the Rebuild All command from the Make menu, every .C file in
  1684. the program list is compiled into a .OBJ file. Then all of the .OBJ files
  1685. are linked with .LIB files to create one .EXE file.  %@NL@%
  1686. %@NL@%
  1687. However, if you press SHIFT+F5 or choose the Build Program command, QuickC
  1688. checks the time and date stamps on the source and object files. If the
  1689. source code has not changed since the last time a Build Program command
  1690. executed, there's no need to recompile the unchanged .OBJ files. Any files
  1691. that have changed are recompiled; the others are not. This means the Build
  1692. command is often faster than the Rebuild All command when you have multiple
  1693. source files.  %@NL@%
  1694. %@NL@%
  1695. %@NL@%
  1696. %@4@%%@AB@%About Directories%@AE@%%@EH@%%@NL@%
  1697. %@NL@%
  1698. You can change directories whenever you open or save a file:  %@NL@%
  1699. %@NL@%
  1700. Press TAB until the cursor is within the Drives/Dirs: list box containing
  1701. the directory names (see Figure 3.4). Use the arrow keys to move to the
  1702. desired directory, and press ENTER.  %@NL@%
  1703. %@NL@%
  1704. Double-click the name of the desired directory.  %@NL@%
  1705. %@NL@%
  1706. To move to the parent directory, select the two periods (..) at the top of
  1707. the list.  %@NL@%
  1708. %@NL@%
  1709. When you exit QuickC, you return to the directory you started (the default
  1710. directory), regardless of how many other directories you may have accessed.
  1711. %@NL@%
  1712. %@NL@%
  1713. QuickC puts all object (.OBJ) files and executable (.EXE) files in the
  1714. default directory. For example, suppose you run QuickC from the C:\ZEBRA
  1715. directory and open the file TAPIR.C from the C:\AARDVARK directory. Because
  1716. ZEBRA is the default directory, the files TAPIR.OBJ and TAPIR.EXE are
  1717. created in the ZEBRA directory when you compile the program. If you prefer
  1718. to keep all related files in the AARDVARK directory, choose the Run DOS
  1719. Command from the Utility menu and type  %@NL@%
  1720. %@NL@%
  1721. %@AS@%  CHDIR \AARDVARK%@AE@%%@NL@%
  1722. %@NL@%
  1723. The CHDIR directory command redirects the object and executable files to the
  1724. other directory.  %@NL@%
  1725. %@NL@%
  1726. %@NL@%
  1727. %@3@%%@CR:C6A00030016 @%%@AB@%Compiling and Linking from the Command Line%@AE@%%@EH@%%@NL@%
  1728. %@NL@%
  1729. If you're new to the C language, you can skip this section. You don't need
  1730. to know how to compile and link from the command line; you can do everything
  1731. within the QuickC environment.  %@NL@%
  1732. %@NL@%
  1733. However, if you want to, you can exit the QuickC environment to build
  1734. programs from the DOS prompt. This gives you slightly more control over the
  1735. various options. In addition, if you're building a series of related
  1736. executable programs, you can either put the compile and link commands in a
  1737. batch file or create your own make file. Either method is faster than
  1738. building programs individually.  %@NL@%
  1739. %@NL@%
  1740. The program that builds from the command line is called QCL.EXE (the C and L
  1741. in the file name stand for "Compile" and "Link"). To build the HI.EXE
  1742. program, type this:  %@NL@%
  1743. %@NL@%
  1744. %@AS@%  QCL HI.C%@AE@%%@NL@%
  1745. %@NL@%
  1746. You can include a variety of command-line options between QCL and the file
  1747. name. For example,  %@NL@%
  1748. %@NL@%
  1749. %@AS@%  QCL /AM HI.C%@AE@%%@NL@%
  1750. %@NL@%
  1751. forces the linker to use the medium memory model (the default is the small
  1752. model). If you try this example, you must have a medium memory model library
  1753. installed. You will find a complete list of compiler and linker options in
  1754. the %@AI@%Microsoft QuickC Tool Kit%@AE@% manual (or type %@AS@% QCL /help%@AE@%).  %@NL@%
  1755. %@NL@%
  1756. QCL can also build multiple-module programs. Since HIA.C and HIB.C are two
  1757. parts of a multiple-module program, the following line does %@AI@%not%@AE@% build a
  1758. program:  %@NL@%
  1759. %@NL@%
  1760. %@AS@%  QCL HIA.C%@AE@%%@NL@%
  1761. %@NL@%
  1762. The compiler works correctly, creating a .OBJ file, but when the linker
  1763. looks for the %@AS@% outsider %@AE@% function (which is in HIB.C), it fails and returns
  1764. the error %@AS@%unresolved external%@AE@%.  %@NL@%
  1765. %@NL@%
  1766. One solution is to specify both source files:  %@NL@%
  1767. %@NL@%
  1768. %@AS@%  QCL HIA.C HIB.C%@AE@%%@NL@%
  1769. %@NL@%
  1770. The example above builds a program called HIA.EXE because HIA.C is listed
  1771. first.  %@NL@%
  1772. %@NL@%
  1773. Another solution is to compile the two files and then link them yourself:  %@NL@%
  1774. %@NL@%
  1775. %@AS@%  QCL /c HIA.C
  1776. %@AS@%  QCL /c HIB.C
  1777. %@AS@%  QLINK HIA.OBJ HIB.OBJ%@AE@%%@NL@%
  1778. %@NL@%
  1779. The /c option tells the QCL program to compile but not link. It must be
  1780. entered as a lowercase character.  %@NL@%
  1781. %@NL@%
  1782. Since you created a make file called HIA.MAK, which contained the program
  1783. list, you can also use the NMAKE program to build HIA.EXE. Simply pass it
  1784. the name of the make file:  %@NL@%
  1785. %@NL@%
  1786. %@AS@%  NMAKE /F HIA.MAK%@AE@%%@NL@%
  1787. %@NL@%
  1788. For a complete list of compiler, linker, and NMAKE options, see %@AI@%Microsoft
  1789. %@AI@%QuickC Tool Kit%@AE@%.  %@NL@%
  1790. %@NL@%
  1791. The -qc option allows you to run the QuickC compiler from Microsoft C
  1792. Professional Development System version 6.0. To use the QuickC compiler from
  1793. Microsoft C use the command line  %@NL@%
  1794. %@NL@%
  1795. %@AS@%  CL = B1 qccom -qc%@AE@%%@NL@%
  1796. %@NL@%
  1797. QuickC ships with the QLINK linker, a subset of LINK.  %@NL@%
  1798. %@NL@%
  1799. %@NL@%
  1800. %@2@%%@CR:C6A00030017 @%%@AB@%The Debugger%@AE@%%@EH@%%@NL@%
  1801. %@NL@%
  1802. When you make obvious mistakes like misspelling a function name or
  1803. forgetting to end a line with a semicolon, your code causes a compile-time
  1804. error. The compiler (or linker) refuses to continue until you fix the
  1805. mistake.  %@NL@%
  1806. %@NL@%
  1807. Other mistakes cause run-time errors. Attempting to divide by zero is one
  1808. such example.  %@NL@%
  1809. %@NL@%
  1810. Still other mistakes are called logic errors. When a program includes a
  1811. logic error, it may run, but it eventually acts unpredictably or yields
  1812. incorrect results.  %@NL@%
  1813. %@NL@%
  1814. QuickC's built-in debugger helps you track down and correct logic errors. In
  1815. the Run menu, you'll find Trace Into and Step Over, which execute the
  1816. program in memory line by line. Trace Into follows functions when they're
  1817. called; Step Over lets you execute a function without showing its inner
  1818. workings.  %@NL@%
  1819. %@NL@%
  1820. You can use the Debug menu to set watchpoints and breakpoints and run a
  1821. program up to the breakpoint.  %@NL@%
  1822. %@NL@%
  1823. The Watch Value command from the Debug menu is also useful. You enter one or
  1824. more variable names and then monitor their values as you step through the
  1825. program. There's no need to place %@AB@%printf%@AE@% statements at various points in a
  1826. program just to monitor the value of a variable. The Quickwatch command
  1827. gives you even faster access to variables or expressions you want to watch.
  1828. %@NL@%
  1829. %@NL@%
  1830. If you turn on Debugging History, the debugger records everything that
  1831. happens during the session. Later, you can review the events and watch for
  1832. the logic error.  %@NL@%
  1833. %@NL@%
  1834. The online tutorial includes a lesson explaining how to use the debugger,
  1835. with a special section devoted to using Debugging History. If you're
  1836. interested in exploring this topic, run the LEARN program from the command
  1837. line or choose the Learn QuickC command from the Utility menu. You can also
  1838. consult online help for detailed information about the debugger.  %@NL@%
  1839. %@NL@%
  1840. ────────────────────────────────────────────────────────────────────────────%@NL@%
  1841. IMPORTANT
  1842.  
  1843. %@AI@%The CodeView debugger cannot handle files that have been incrementally
  1844. %@AI@%compiled or incrementally linked. If you plan to examine QuickC programs
  1845. %@AI@%with CodeView, be sure the incremental compiling and linking options are
  1846. %@AI@%turned off. From the command line, use QCL without the /Gi or /Li options.
  1847. %@AI@%From the QuickC environment, use the Make command from the Options menu to
  1848. %@AI@%turn off incremental compiling and linking and to turn on CodeView info.
  1849. %@AI@%This restriction applies only to CodeView. QuickC's built-in debugger can
  1850. %@AI@%handle incrementally compiled and linked programs.%@AE@%%@NL@%
  1851. ────────────────────────────────────────────────────────────────────────────%@NL@%%@NL@%
  1852. %@NL@%
  1853. %@NL@%
  1854. %@NL@%
  1855. %@NL@%
  1856. %@NL@%
  1857. %@NL@%
  1858. %@CR:C6A00040001 @%%@1@%%@AB@%Chapter 4  Getting Help%@AE@%%@EH@%%@NL@%
  1859. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  1860. %@NL@%
  1861. The QuickC Compiler environment offers a complete online reference system
  1862. called the Microsoft Advisor. The Microsoft Advisor provides information on
  1863. the C language, run-time libraries, and utilities provided with QuickC.  %@NL@%
  1864. %@NL@%
  1865. The first section of this chapter, "Structure of the Microsoft Advisor,"
  1866. outlines the structure and contents of the help database. The second
  1867. section, "Navigating through the Microsoft Advisor," takes you on a quick
  1868. tour of the system.  %@NL@%
  1869. %@NL@%
  1870. %@NL@%
  1871. %@2@%%@CR:C6A00040002 @%%@AB@%Structure of the Microsoft Advisor%@AE@%%@EH@%%@NL@%
  1872. %@NL@%
  1873. The Microsoft Advisor can be compared to a librarian managing a collection
  1874. of books. Each book, or help file, has its own table of contents, index, and
  1875. pages of information. The Advisor organizes the books with an overall table
  1876. of contents and index. All of the books are listed, and their specific
  1877. tables of contents and indexes can be accessed through the overall
  1878. references. The global contents screen is shown in Figure 4.1.  %@NL@%
  1879. %@NL@%
  1880. %@AU@%(This figure may be found in the printed book.)%@AE@%%@NL@%
  1881. %@NL@%
  1882. You can access a variety of information from the online reference system.
  1883. Information regarding the C language, run-time libraries, errors, and the
  1884. reference system itself can all be displayed.  %@NL@%
  1885. %@NL@%
  1886. %@NL@%
  1887. %@2@%%@CR:C6A00040003 @%%@AB@%Navigating through the Microsoft Advisor%@AE@%%@EH@%%@NL@%
  1888. %@NL@%
  1889. You request information about a topic in a window by positioning the cursor
  1890. over it and pressing F1. The help system then searches through the help
  1891. files for information about the topic. If it finds the topic, the help
  1892. system displays information in the Help window. If help cannot be found for
  1893. a particular word or symbol, a message informs you that no information is
  1894. associated with the topic. Sometimes, a topic with the same name occurs in
  1895. several help files. In such cases, a dialog box is displayed in which you
  1896. can select the context of the topic.  %@NL@%
  1897. %@NL@%
  1898. %@NL@%
  1899. %@3@%%@CR:C6A00040004 @%%@AB@%Using the Help Menu%@AE@%%@EH@%%@NL@%
  1900. %@NL@%
  1901. The simplest method for accessing the online reference is with the commands
  1902. found in the Help menu. All of these commands present information in the
  1903. Help window.  %@NL@%
  1904. %@NL@%
  1905. %@AB@%Command%@AE@%                           %@AB@%Description%@AE@%
  1906. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  1907. Index                             Displays the alphabetical index of 
  1908.                                   help-file categories (see Figure 4.2).
  1909.  
  1910. Contents                          Displays the global contents screen for 
  1911.                                   the categories found in the help files.
  1912.  
  1913. Topic:                            Provides information about the topic 
  1914.                                   that the cursor is currently positioned 
  1915.                                   over. If information about the topic is 
  1916.                                   available, the topic's name is appended 
  1917.                                   to the Topic: command. Otherwise, this 
  1918.                                   menu option is grayed.
  1919.  
  1920. Help on Help                      Displays information about using the 
  1921.                                   online reference itself.
  1922.  
  1923. %@AU@%(This figure may be found in the printed book.)%@AE@%%@NL@%
  1924. %@NL@%
  1925. ────────────────────────────────────────────────────────────────────────────%@NL@%
  1926. NOTE
  1927.  
  1928. %@AI@%SHIFT+F1%@AI@% is the shortcut key for the Help on Help menu command. If you have
  1929. %@AI@%a terminate-and-stay-resident (TSR) utility such as the Norton Guides%@AE@%%@AI@%(tm)%@AE@%%@AI@%
  1930. %@AI@%installed and you invoke that program with SHIFT+F1%@AE@%%@AI@%, then you can't use
  1931. %@AI@%SHIFT+F1%@AE@%%@AI@% as a shortcut to Help on Help. Choose Help on Help from the Help
  1932. %@AI@%menu instead, or change the key that invokes the TSR.%@AE@%%@AE@%%@NL@%
  1933. ────────────────────────────────────────────────────────────────────────────%@NL@%%@NL@%
  1934. %@NL@%
  1935. %@NL@%
  1936. %@3@%%@CR:C6A00040005 @%%@AB@%Using the F1 Key%@AE@%%@EH@%%@NL@%
  1937. %@NL@%
  1938. You can use the F1 key to get information about any menu command or QuickC
  1939. dialog box, as well as information on C keywords, operators, and library
  1940. functions.  %@NL@%
  1941. %@NL@%
  1942. %@NL@%
  1943. %@4@%%@AB@%Menu Help%@AE@%%@EH@%%@NL@%
  1944. %@NL@%
  1945. To view information about a menu item, first pull down the menu, then  %@NL@%
  1946. %@NL@%
  1947. Use the cursor keys to highlight the command and press F1.  %@NL@%
  1948. %@NL@%
  1949. Move the mouse cursor on the command and click the Right mouse button.  %@NL@%
  1950. %@NL@%
  1951. Figure 4.3 shows the help information for the Cut command in the Edit menu.
  1952. %@NL@%
  1953. %@NL@%
  1954. %@AU@%(This figure may be found in the printed book.)%@AE@%%@NL@%
  1955. %@NL@%
  1956. %@NL@%
  1957. %@4@%%@AB@%Keyword and Library-Function Help%@AE@%%@EH@%%@NL@%
  1958. %@NL@%
  1959. To view information about a C keyword, operator, or run-time library
  1960. function,  %@NL@%
  1961. %@NL@%
  1962. Put the cursor on the keyword or function name and press F1.  %@NL@%
  1963. %@NL@%
  1964. Click on the command with the Right mouse button.  %@NL@%
  1965. %@NL@%
  1966. %@NL@%
  1967. %@4@%%@AB@%Dialog-Box Help%@AE@%%@EH@%%@NL@%
  1968. %@NL@%
  1969. To view information about a QuickC dialog box, simply press F1 while the
  1970. dialog box is displayed, or click on the Help button.  %@NL@%
  1971. %@NL@%
  1972. %@NL@%
  1973. %@3@%%@CR:C6A00040006 @%%@AB@%Using Hyperlinks%@AE@%%@EH@%%@NL@%
  1974. %@NL@%
  1975. Hyperlinks are cross-references that connect related topic information.  %@NL@%
  1976. %@NL@%
  1977. Hyperlinks enclosed by the < and > characters are called "buttons." Navigate
  1978. through the online help system by using these buttons.  %@NL@%
  1979. %@NL@%
  1980. You can press TAB to move to the next hyperlink button within the current
  1981. help window. SHIFT+TAB moves back to the previous button. Typing any letter
  1982. moves the cursor to the next button that begins with the letter; holding
  1983. SHIFT down and typing a letter moves the cursor backward.  %@NL@%
  1984. %@NL@%
  1985. The Microsoft Advisor also recognizes C keywords, library functions,
  1986. constants defined by QuickC, and similar identifiers as hyperlinks, but they
  1987. are unmarked hyperlinks. Unmarked hyperlinks are recognized by the Microsoft
  1988. Advisor wherever they appear in the help-information text or %@AI@%in your source
  1989. %@AI@%code%@AE@%. However, an unmarked hyperlink is not delimited with the < and >
  1990. characters, and you can't move to it with the TAB key. An unmarked hyperlink
  1991. can only be executed by placing the cursor on it and pressing F1, or
  1992. pointing to it with the mouse cursor and clicking the Right mouse button.  %@NL@%
  1993. %@NL@%
  1994. You can access a hyperlink in several ways. First move either the mouse or
  1995. text cursor to a hyperlink, then  %@NL@%
  1996. %@NL@%
  1997. Press F1.  %@NL@%
  1998. %@NL@%
  1999. Click the Left mouse button twice (double-click). Then click the Right mouse
  2000. button once.  %@NL@%
  2001. %@NL@%
  2002. Highlighted button hyperlinks can also be executed by pressing ENTER or the
  2003. SPACEBAR.  %@NL@%
  2004. %@NL@%
  2005. Any of these actions displays information about the topic the cursor is
  2006. positioned on. If the topic isn't a hyperlink, a message informs you that no
  2007. information on the topic could be found.  %@NL@%
  2008. %@NL@%
  2009. %@NL@%
  2010. %@3@%%@CR:C6A00040007 @%%@AB@%Using Help Windows and Dialog Boxes%@AE@%%@EH@%%@NL@%
  2011. %@NL@%
  2012. The Microsoft Advisor displays information in windows or dialog boxes. Help
  2013. windows and dialog boxes function the same as other QuickC windows and
  2014. dialog boxes. For a complete description of windows and dialog boxes, refer
  2015. to Chapter 3, "Using QuickC."  %@NL@%
  2016. %@NL@%
  2017. %@NL@%
  2018. %@4@%%@AB@%Using the Help Window%@AE@%%@EH@%%@NL@%
  2019. %@NL@%
  2020. The help window displays various contents, indexes, and information about
  2021. selected topics. Some screens of information are larger than the help
  2022. window; information beyond the window borders can be viewed by using the
  2023. scroll bars or the arrow keys. The  -  -  symbol indicates the end of
  2024. information in the help  window.  %@NL@%
  2025. %@NL@%
  2026. %@NL@%
  2027. %@4@%%@AB@%Navigating with Hyperlink Buttons%@AE@%%@EH@%%@NL@%
  2028. %@NL@%
  2029. At the top of the Help window is a group of hyperlink buttons that are
  2030. useful for moving through the reference system:  %@NL@%
  2031. %@NL@%
  2032. %@AB@%Button%@AE@%                            %@AB@%Description%@AE@%
  2033. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  2034. < Up >                            Moves upward in the hierarchy of help 
  2035.                                   screens. Since information is ordered in
  2036.                                   a logical way, moving from the general 
  2037.                                   to the specific, this command is useful 
  2038.                                   for moving up the information tree.
  2039.  
  2040. < Contents >                      Displays the global contents screen. 
  2041.                                   This command is useful because it always
  2042.                                   returns you to a known point in the 
  2043.                                   online help system hierarchy.
  2044.  
  2045. < Index >                         Displays the index list. Selecting a 
  2046.                                   letter from the list displays the index 
  2047.                                   for entries beginning with that
  2048.                                   letter.
  2049.  
  2050. < Back >                          Moves you to the last online help screen
  2051.                                   you saw.
  2052.  
  2053. Screens on a particular topic frequently are physically grouped together in
  2054. a help file. You can press CTRL+F1 to display information about the next
  2055. physical topic in the help file.  %@NL@%
  2056. %@NL@%
  2057. %@NL@%
  2058. %@4@%%@AB@%Viewing the Previous Help Screen%@AE@%%@EH@%%@NL@%
  2059. %@NL@%
  2060. The Microsoft Advisor remembers the last 20 help screens you've accessed. To
  2061. return to a previous screen, use the "Back" button or hold down the ALT key
  2062. and press F1 as many times as necessary to return to the screen you want to
  2063. see. The help screen that appears is active; you can ask for help on any of
  2064. its hyperlinks or topics.  %@NL@%
  2065. %@NL@%
  2066. You can always return to the global contents screen by pressing SHIFT+F1.  %@NL@%
  2067. %@NL@%
  2068. %@NL@%
  2069. %@4@%%@AB@%Copying and Pasting Information%@AE@%%@EH@%%@NL@%
  2070. %@NL@%
  2071. Any text that appears in the help window can easily be copied to another
  2072. window. For example, to test an example program from the help window, you
  2073. only have to copy it to the source window and compile it.  %@NL@%
  2074. %@NL@%
  2075. To copy and paste with the keyboard, follow these steps:  %@NL@%
  2076. %@NL@%
  2077. %@NL@%
  2078.   1.  Move the cursor to the beginning or the end of the text you want to
  2079.       select. Hold down the SHIFT key and move the cursor to the other end
  2080.       of the text. The text is now highlighted.%@NL@%
  2081. %@NL@%
  2082.   2.  Execute the Copy command: press ALT to activate the menus, E for Edit,
  2083.       then C for Copy. Note that the menu lists the shortcut command
  2084.       (CTRL+INS), which can be substituted for ALT+E, then C.%@NL@%
  2085. %@NL@%
  2086.   3.  Press F6 to switch to another window. Position the cursor where you
  2087.       want to insert the text, and execute the Paste command: ALT+E, then P,
  2088.       or use the SHIFT+INS shortcut. The text from the help window is
  2089.       inserted at the current cursor position.%@NL@%
  2090. %@NL@%
  2091. %@NL@%
  2092. To copy and paste using the mouse, follow these steps:  %@NL@%
  2093. %@NL@%
  2094. %@NL@%
  2095.   1.  Click the Left mouse button and drag the cursor (hold the button down
  2096.       while moving the mouse) to select the text you want to copy.%@NL@%
  2097. %@NL@%
  2098.   2.  Choose Copy from the Edit menu (or press CTRL+INS).%@NL@%
  2099. %@NL@%
  2100.   3.  Move the mouse cursor to the location where you want to insert the
  2101.       text, and click once. Then choose Paste from the Edit menu. The text
  2102.       from the help window is inserted at the current cursor position.%@NL@%
  2103. %@NL@%
  2104. %@NL@%
  2105. %@NL@%
  2106. %@4@%%@AB@%Closing the Help Window%@AE@%%@EH@%%@NL@%
  2107. %@NL@%
  2108. Once you're through working with the online reference system, close the
  2109. active help window and return to the source window:  %@NL@%
  2110. %@NL@%
  2111. Press ESC.  %@NL@%
  2112. %@NL@%
  2113. Click the Close button in the upper left corner of the window with the Left
  2114. mouse button.  %@NL@%
  2115. %@NL@%
  2116. %@NL@%
  2117. %@4@%%@AB@%Using Help Dialog Boxes%@AE@%%@EH@%%@NL@%
  2118. %@NL@%
  2119. Help dialog boxes contain information about menu commands and their dialog
  2120. boxes. A help dialog box differs from a help window in that it is displayed
  2121. over the source window and any other windows that are displayed. Unlike the
  2122. help window, a help dialog box must be closed before you can execute any
  2123. menu commands. The Cancel button in the lower right portion of the dialog
  2124. box closes the help dialog box.  %@NL@%
  2125. %@NL@%
  2126. To view information about any QuickC dialog box, you can  %@NL@%
  2127. %@NL@%
  2128. Press F1.  %@NL@%
  2129. %@NL@%
  2130. Click the Help button in the dialog box with the Left mouse button.  %@NL@%
  2131. %@NL@%
  2132. Either of these commands causes a help dialog box to appear. To close a help
  2133. dialog box,  %@NL@%
  2134. %@NL@%
  2135. Press F1.  %@NL@%
  2136. %@NL@%
  2137. Click the dialog box's Cancel button by using the Left mouse button.  %@NL@%
  2138. %@NL@%
  2139. %@NL@%
  2140. %@3@%%@CR:C6A00040008 @%%@AB@%Accessing Different Types of Information%@AE@%%@EH@%%@NL@%
  2141. %@NL@%
  2142. This section presents some strategies for accessing the different types of
  2143. information available within the online reference system.  %@NL@%
  2144. %@NL@%
  2145. %@NL@%
  2146. %@4@%%@AB@%Keyword Information%@AE@%%@EH@%%@NL@%
  2147. %@NL@%
  2148. To get information about any keyword, operator, symbolic constant, or
  2149. library function, go to the index, select the keyword's first letter, then
  2150. scroll down the list of entries and select the topic hyperlink. If you know
  2151. the exact name of a keyword, it is often quicker to simply type it in the
  2152. source window and press F1 than to locate it through an index.  %@NL@%
  2153. %@NL@%
  2154. Figure 4.4 shows the information screen for the %@AB@%printf%@AE@% function.  %@NL@%
  2155. %@NL@%
  2156. %@AU@%(This figure may be found in the printed book.)%@AE@%%@NL@%
  2157. %@NL@%
  2158. When information about a function is displayed in the help window, two
  2159. additional hyperlink buttons are displayed.  %@NL@%
  2160. %@NL@%
  2161. %@NL@%
  2162.   ■   <Description> provides a detailed explanation of the function. When
  2163.       the information is displayed, the button changes to <Summary>,
  2164.       allowing you to return to the summarized information about the
  2165.       function.%@NL@%
  2166. %@NL@%
  2167.   ■   <Example> displays C source code that provides an example of how the
  2168.       function is used. The code can be pasted into the source window to
  2169.       compile.%@NL@%
  2170. %@NL@%
  2171. %@NL@%
  2172. %@NL@%
  2173. %@4@%%@AB@%Topical Information%@AE@%%@EH@%%@NL@%
  2174. %@NL@%
  2175. The online reference system is useful when you want an overview of the
  2176. available reference topics, or when you only have a general idea of what
  2177. information you need. Start with the global contents screen, then select any
  2178. hyperlinks that appear to relate to the topic. You can traverse the
  2179. hyperlinks until you locate the necessary information.  %@NL@%
  2180. %@NL@%
  2181. %@NL@%
  2182. %@4@%%@AB@%Menu and Dialog-Box Information%@AE@%%@EH@%%@NL@%
  2183. %@NL@%
  2184. You can get information about any menu command or dialog box by pressing F1
  2185. when the menu command is highlighted or the dialog box is displayed. This is
  2186. helpful when you are first learning to use QuickC, and may not be completely
  2187. familiar with all of the features.  %@NL@%
  2188. %@NL@%
  2189. %@NL@%
  2190. %@4@%%@AB@%Error Information%@AE@%%@EH@%%@NL@%
  2191. %@NL@%
  2192. The Microsoft Advisor provides information about compiler and linker error
  2193. messages.  %@NL@%
  2194. %@NL@%
  2195. To find the meaning of an error message using the keyboard,  %@NL@%
  2196. %@NL@%
  2197. %@NL@%
  2198.   1.  Press F6 to move the cursor to the error window%@NL@%
  2199. %@NL@%
  2200.   2.  Position the cursor on the error number%@NL@%
  2201. %@NL@%
  2202.   3.  Press F1%@NL@%
  2203. %@NL@%
  2204. %@NL@%
  2205. Or:  %@NL@%
  2206. %@NL@%
  2207. %@NL@%
  2208.   1.  Position the mouse cursor on the error number%@NL@%
  2209. %@NL@%
  2210.   2.  Click the Right mouse button%@NL@%
  2211. %@NL@%
  2212. %@NL@%
  2213. %@NL@%
  2214. %@NL@%
  2215. %@NL@%
  2216. %@NL@%
  2217. %@NL@%
  2218. %@CR:C6A00050001 @%%@1@%%@AB@%Chapter 5  Where to Go from Here%@AE@%%@EH@%%@NL@%
  2219. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  2220. %@NL@%
  2221. You've installed the QuickC Compiler on your system and tried a sample
  2222. editing session. What you do next depends on your level of experience. You
  2223. can experiment, or you can further investigate some of the other books in
  2224. this package.  %@NL@%
  2225. %@NL@%
  2226. %@NL@%
  2227. %@4@%%@AB@%Read README.DOC%@AE@%%@EH@%%@NL@%
  2228. %@NL@%
  2229. The README.DOC file lists all known corrections and additions to the printed
  2230. manuals. Before you continue, please read this file. You can view it from
  2231. within online help or you can use the QuickC editor (type %@AS@% QC README.DOC %@AE@% to
  2232. read the file).  %@NL@%
  2233. %@NL@%
  2234. %@NL@%
  2235. %@4@%%@AB@%For All Programmers%@AE@%%@EH@%%@NL@%
  2236. %@NL@%
  2237. The QuickC environment has been designed with you, the programmer, in mind.
  2238. You'll find writing, compiling, and debugging QuickC programs faster and
  2239. easier than ever. To learn more about the editor, compiler, linker, and
  2240. debugger, you should run the disk-based tutorial on the QuickC distribution
  2241. disk labeled "Learning the Microsoft QuickC Integrated Environment."  %@NL@%
  2242. %@NL@%
  2243. The \QC2\TUTORIAL directory holds the tutorial program, LEARN.COM. The LEARN
  2244. program contains four lessons:  %@NL@%
  2245. %@NL@%
  2246. %@NL@%
  2247.   1.  How to Use This Tutorial%@NL@%
  2248. %@NL@%
  2249.   2.  Getting Around in QuickC%@NL@%
  2250. %@NL@%
  2251.   3.  Creating Programs in QuickC%@NL@%
  2252. %@NL@%
  2253.   4.  Debugging in QuickC%@NL@%
  2254. %@NL@%
  2255. %@NL@%
  2256. You can run LEARN from the command line or choose the Learn QuickC command
  2257. from the Utility menu.  %@NL@%
  2258. %@NL@%
  2259. QuickC searches the current path and runs the first LEARN.COM program it
  2260. finds. If it finds a LEARN.COM for another program, such as Microsoft Word,
  2261. QuickC will run that LEARN program instead of the one for QuickC.  %@NL@%
  2262. %@NL@%
  2263. If this happens while you are working from the command line, either switch
  2264. to the \QC2\TUTORIAL directory and type %@AS@%LEARN%@AE@%, and press ENTER, or run the
  2265. NEW-VARS batch file.  %@NL@%
  2266. %@NL@%
  2267. ────────────────────────────────────────────────────────────────────────────%@NL@%
  2268. NOTE
  2269.  
  2270. %@AI@%Since most of the changes to QuickC 2.5 are language additions that don't
  2271. %@AI@%affect the QuickC environment or the operation of the compiler or linker,
  2272. %@AI@%the LEARN tutorial program has not been updated to include changes found in
  2273. %@AI@%version 2.5.%@AE@%%@NL@%
  2274. ────────────────────────────────────────────────────────────────────────────%@NL@%%@NL@%
  2275. %@NL@%
  2276. %@NL@%
  2277. %@4@%%@AB@%For Programmers New to the C Language%@AE@%%@EH@%%@NL@%
  2278. %@NL@%
  2279. The book %@AI@%C for Yourself%@AE@% was written for people who already know how to
  2280. program (in BASIC, Pascal, or some other language) but have never used C.
  2281. Part 1, "Learning C," covers everything from functions to flow control and
  2282. from data types to pointers. If you've never programmed in C or if you need
  2283. a refresher course, start with %@AI@%C for Yourself%@AE@%.  %@NL@%
  2284. %@NL@%
  2285. The introduction in %@AI@%C for Yourself%@AE@% lists several additional books that
  2286. newcomers to C may find helpful.  %@NL@%
  2287. %@NL@%
  2288. Another good source of information about how C works is the online help
  2289. system. Prototypes, explanations, and examples for any function are
  2290. immediately available at the press of a key. You may ask for help about a
  2291. specific topic or browse through the contents screen.  %@NL@%
  2292. %@NL@%
  2293. %@NL@%
  2294. %@4@%%@AB@%For C Programmers New to QuickC%@AE@%%@EH@%%@NL@%
  2295. %@NL@%
  2296. Appendix A of %@AI@%C for Yourself%@AE@%  is a quick reference to the QuickC
  2297. implementation of C. Both the proposed ANSI standard and the original
  2298. Kernighan & Ritchie standard are supported.  %@NL@%
  2299. %@NL@%
  2300. Appendix B of %@AI@%C for Yourself%@AE@% summarizes the most useful QuickC library
  2301. functions, listing the header files to include, values to pass, and values
  2302. returned.  %@NL@%
  2303. %@NL@%
  2304. For specific details on the compiling, linking, library, and other support
  2305. programs, see %@AI@%Microsoft QuickC Tool Kit%@AE@%.  %@NL@%
  2306. %@NL@%
  2307. %@NL@%
  2308. %@4@%%@AB@%For QuickC Programmers New to Version 2.5%@AE@%%@EH@%%@NL@%
  2309. %@NL@%
  2310. If you've used an older version of QuickC, you should read Appendix B of
  2311. this book. It lists features that were added to both QuickC version 2.0 and
  2312. the current 2.5 version.  %@NL@%
  2313. %@NL@%
  2314. Advanced C topics and features unique to QuickC are covered in %@AI@%C for
  2315. %@AI@%Yourself%@AE@%. Part 2, "Using C," includes detailed information about the new
  2316. functions such as real coordinate graphics, presentation graphics, fonts,
  2317. and in-line assembly. If you've previously used version 1.0 of QuickC, we
  2318. recommend that you read through Part 2 of %@AI@%C for Yourself%@AE@%. In addition,
  2319. Appendix B, "C Library Guide," summarizes commonly used functions in the
  2320. QuickC run-time library.  %@NL@%
  2321. %@NL@%
  2322. %@NL@%
  2323. %@4@%%@AB@%Additional Tools%@AE@%%@EH@%%@NL@%
  2324. %@NL@%
  2325. QuickC offers more than just an integrated editor, compiler, and linker.
  2326. Additional utilities include the QCL program (for compiling from the DOS
  2327. command line), the LINK program (for linking object modules), the NMAKE
  2328. program (for automating the compile/link process and maintaining programs),
  2329. and the LIB program (for creating your own libraries).  %@NL@%
  2330. %@NL@%
  2331. %@AI@%Microsoft QuickC Tool Kit%@AE@% explains how to use these advanced tools to best
  2332. advantage. Part 1, "Tool Kit Tutorial," is a tutorial that explains
  2333. step-by-step how these programs work. Part 2, "Reference to QuickC Tools,"
  2334. is a complete and exhaustive reference guide that summarizes the many
  2335. options.  %@NL@%
  2336. %@NL@%
  2337. %@NL@%
  2338. %@NL@%
  2339. %@NL@%
  2340. %@NL@%
  2341. %@NL@%
  2342. %@CR:C6A-A0001   @%%@1@%%@AB@%Appendix A  Editor Functions%@AE@%%@EH@%%@NL@%
  2343. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  2344. %@NL@%
  2345. This appendix has two parts. The first part, Table A.1, lists the keystrokes
  2346. that invoke commands within the QuickC Compiler Editor and three other
  2347. editors. The second part, Table A.2, lists the editor functions
  2348. alphabetically and defines them.  %@NL@%
  2349. %@NL@%
  2350. Each editor has its own .KEY file. Chapter 3, "Using QuickC," explains how
  2351. to use the /k: option to load one of the four .KEY files supplied with
  2352. QuickC. It also contains directions for using MKKEY.EXE to customize the
  2353. commands within a .KEY file. Functions are not assigned default values. If
  2354. you omit Backspace from your customized .KEY file, you will be unable to
  2355. backspace.  %@NL@%
  2356. %@NL@%
  2357. Note that in Table A.1 below, the plus sign indicates that both keys should
  2358. be held down. For example, CTRL+H means that you hold down the CTRL key
  2359. while you press H. When keys are pressed separately, they are separated with
  2360. a comma. For example, ESC, D means that you press (and release) ESC and then
  2361. press the D key.  %@NL@%
  2362. %@NL@%
  2363. The CAPS LOCK key affects individual keystrokes, but not CTRL or ALT
  2364. sequences. Holding down the SHIFT key defines a block of text.  %@NL@%
  2365. %@NL@%
  2366. %@AB@%Table   %@AB@%A.1 Editor Keystrokes%@AE@%%@AE@%
  2367.  
  2368. %@TH:  18   790 02 11 19 14 11 21 @%
  2369. Function   QuickC             Microsoft     BRIEF(R)   Epsilon
  2370. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  2371. Backspace  CTRL+H             CTRL+H        CTRL+H     ─
  2372.  
  2373. BegLine    CTRL+Q, CTRL+S     ─             ─          ─
  2374.            CTRL+Q, S                                   
  2375.  
  2376. BegPgm     CTRL+HOME          ALT+A, PGUP   CTRL+PGUP  CTRL+HOME
  2377.            CTRL+Q, CTRL+R                              ESC, <
  2378.            CTRL+Q, R                                   
  2379.  
  2380. Cancel     ESC                ESC           ESC        F12
  2381.  
  2382. Cancel2    F12                F12           F12        ESC
  2383.  
  2384. Change     CTRL+Q, CTRL+A     CTRL+L        ALT+T      ESC, %
  2385.            CTRL+Q, A          CTRL+\                   
  2386.  
  2387. %@TE:  18   790 02 11 19 14 11 21 @%
  2388.  
  2389. %@AB@%Table   %@AB@%A.1 (continued)%@AE@%%@AE@%
  2390.  
  2391. %@TH:  42  1951 02 18 18 15 11 15 @%
  2392. Function          QuickC            Microsoft      BRIEF(R)   Epsilon
  2393. %@AB@%─────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  2394. CharLeft          CTRL+S            CTRL+S         LEFT       CTRL+B
  2395.                   LEFT                                        LEFT
  2396.  
  2397. CharRight         CTRL+D            CTRL+D         RIGHT      CTRL+F
  2398.                   RIGHT                                       RIGHT
  2399.  
  2400. Del               DEL               DEL            DEL        DEL
  2401.                   CTRL+G            CTRL+G                    CTRL+D
  2402.  
  2403. DelWord           CTRL+T                                      ALT+D
  2404.                                                               ESC, D
  2405.  
  2406. DoEsc             ESC               ─              ─          ─
  2407.  
  2408. DoQuoteCharacter  CTRL+P            CTRL+P         ALT+Q      CTRL+Q
  2409.  
  2410. DoTab             TAB               TAB            TAB        TAB
  2411.                   ALT+TAB                                     ALT+TAB
  2412.  
  2413. EndLine           END               END            END        END
  2414.                   CTRL+Q, CTRL+D                              CTRL+E
  2415.                   CTRL+Q, D                                   
  2416.  
  2417. EndPgm            CTRL+END          ALT+A, PGDN    CTRL+PGDN  CTRL+END
  2418.                   CTRL+Q, CTRL+C                              ESC, >
  2419.                   CTRL+Q, C                                   
  2420.  
  2421. EndScn            CTRL+Q, CTRL+X    ALT+A, DOWN    CTRL+DOWN  ─
  2422.                   CTRL+Q, X                                   
  2423.  
  2424. EraseEol          CTRL+Q, CTRL+Y    ALT+A, CTRL+Y  ALT+K      CTRL+K
  2425.                   CTRL+Q, Y                                   
  2426.  
  2427. Find              CTRL+Q, CTRL+F    ─              ALT+S      CTRL+S
  2428.                   CTRL+Q, F                                   
  2429.  
  2430. GotoBookmark0     CTRL+Q, 0         ─              ─          ─
  2431.  
  2432. GotoBookmark1     CTRL+Q, 1         ─              ─          ─
  2433.  
  2434. %@TE:  42  1951 02 18 18 15 11 15 @%
  2435.  
  2436. %@AB@%Table   %@AB@%A.1 (continued)%@AE@%%@AE@%
  2437.  
  2438. %@TH:  48  1897 02 16 16 12 11 21 @%
  2439. Function        QuickC          Microsoft   BRIEF(R)   Epsilon
  2440. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  2441. GotoBookmark2   CTRL+Q, 2       ─           ─          ─
  2442.  
  2443. GotoBookmark3   CTRL+Q, 3       ─           ─          ─
  2444.  
  2445. HomeLine        HOME            HOME        HOME       HOME
  2446.                                                        CTRL+A
  2447.  
  2448. HomeScn         CTRL+Q, CTRL+E  ALT+A, UP   CTRL+HOME  ─
  2449.                 CTRL+Q, E                              
  2450.  
  2451. KillLine        CTRL+Y          CTRL+Y      ALT+D      ─
  2452.  
  2453. LineDown        DOWN            DOWN        DOWN       DOWN
  2454.                 CTRL+X          CTRL+X                 CTRL+N
  2455.  
  2456. LineUp          UP              UP          UP         UP
  2457.                 CTRL+E          CTRL+E                 CTRL+P
  2458.  
  2459. MatchBrace      CTRL+]          ─           ─          CTRL+]
  2460.  
  2461. Menu            ALT             F11         ALT        ALT
  2462.  
  2463. Menu2           F11             ALT+M       F11        F11
  2464.  
  2465. NewLine         CTRL+M          CTRL+M      CTRL+M     CTRL+M
  2466.  
  2467. NextLine        CTRL+J          ─           ─          CTRL+J
  2468.  
  2469. PageDown        PGDN            PGDN        PGDN       PGDN
  2470.                 CTRL+C          CTRL+C                 CTRL+V
  2471.  
  2472. PageLeft        CTRL+PGUP       ─           ─          CTRL+PGUP
  2473.  
  2474. PageRight       CTRL+PGDN       ─           ─          CTRL+PGDN
  2475.  
  2476. PageUp          PGUP            PGUP        PGUP       PGUP
  2477.                 CTRL+R          CTRL+R                 ALT+V
  2478.                                                        ESC, V
  2479.  
  2480. ResetState      CTRL+K, CTRL+U  ─           ─          ─
  2481.                 CTRL+Q, CTRL+U                         
  2482.                 CTRL+U                                 
  2483.  
  2484. ScrollDown      CTRL+Z,         CTRL+Z      CTRL+D     CTRL+Z CTRL+DOWN
  2485.                 CTRL+DOWN                              
  2486.  
  2487. %@TE:  48  1897 02 16 16 12 11 21 @%
  2488.  
  2489. %@AB@%Table   %@AB@%A.1 (continued)%@AE@%%@AE@%
  2490.  
  2491. %@TH:  34  1680 02 18 18 18 12 21 @%
  2492. Function          QuickC            Microsoft         BRIEF(R)    Epsilon
  2493. %@AB@%───────────────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  2494. ScrollUp          CTRL+UP           CTRL+W            CTRL+U      CTRL+UP
  2495.                   CTRL+W                                          ESC, Z
  2496.                                                                   F4
  2497.  
  2498. SearchNext        CTRL+L            ─                 ─           ─
  2499.  
  2500. SetBookMark0      CTRL+K, 0         ─                 ALT+M       ─
  2501.  
  2502. SetBookMark1      CTRL+K, 1         ─                 ─           ─
  2503.  
  2504. SetBookMark2      CTRL+K, 2         ─                 ─           ─
  2505.  
  2506. SetBookMark3      CTRL+K, 3         ─                 ─           ─
  2507.  
  2508. SplitLine         CTRL+N            CTRL+N            ─           CTRL+O
  2509.  
  2510. ToggleInsertMode  INS               INS               ALT+I       INS
  2511.                   CTRL+V            CTRL+V                        
  2512.  
  2513. Undo              CTRL+Q, CTRL+L    ALT+H             ALT+U       ─
  2514.                   CTRL+Q, L                                       
  2515.  
  2516. WordLeft          CTRL+LEFT         CTRL+LEFT         CTRL+LEFT   CTRL+LEFT
  2517.                   CTRL+A            CTRL+A                        ALT+B
  2518.                                                                   ESC, B
  2519.  
  2520. WordRight         CTRL+RIGHT        CTRL+RIGHT        CTRL+RIGHT  CTRL +RIGHT
  2521.                   CTRL+F            CTRL+F                        ALT+F
  2522.                                                                   ESC, F
  2523.  
  2524. %@AB@%───────────────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  2525.  
  2526. %@TE:  34  1680 02 18 18 18 12 21 @%
  2527.  
  2528. %@AB@%Table   %@AB@%A.2 Function Definitions%@AE@%%@AE@%
  2529.  
  2530. %@TH:  72  3271 02 34 42 @%
  2531. Function                          Description
  2532. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  2533. Backspace                         Moves the cursor left and erases the 
  2534.                                   character in that position.
  2535.  
  2536. Beep                              Causes the computer to beep, usually 
  2537.                                   when an unassigned key is pressed.
  2538.  
  2539. BegLine                           Moves the cursor to the beginning of the
  2540.                                   line (column 1), ignoring any 
  2541.                                   indentation.
  2542.  
  2543. BegPgm                            Moves the cursor to the beginning of the
  2544.                                   program (line 1, column 1).
  2545.  
  2546. Cancel                            Closes help windows and cancels dialog 
  2547.                                   boxes.
  2548.  
  2549. Cancel2                           Cancels dialog boxes.
  2550.  
  2551. Change                            Searches for selected text and changes 
  2552.                                   it to something else.
  2553.  
  2554. CharLeft                          Moves the cursor one character left.
  2555.  
  2556. CharRight                         Moves the cursor one character right.
  2557.  
  2558. Del                               Deletes the character under the cursor.
  2559.  
  2560. DelWord                           Deletes the word from the current cursor
  2561.                                   position to the next white-space 
  2562.                                   character.
  2563.  
  2564. DoEsc                             Cancels the current selected text.
  2565.  
  2566. DoQuoteCharacter                  Inserts the next typed character into 
  2567.                                   the text (except carriage returns, 
  2568.                                   linefeeds, and nulls). This allows you 
  2569.                                   to insert characters such as CTRL+C.
  2570.  
  2571. DoTab                             Indents the entire defined block by one 
  2572.                                   tab setting. A shifted DoTab removes the
  2573.                                   tabs from a block.
  2574.  
  2575. Endline                           Moves the cursor to the last nonspace 
  2576.                                   character in the current line.
  2577.  
  2578. EndPgm                            Moves the cursor to column 1 of the last
  2579.                                   line in the current file.
  2580.  
  2581. EndScn                            Moves the cursor to the bottom line of 
  2582.                                   the current screen. The current column 
  2583.                                   is 
  2584.                                   maintained.
  2585.  
  2586. EraseEol                          Erases all characters from the cursor 
  2587.                                   position to the end of the line. The 
  2588.                                   characters are placed in the insert 
  2589.                                   buffer.
  2590.  
  2591. Find                              Searches from the current cursor 
  2592.                                   position to the end of the file for 
  2593.                                   defined text.
  2594.  
  2595. GotoBookmark0                     Moves the cursor to bookmark 0.
  2596.  
  2597. GotoBookmark1                     Moves the cursor to bookmark 1.
  2598.  
  2599. GotoBookmark2                     Moves the cursor to bookmark 2.
  2600.  
  2601. GotoBookmark3                     Moves the cursor to bookmark 3.
  2602.  
  2603. %@TE:  72  3271 02 34 42 @%
  2604.  
  2605. %@AB@%Table   %@AB@%A.2 (continued)%@AE@%%@AE@%
  2606.  
  2607. %@TH:  65  2824 02 34 42 @%
  2608. Function                          Description
  2609. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  2610. HomeLine                          Moves the cursor to the first nonspace 
  2611.                                   character on the line.
  2612.  
  2613. HomeScn                           Moves the cursor to line 1 of the 
  2614.                                   current screen, maintaining the current 
  2615.                                   column 
  2616.                                   position.
  2617.  
  2618. IgnoreChar                        Does nothing. In addition, the editor 
  2619.                                   doesn't beep as it would for undefined 
  2620.                                   keys.
  2621.  
  2622. KillLine                          Erases everything on the current line 
  2623.                                   and places the line in the insert buffer.
  2624.  
  2625. LineDown                          Moves the cursor to the next line.
  2626.  
  2627. LineUp                            Moves the cursor to the previous line.
  2628.  
  2629. MatchBrace                        Finds matching (parentheses), [square 
  2630.                                   brackets], or {curly braces}. The editor
  2631.                                   searches for opening or closing braces, 
  2632.                                   depending on which type the cursor is 
  2633.                                   resting on.
  2634.  
  2635. Menu                              Activates the menu bar.
  2636.  
  2637. Menu2                             Activates the menu bar.
  2638.  
  2639. NewLine                           Splits the current line into two lines 
  2640.                                   at the cursor position. The new line is 
  2641.                                   automatically indented to match the line
  2642.                                   above.
  2643.  
  2644. PageDown                          Moves forward one screen.
  2645.  
  2646. PageLeft                          Moves left one screen.
  2647.  
  2648. PageRight                         Moves one screen to the right (each line
  2649.                                   on a screen may contain up to 255 
  2650.                                   characters).
  2651.  
  2652. PageUp                            Moves back one screen.
  2653.  
  2654. ResetState                        Cancels prefix tables.
  2655.  
  2656. ScrollDown                        Scrolls down one line at a time, 
  2657.                                   maintaining the current cursor position.
  2658.  
  2659. ScrollUp                          Scrolls the text up one line at a time, 
  2660.                                   maintaining the current cursor position.
  2661.  
  2662. SearchNext                        Repeats the Find command.
  2663.  
  2664. SetBookMark0                      Sets bookmark 0. You may later return to
  2665.                                   this position with GotoBookMark0.
  2666.  
  2667. SetBookMark1                      Sets bookmark 1.
  2668.  
  2669. SetBookMark2                      Sets bookmark 2.
  2670.  
  2671. SetBookMark3                      Sets bookmark 3.
  2672.  
  2673. %@TE:  65  2824 02 34 42 @%
  2674.  
  2675. %@AB@%Table   %@AB@%A.2 (continued)%@AE@%%@AE@%
  2676.  
  2677. %@TH:  21  1070 02 34 42 @%
  2678. Function                          Description
  2679. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  2680. SplitLine                         Splits a line in two (like NewLine), but
  2681.                                   leaves the cursor at the end of the 
  2682.                                   first line instead of the beginning of 
  2683.                                   the second.
  2684.  
  2685. ToggleInsertMode                  Toggles between insert mode and overtype
  2686.                                   mode.
  2687.  
  2688. Undo                              Cancels any commands that might have 
  2689.                                   been performed on the current line. Undo
  2690.                                   works only when the cursor remains on 
  2691.                                   the line being edited.
  2692.  
  2693. WordLeft                          Moves the cursor to the previous word.
  2694.  
  2695. WordRight                         Moves the cursor to the next word.
  2696.  
  2697. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  2698.  
  2699. %@TE:  21  1070 02 34 42 @%
  2700.  
  2701. %@NL@%
  2702. %@NL@%
  2703. %@NL@%
  2704. %@NL@%
  2705. %@NL@%
  2706. %@CR:C6A-B0001   @%%@1@%%@AB@%Appendix B  QuickC Differences%@AE@%%@EH@%%@NL@%
  2707. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  2708. %@NL@%
  2709. The QuickC Compiler version 2.5 incorporates a variety of new features. If
  2710. you've used version 1.0, you'll find many new features were added to version
  2711. 2.0, in addition to those added in the current 2.5 release.  %@NL@%
  2712. %@NL@%
  2713. This appendix summarizes some of the significant differences between QuickC
  2714. versions 1.0 and 2.0, and offers a comprehensive guide to the changes found
  2715. in version 2.5. For detailed information about a feature, consult the online
  2716. help, %@AI@%C for Yourself%@AE@%, or %@AI@%Microsoft QuickC Tool Kit%@AE@%.  %@NL@%
  2717. %@NL@%
  2718. %@NL@%
  2719. %@2@%%@CR:C6A-B0002   @%%@AB@%QuickC Version 2.0 Additions%@AE@%%@EH@%%@NL@%
  2720. %@NL@%
  2721. Additions to version 2.0 include  %@NL@%
  2722. %@NL@%
  2723. %@NL@%
  2724.   ■   Expanded and improved online help system invoked by pressing F1%@NL@%
  2725. %@NL@%
  2726.   ■   New presentation and real-coordinates graphics functions%@NL@%
  2727. %@NL@%
  2728.   ■   Small, medium, compact, large, and huge memory models%@NL@%
  2729. %@NL@%
  2730.   ■   Support of in-line assembly-language routines%@NL@%
  2731. %@NL@%
  2732.   ■   New Local Variables, Notepad, and Registers windows%@NL@%
  2733. %@NL@%
  2734.   ■   Text cut and paste support%@NL@%
  2735. %@NL@%
  2736.   ■   Command line compiling and linking with QC.EXE and QCL.EXE%@NL@%
  2737. %@NL@%
  2738.   ■   Incremental compilation%@NL@%
  2739. %@NL@%
  2740.   ■   MKKEY utility for customizing editor key commands %@NL@%
  2741. %@NL@%
  2742. %@NL@%
  2743. %@NL@%
  2744. %@2@%%@CR:C6A-B0003   @%%@AB@%QuickC Version 2.5 Additions and Changes%@AE@%%@EH@%%@NL@%
  2745. %@NL@%
  2746. Additions and changes to version 2.5 affect both the QuickC environment and
  2747. the C language implementation. The following sections list those changes.  %@NL@%
  2748. %@NL@%
  2749. %@NL@%
  2750. %@3@%%@CR:C6A-B0004   @%%@AB@%Interface and Environment Changes%@AE@%%@EH@%%@NL@%
  2751. %@NL@%
  2752. This section describes changes to the QuickC user interface and programming
  2753. environment.  %@NL@%
  2754. %@NL@%
  2755. %@NL@%
  2756.   ■   The Go To command in the Search menu moves to a specified line number
  2757.       in the source.%@NL@%
  2758. %@NL@%
  2759.   ■   The Quickwatch command in the Debug menu gives faster access in
  2760.       viewing variables and expressions.%@NL@%
  2761. %@NL@%
  2762.   ■   The Color command in the Options menu allows you to select four
  2763.       different sets of colors and to change the color of items such as
  2764.       menus, borders, and buttons.%@NL@%
  2765. %@NL@%
  2766.   ■   Tabs can now be treated as spaces or actual tab characters.%@NL@%
  2767. %@NL@%
  2768. %@NL@%
  2769. %@NL@%
  2770. %@3@%%@CR:C6A-B0005   @%%@AB@%Language and Compiler Changes%@AE@%%@EH@%%@NL@%
  2771. %@NL@%
  2772. This section describes changes to the QuickC implementation of the C
  2773. language and changes in the compiler's behavior.  %@NL@%
  2774. %@NL@%
  2775. %@NL@%
  2776. %@4@%%@AB@%Memory Models%@AE@%%@EH@%%@NL@%
  2777. %@NL@%
  2778. %@NL@%
  2779.   ■   QuickC 2.5 now supports the tiny memory model, which produces .COM
  2780.       rather than .EXE files. In the tiny memory model, all of your
  2781.       program's code and data must fit in a single 64K segment.
  2782.       Additionally, tiny programs do not support graphics.%@NL@%
  2783. %@NL@%
  2784.   ■   QuickC 2.5 supports custom memory models, such as huge-compact, with
  2785.       the /A compiler option. Refer to %@AI@%Microsoft QuickC Tool Kit%@AE@% for
  2786.       additional information.%@NL@%
  2787. %@NL@%
  2788. %@NL@%
  2789. %@NL@%
  2790. %@4@%%@AB@%Constants%@AE@%%@EH@%%@NL@%
  2791. %@NL@%
  2792. %@NL@%
  2793.   ■   Both %@AB@%long %@AE@%and %@AB@%unsigned long%@AE@% values are allowed in switch expressions
  2794.       and case constants. Previous versions of QuickC allow only %@AB@%char%@AE@% and
  2795.       %@AB@%int%@AE@% values in this context.%@NL@%
  2796. %@NL@%
  2797.   ■   QuickC supports %@AB@%unsigned long%@AE@% decimal constants. It is now possible to
  2798.       initialize %@AB@%unsigned long%@AE@% variables with values larger than %@AB@%MAX_LONG%@AE@%
  2799.       using decimal (rather than hexadecimal or octal) constants.%@NL@%
  2800. %@NL@%
  2801.   ■   The constant %@AB@%NULL %@AE@%is now defined as %@AS@% ((void *)0)%@AE@%. Previous versions of
  2802.       QuickC defined %@AB@%NULL%@AE@% as 0x0000 in small and medium models and
  2803.       0x00000000L in compact and large models.%@NL@%
  2804. %@NL@%
  2805. %@NL@%
  2806. %@NL@%
  2807. %@4@%%@AB@%Keywords%@AE@%%@EH@%%@NL@%
  2808. %@NL@%
  2809. %@NL@%
  2810.   ■   Storage classes or types (or both) are now required on variable
  2811.       declarations. QuickC previously assumed that untyped variables (such
  2812.       as %@AS@% a;%@AE@%) were integers. This declaration now generates a warning.%@NL@%
  2813. %@NL@%
  2814.   ■   The %@AB@%volatile%@AE@% keyword, which was previously implemented only
  2815.       syntactically, is now also implemented semantically.%@NL@%
  2816. %@NL@%
  2817.   ■   To identify implementation-defined keywords as non-ANSI, an underscore
  2818.       has been added. Thus, %@AB@%far%@AE@%, %@AB@%near%@AE@%, %@AB@%huge%@AE@%, %@AB@%cdecl%@AE@%, %@AB@%fortran%@AE@%, %@AB@%interrupt%@AE@%, and
  2819.       %@AB@%pascal%@AE@% have been changed to %@AB@%_far%@AE@%, %@AB@%_near%@AE@%, %@AB@%_huge%@AE@%, %@AB@%_cdecl%@AE@%, %@AB@%_fortran%@AE@%,
  2820.       %@AB@%_interrupt%@AE@%, and %@AB@%_pascal%@AE@%. QuickC still accepts the obsolescent versions
  2821.       of these keywords, unless you use the /Za (disable extensions) option.%@NL@%
  2822. %@NL@%
  2823.   ■   A new pseudo-instruction, %@AB@%_emit%@AE@%, has been added for use with the
  2824.       in-line assembler. It allows you to define a single immediate byte at
  2825.       the current location in the current text segment.%@NL@%
  2826. %@NL@%
  2827.   ■   The %@AB@%const%@AE@% and %@AB@%volatile%@AE@% qualifiers must be placed after the name of the
  2828.       type they qualify. Consult online help for more information about
  2829.       %@AB@%const%@AE@% and %@AB@%volatile%@AE@%.%@NL@%
  2830. %@NL@%
  2831.   ■   The new %@AB@%_fastcall%@AE@% function attribute causes QuickC to pass function
  2832.       arguments in processor registers instead of on the stack. This results
  2833.       in faster functions when a QuickC program is built with Microsoft C
  2834.       version 6.0.%@NL@%
  2835. %@NL@%
  2836. %@NL@%
  2837. %@NL@%
  2838. %@4@%%@AB@%Locale-Specific Information%@AE@%%@EH@%%@NL@%
  2839. %@NL@%
  2840. %@NL@%
  2841.   ■   The LOCALE.H header file is new to version 2.5. It declares functions
  2842.       and structures for describing conventions, such as the currency
  2843.       symbol, that vary from one country to the next.%@NL@%
  2844. %@NL@%
  2845. %@NL@%
  2846. %@NL@%
  2847. %@4@%%@AB@%Based Objects%@AE@%%@EH@%%@NL@%
  2848. %@NL@%
  2849. %@NL@%
  2850.   ■   QuickC 2.5 supports the following new keywords and operators, which
  2851.       are used to declare and manipulate based objects: %@AB@%_based%@AE@%, %@AB@%_segment%@AE@%,
  2852.       %@AB@%_segname%@AE@%, and %@AB@%:>%@AE@% (the based operator). Based object support is
  2853.       included in QuickC 2.5 for the sake of compatibility with Microsoft C
  2854.       version 6.0. Please refer to Chapter 2, "Managing Memory," in the
  2855.       Microsoft C Professional Development System %@AI@%Advanced Programming
  2856. %@AI@%      Techniques%@AE@% guide for further details.%@NL@%
  2857. %@NL@%
  2858. %@NL@%
  2859. %@NL@%
  2860. %@4@%%@AB@%Data Types%@AE@%%@EH@%%@NL@%
  2861. %@NL@%
  2862. %@NL@%
  2863.   ■   QuickC version 2.0 recognizes %@AB@%long double%@AE@% and %@AB@%double%@AE@% as different
  2864.       types, with both types stored in memory as 64-bit quantities.%@NL@%
  2865. %@NL@%
  2866. %@STUB@%      Because the 80%@AI@%x%@AE@%87 family of math coprocessors supports an 80-bit
  2867.       floating-point type, QuickC version 2.5 stores %@AB@%long double%@AE@% variables
  2868.       in the 80%@AI@%x%@AE@%87 10-byte (80-bit) form.%@NL@%
  2869. %@NL@%
  2870. %@STUB@%      Certain library functions have been modified to handle the %@AB@%long double%@AE@%
  2871.       type. The %@AB@%printf%@AE@% and %@AB@%scanf%@AE@% family of functions supports %@AB@%long double%@AE@%
  2872.       values identified by a trailing %@AB@%l%@AE@% in the format specifier. The library
  2873.       contains new versions of the transcendental functions as well as
  2874.       intrinsic forms that accept %@AB@%long double%@AE@% arguments. These are
  2875.       identified by a trailing %@AB@%l%@AE@% in the function name (e.g., %@AB@%cosl%@AE@%).%@NL@%
  2876. %@NL@%
  2877.   ■   Integer promotion rules have changed. Earlier versions of QuickC
  2878.       attempted to preserve an expression's unsigned nature as much as
  2879.       possible. Version 2.5 attempts to preserve the expression's value.%@NL@%
  2880. %@NL@%
  2881. %@STUB@%      In version 2.0, an %@AB@%unsigned char%@AE@% promotes to an %@AB@%unsigned int%@AE@%; an
  2882.       %@AB@%unsigned int%@AE@% promotes to an %@AB@%unsigned long%@AE@%.%@NL@%
  2883. %@NL@%
  2884. %@STUB@%      In version 2.5, an %@AB@%unsigned char%@AE@% promotes to a %@AB@%signed int%@AE@%; an %@AB@%unsigned
  2885. %@AB@%      int%@AE@% promotes to a %@AB@%signed long%@AE@%.%@NL@%
  2886. %@NL@%
  2887.   ■   Shift operators now give a result that is of the same type as the left
  2888.       operand. QuickC previously yielded a result that was of the same type
  2889.       as the largest of the two values.%@NL@%
  2890. %@NL@%
  2891. %@NL@%
  2892. %@NL@%
  2893. %@4@%%@AB@%Preprocessor%@AE@%%@EH@%%@NL@%
  2894. %@NL@%
  2895. %@NL@%
  2896.   ■   QuickC 2.5 allows longer macro expansions (up to 12K). In low memory
  2897.       conditions, the macro expansion space may be limited to 6K.%@NL@%
  2898. %@NL@%
  2899.   ■   The %@AB@%data_seg%@AE@% pragma has been deleted.%@NL@%
  2900. %@NL@%
  2901.   ■   Version 2.0 of QuickC treated conditional compilation expressions as
  2902.       %@AB@%signed long%@AE@% values. Version 2.5 evaluates these expressions using the
  2903.       same rules as are used for all other expressions in C.%@NL@%
  2904. %@NL@%
  2905. %@NL@%
  2906. %@NL@%
  2907. %@4@%%@AB@%Structures, Unions, Arrays, and Bit Fields%@AE@%%@EH@%%@NL@%
  2908. %@NL@%
  2909. %@NL@%
  2910.   ■   If a structure or union is nested inside another structure or union,
  2911.       you can declare it without using a variable name. This rule simplifies
  2912.       references to inner members of such nested constructs.%@NL@%
  2913. %@NL@%
  2914.   ■   QuickC now allows an unsized or zero-sized array as the last member of
  2915.       a structure. Unsized arrays can appear only as the last member of a
  2916.       structure. Structures containing unsized array declarations can be
  2917.       nested within other structures as long as no element of the enclosing
  2918.       structure follows the unsized array. Arrays of such structures are not
  2919.       allowed.%@NL@%
  2920. %@NL@%
  2921.   ■   QuickC now allows longer string literals (up to 2K).%@NL@%
  2922. %@NL@%
  2923.   ■   You may declare %@AB@%signed%@AE@% as well as %@AB@%unsigned%@AE@% bit fields.%@NL@%
  2924. %@NL@%
  2925.   ■   Bit fields are permitted in unions.%@NL@%
  2926. %@NL@%
  2927. %@NL@%
  2928. %@NL@%
  2929. %@4@%%@AB@%Memory Management%@AE@%%@EH@%%@NL@%
  2930. %@NL@%
  2931. %@NL@%
  2932.   ■   The memory-management routine %@AB@%sbrk%@AE@% has been deleted.%@NL@%
  2933. %@NL@%
  2934.   ■   The %@AB@%_fmalloc %@AE@%function attempts to allocate far memory. In previous
  2935.       versions of QuickC, %@AB@%_fmalloc%@AE@% called %@AB@%_nmalloc %@AE@%if far memory was not
  2936.       available. Now it returns a null pointer if far memory isn't
  2937.       available, even if near memory is available.%@NL@%
  2938. %@NL@%
  2939.   ■   Previous versions of QuickC placed the command-line argument strings
  2940.       and environment strings in the near heap. Now they are allocated
  2941.       through %@AB@%malloc%@AE@%. Because %@AB@%malloc%@AE@% maps to %@AB@%_fmalloc%@AE@% in the compact and
  2942.       large memory models, environment strings and command-line argument
  2943.       strings are in far memory in those memory models.%@NL@%
  2944. %@NL@%
  2945. %@NL@%
  2946. %@NL@%
  2947. %@4@%%@AB@%Miscellaneous%@AE@%%@EH@%%@NL@%
  2948. %@NL@%
  2949. %@NL@%
  2950.   ■   QuickC supports a new warning level (4), which provides even more
  2951.       stringent error checking than the warning levels in version 2.0. You
  2952.       can set this warning level from the command line, by supplying the /W4
  2953.       compiler option, or from the QuickC environment, with the Compiler
  2954.       Flags button shown with the Make command in the Options menu. At
  2955.       warning level 4, QuickC generates warnings for nonportable (non-ANSI)
  2956.       constructs and for undefined or implementation-defined constructs.%@NL@%
  2957. %@NL@%
  2958.   ■   The %@AB@%printf%@AE@% and %@AB@%scanf%@AE@% format specifier modifiers %@AB@%N%@AE@%, %@AB@%F%@AE@%, %@AB@%h%@AE@%, and%@AB@% l%@AE@% have
  2959.       changed. Consult online help for additional information.%@NL@%
  2960. %@NL@%
  2961.   ■   In QuickC 2.0, a prototype or definition that returns a %@AB@%float%@AE@% value
  2962.       actually returns a %@AB@%double%@AE@% value. Version 2.5 interprets such a
  2963.       function as returning a %@AB@%float%@AE@% value.%@NL@%
  2964. %@NL@%
  2965.   ■   QuickC version 2.5 does not align a %@AB@%char%@AE@% variable to an even address
  2966.       unless the variable is local. Likewise, a literal constant string is
  2967.       not aligned as in QuickC 2.0.%@NL@%
  2968. %@NL@%
  2969.   ■   To maintain ANSI compatibility and portability between QuickC and
  2970.       other systems, QuickC now supports trigraphs such as  %@AS@%??= %@AE@% equivalent
  2971.       to  %@AS@%#%@AE@%.%@NL@%
  2972. %@NL@%
  2973. %@NL@%
  2974. %@NL@%
  2975. %@NL@%
  2976.