home *** CD-ROM | disk | FTP | other *** search
Text File | 1991-03-01 | 131.1 KB | 2,518 lines |
- %@1@%%@AB@%Microsoft QuickC Compiler - UP AND RUNNING%@AE@%%@EH@%%@NL@%
- %@NL@%
- %@NL@%
- %@NL@%
- %@NL@%
- %@NL@%
- %@NL@%
- %@NL@%
-
- ────────────────────────────────────────────────────────────────────────────%@NL@%
- %@AB@%Microsoft (R) QuickC (R) Compiler - UP AND RUNNING%@AE@%%@NL@%
- %@NL@%
- %@AB@%VERSION 2.5%@AE@%%@NL@%
- ────────────────────────────────────────────────────────────────────────────%@NL@%
- %@NL@%
- %@NL@%
- MICROSOFT CORPORATION %@NL@%
- %@NL@%
- %@NL@%
- %@NL@%
- %@NL@%
- %@NL@%%@NL@%
- %@NL@%
-
-
- Information in this document is subject to change without notice and does
- not represent a commitment on the part of Microsoft Corporation. The
- software described in this document is furnished under a license agreement
- or nondisclosure agreement. The software may be used or copied only in
- accordance with the terms of the agreement. It is against the law to copy
- the software on any medium except as specifically allowed in the license or
- nondisclosure agreement. No part of this manual may be reproduced or trans-
- mitted in any form or by any means, electronic or mechanical, including
- photocopying and recording, for any purpose without the express written
- permission of Microsoft.
- (C) Copyright Microsoft Corporation, 1988, 1990. All rights reserved.%@NL@%
- %@NL@%
-
- Printed and bound in the United States of America.%@NL@%
- %@NL@%
-
- Microsoft, MS, MS-DOS, CodeView, and QuickC are registered
- trademarks of Microsoft Corporation.%@NL@%
- %@NL@%
- Amdek is a registered trademark of Amdek Corporation.%@NL@%
- %@NL@%
- BRIEF is a registered trademark of UnderWare, Inc.%@NL@%
- %@NL@%
- COMPAQ is a registered trademark of Compaq Computer Corporation.%@NL@%
- %@NL@%
- Epsilon is a trademark of Lugaru Software, Inc.%@NL@%
- %@NL@%
- Hercules is a registered trademark of Hercules Computer
- Technology.%@NL@%
- %@NL@%
- IBM is a registered trademark of International Business
- Machines Corporation.%@NL@%
- %@NL@%
- Norton Guides is a trademark of Peter Norton Computing.%@NL@%
- %@NL@%
- WordStar is a registered trademark of MicroPro International
- Corporation.%@NL@%
- %@NL@%
- Document No. SY10424-0290
- OEM D703-2Z
- 10 9 8 7 6 5 4 3 2 1 %@AI@%%@AE@%%@NL@%
- %@NL@%
- %@NL@%
- %@NL@%
- %@NL@%
- %@NL@%
- %@NL@%
- %@1@%%@AB@%Table of Contents%@AE@%%@EH@%%@NL@%
- %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%%@NL@%
- %@NL@%
-
- %@NL@%
- %@AB@%Introduction%@AE@%%@BO: 162e@%%@NL@%
- Read This Manual First%@BO: 1a07@%%@NL@%
- Features New to Version 2.5%@BO: 1fd1@%%@NL@%
- %@NL@%
- %@AB@%Chapter 1%@AE@%%@BO: 2290@% %@AB@%Unpacking QuickC(R)%@AE@%%@NL@%
- %@NL@%
- System Requirements%@BO: 2429@%%@NL@%
- The QuickC Package%@BO: 275e@%%@NL@%
- %@NL@%
- %@AB@%Chapter 2%@AE@%%@BO: 2edc@% %@AB@%Installing QuickC%@AE@%%@NL@%
- %@NL@%
- A Quick Overview%@BO: 3293@%%@NL@%
- Running SETUP%@BO: 39e7@%%@NL@%
- SETUP Stage One%@BO: 48f4@%%@NL@%
- SETUP Stage Two%@BO: 771f@%%@NL@%
- SETUP Stage Three%@BO: 794e@%%@NL@%
- %@NL@%
- %@AB@%Chapter 3%@AE@%%@BO: 88fb@% %@AB@%Using QuickC%@AE@%%@NL@%
- %@NL@%
- The QuickC Environment%@BO: 8cf5@%%@NL@%
- Using Windows and Menus%@BO: 9321@%%@NL@%
- Getting Started%@BO: 9482@%%@NL@%
- Using the Mouse and Keyboard%@BO: 9fb0@%%@NL@%
- Windows%@BO: a206@%%@NL@%
- Menus%@BO: ba8c@%%@NL@%
- Dialog Boxes%@BO: dc0c@%%@NL@%
- Using the Editor%@BO: e8d1@%%@NL@%
- Moving Around in a Source File%@BO: e9c1@%%@NL@%
- Customizing the Editor%@BO: f375@%%@NL@%
- Using Another Editor%@BO: fdf9@%%@NL@%
- Compiling and Linking%@BO: 10559@%%@NL@%
- Building within the QuickC Environment%@BO: 10879@%%@NL@%
- Building from Multiple Source Files%@BO: 11ca2@%%@NL@%
- Compiling and Linking from the Command Line%@BO: 135cb@%%@NL@%
- The Debugger%@BO: 1418c@%%@NL@%
- %@NL@%
- %@AB@%Chapter 4%@AE@%%@BO: 14c92@% %@AB@%Getting Help%@AE@%%@NL@%
- %@NL@%
- Structure of the Microsoft Advisor%@BO: 14f2f@%%@NL@%
- Navigating through the Microsoft Advisor%@BO: 15266@%%@NL@%
- Using the Help Menu%@BO: 15507@%%@NL@%
- Using the F1 Key%@BO: 15ccc@%%@NL@%
- Using Hyperlinks%@BO: 16197@%%@NL@%
- Using Help Windows and Dialog Boxes%@BO: 16896@%%@NL@%
- Accessing Different Types of Information%@BO: 17ef8@%%@NL@%
- %@NL@%
- %@AB@%Chapter 5%@AE@%%@BO: 189c8@% %@AB@%Where to Go from Here%@AE@%%@NL@%
- %@NL@%
- %@NL@%
- %@AB@%Appendix A%@AE@%%@BO: 19f81@% %@AB@%Editor Functions%@AE@%%@NL@%
- %@NL@%
- %@NL@%
- %@AB@%Appendix B%@AE@%%@BO: 1dbc5@% %@AB@%QuickC Differences%@AE@%%@NL@%
- %@NL@%
- QuickC Version 2.0 Additions%@BO: 1dea4@%%@NL@%
- QuickC Version 2.5 Additions and Changes%@BO: 1e19a@%%@NL@%
- Interface and Environment Changes%@BO: 1e2a6@%%@NL@%
- Language and Compiler Changes%@BO: 1e573@%%@NL@%
- %@NL@%
- %@NL@%
- %@CR:C6A-Intro @%%@1@%%@AB@%Introduction%@AE@%%@EH@%%@NL@%
- %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
- %@NL@%
- Welcome to the Microsoft(R) QuickC(R) Compiler version 2.5, a powerful and
- sophisticated yet easy-to-use integrated environment for writing programs in
- the C language. %@NL@%
- %@NL@%
- In recent years, the popularity of C has grown tremendously. C programs
- often can be ported from one computer to another. C programs are fast. C
- source code is compact and concise. The language encourages, but does not
- enforce, modular and structured programming styles. For these and other
- reasons, many programmers and professional software developers prefer C to
- any other language. %@NL@%
- %@NL@%
- Microsoft QuickC combines the power of C with an environment that makes C
- easy to learn and to use. You can write code, compile and link it, run the
- program, and debug it, all without leaving the QuickC environment. %@NL@%
- %@NL@%
- %@NL@%
- %@2@%%@CR:C6A00000001 @%%@AB@%Read This Manual First%@AE@%%@EH@%%@NL@%
- %@NL@%
- This manual contains all the information you need to install and begin using
- QuickC on your computer. There are five chapters: %@NL@%
- %@NL@%
- %@AB@%Unpacking QuickC%@AE@% - Chapter 1 lists the system requirements (hardware that
- you provide) and the contents of this package (software and documentation
- that we provide).%@NL@%
- %@NL@%
- %@AB@%Installing QuickC%@AE@% - Before you can start using QuickC, you must install it.
- Although the installation process is quick and easy, you may want more
- information about libraries and memory models. Chapter 2 guides you through
- installation and provides answers to commonly asked questions.%@NL@%
- %@NL@%
- %@AB@%Using QuickC%@AE@% - Chapter 3 explains how to run QuickC and introduces the
- window and menu environment. Next, it presents an example of a typical
- development cycle: writing, compiling, linking, running, and debugging a
- short program.%@NL@%
- %@NL@%
- %@AB@%Getting Help%@AE@% - The Microsoft QuickC Advisor (online help) provides important
- reference information at the click of a button or press of a key. Chapter 4
- illustrates the many facets of QuickC's powerful online help system.%@NL@%
- %@NL@%
- %@AB@%Where to Go from Here%@AE@% - Once you have unpacked QuickC, installed it on your
- system, and compiled a sample program, you will probably want to investigate
- QuickC further. Chapter 5 provides some suggestions on what to do next. %@NL@%
- %@NL@%
- %@NL@%
- %@2@%%@CR:C6A00000002 @%%@AB@%Features New to Version 2.5%@AE@%%@EH@%%@NL@%
- %@NL@%
- If you have used an earlier version of QuickC, you'll find a variety of new
- features in version 2.5. These features include %@NL@%
- %@NL@%
- %@NL@%
- ■ Language compatibility with Microsoft C version 6.0%@NL@%
- %@NL@%
- ■ Increased ANSI standard C compatibility%@NL@%
- %@NL@%
- ■ Support for the tiny memory model (.COM files)%@NL@%
- %@NL@%
- ■ Enhanced %@AI@%C for Yourself%@AE@%%@NL@%
- %@NL@%
- ■ New Quickwatch debugging feature%@NL@%
- %@NL@%
- ■ Customized color window support%@NL@%
- %@NL@%
- %@NL@%
- For a comprehensive list of new features, refer to Appendix B. %@NL@%
- %@NL@%
- %@NL@%
- %@NL@%
- %@NL@%
- %@NL@%
- %@NL@%
- %@CR:C6A00010001 @%%@1@%%@AB@%Chapter 1 Unpacking QuickC(R)%@AE@%%@EH@%%@NL@%
- %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
- %@NL@%
- You're probably eager to install the QuickC Compiler immediately. But you
- should first take a few minutes to make sure your system meets minimum
- requirements and to determine that your package is complete. %@NL@%
- %@NL@%
- %@NL@%
- %@2@%%@CR:C6A00010002 @%%@AB@%System Requirements%@AE@%%@EH@%%@NL@%
- %@NL@%
- QuickC requires the following minimum configuration: %@NL@%
- %@NL@%
- %@NL@%
- ■ An IBM(R) Personal Computer or compatible running DOS version 2.1 or
- later.%@NL@%
- %@NL@%
- ■ One hard-disk drive and one floppy-disk drive. %@NL@%
- %@NL@%
- ■ 448K (kilobytes) of available memory (512K is recommended for medium
- to large projects).
- %@NL@%
- ────────────────────────────────────────────────────────────────────────────%@NL@%
- NOTE
-
- %@AI@%Microsoft documentation uses the term "DOS" to refer to both the Microsoft
- %@AI@%and the IBM Disk Operating Systems (MS-DOS%@AI@%(R)%@AE@%%@AI@% and PC-DOS).%@AE@%%@AE@%%@NL@%
- ────────────────────────────────────────────────────────────────────────────%@NL@%%@NL@%
- %@NL@%
- %@NL@%
- %@NL@%
- %@NL@%
- %@NL@%
- %@2@%%@CR:C6A00010003 @%%@AB@%The QuickC Package%@AE@%%@EH@%%@NL@%
- %@NL@%
- Check your QuickC package to see if everything is there. If any pieces are
- missing, contact the retailer from whom you bought QuickC. In the package,
- you should find the following items: %@NL@%
- %@NL@%
- %@AI@%Registration card:%@AE@% there are many advantages to being a registered owner of
- QuickC version 2.5, including notification of future software releases and
- easy access to customer assistance. Please take the time to fill out and
- mail the registration card now. %@NL@%
- %@NL@%
- %@AI@%Disks:%@AE@% eight 5.25-inch floppy disks or four 3.5-inch floppy disks. The
- distribution disk labeled "Setup" contains a file named PACKING.LST that
- lists the location and description of all disk files in the Microsoft QuickC
- package. %@NL@%
- %@NL@%
- %@AI@%Up and Running:%@AE@% the book you're reading now. It explains how to install and
- use QuickC. %@NL@%
- %@NL@%
- %@AI@%C for Yourself:%@AE@% this book is written for programmers who know at least one
- language (such as BASIC or Pascal) but who don't know C. Part 1, "Learning
- C," is a tutorial that explains how to program in C. Many examples are
- included. Part 2, "Using C," examines further the library functions that
- perform input and output, the functions that create graphics, and new
- features such as real coordinate graphics, presentation graphics, fonts, and
- in-line assembly. The appendixes summarize the C language and QuickC library
- functions. %@NL@%
- %@NL@%
- %@AI@%Microsoft QuickC Tool Kit:%@AE@% this book explains the individual tools and
- utilities that accompany QuickC. Beginners probably won't need to refer to
- this book while they're learning the fundamentals of C. Advanced C
- programmers should turn to this book for detailed information about
- compiling, linking, creating libraries, maintaining multiple-module
- programs, and more. %@NL@%
- %@NL@%
- %@NL@%
- %@NL@%
- %@NL@%
- %@NL@%
- %@NL@%
- %@CR:C6A00020001 @%%@1@%%@AB@%Chapter 2 Installing QuickC%@AE@%%@EH@%%@NL@%
- %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
- %@NL@%
- This chapter tells you how to install the QuickC Compiler on your system.
- The SETUP.EXE program on the Setup distribution disk performs the
- installation. %@NL@%
- %@NL@%
- SETUP.EXE does two things. First, it copies several programs (the compiler,
- the linker, the library manager, the help system, and others) from the
- distribution disks to your hard disk. Second, it creates one or more
- combined libraries. You can't program in C without a library. %@NL@%
- %@NL@%
- This chapter also explains why it's necessary to build combined libraries
- and how the components fit together. %@NL@%
- %@NL@%
- If you follow the instructions, when you finish the chapter you'll have a
- working version of QuickC on your system and you'll be ready to start
- programming in C. %@NL@%
- %@NL@%
- %@NL@%
- %@2@%%@CR:C6A00020002 @%%@AB@%A Quick Overview%@AE@%%@EH@%%@NL@%
- %@NL@%
- There are four steps to installing QuickC: %@NL@%
- %@NL@%
- %@NL@%
- 1. Make backup copies of all distribution disks.%@NL@%
- %@NL@%
- 2. Read the first section of the README.DOC file for information on
- installing QuickC. If there are any corrections to this book, they're
- listed at the beginning of README.DOC.%@NL@%
- %@NL@%
- 3. Run SETUP.EXE, which is an interactive program. The questions you
- answer determine the QuickC environment that is installed. Default
- answers are listed in brackets. At the bottom of each screen is a
- brief synopsis of what each question means.%@NL@%
- %@NL@%
- 4. Adjust your system and environment variables. SETUP.EXE creates two
- files: NEW-VARS.BAT and NEW-CONF.SYS. Add the information from the
- NEW-VARS.BAT file to your AUTOEXEC.BAT file. If you'd prefer not to
- make the changes permanent, you can run NEW-VARS.BAT as a batch file.
- Change your CONFIG.SYS file if the %@AS@% files %@AE@% value and %@AS@% buffers %@AE@% value
- are currently smaller than the values in NEW-CONF.SYS. After modifying
- these files, reboot.%@NL@%
- %@NL@%
- %@NL@%
- The process is not difficult and each screen provides helpful guidance. If
- you have enough DOS and programming experience to complete these four steps
- without further assistance, we encourage you to do so. (If you get stuck,
- return to this chapter.) You may then skip ahead to Chapter 3, "Using
- QuickC." %@NL@%
- %@NL@%
- ────────────────────────────────────────────────────────────────────────────%@NL@%
- NOTE
-
- %@AI@%If you make a mistake during the setup process, just run the program again.
- %@AI@%SETUP.EXE never erases files from the distribution disks.%@AE@%%@NL@%
- ────────────────────────────────────────────────────────────────────────────%@NL@%%@NL@%
- %@NL@%
- %@NL@%
- %@2@%%@CR:C6A00020003 @%%@AB@%Running SETUP%@AE@%%@EH@%%@NL@%
- %@NL@%
- Before you run SETUP, back up the distribution disks using the DOS COPY
- command or the DISKCOPY program. Then read the first part of the README.DOC
- file by loading it into a word processor or by using the TYPE command: %@NL@%
- %@NL@%
- %@AS@% TYPE README.DOC | MORE%@AE@%%@NL@%
- %@NL@%
- When you are ready to install QuickC, insert the Setup disk in drive A and
- then change to that drive (type %@AS@% A:%@AE@% ). At the DOS command line, type %@NL@%
- %@NL@%
- %@AS@% SETUP%@AE@%%@NL@%
- %@NL@%
- ────────────────────────────────────────────────────────────────────────────%@NL@%
- NOTE
-
- %@AI@%The following instructions assume that you plan to install QuickC on a
- %@AI@%system that has at least one floppy-disk drive and one hard-disk drive.%@AE@%%@NL@%
- ────────────────────────────────────────────────────────────────────────────%@NL@%%@NL@%
- %@NL@%
- %@NL@%
- %@4@%%@AB@%Correcting Mistakes%@AE@%%@EH@%%@NL@%
- %@NL@%
- Each setup screen ends by asking if you want to change any of the options.
- If you press Y, you can correct any of the answers you entered. %@NL@%
- %@NL@%
- To exit the SETUP program at any time, press CTRL+C. %@NL@%
- %@NL@%
- %@NL@%
- %@4@%%@AB@%Understanding Libraries%@AE@%%@EH@%%@NL@%
- %@NL@%
- Compared to other programming languages, C is very lean. It contains only a
- few dozen keywords and operators. To print something on the screen, for
- example, you call the %@AB@%printf%@AE@% function, which is %@AI@%not%@AE@% a keyword or an
- operator. It's not included in the C language proper. Strictly speaking,
- %@AB@%printf%@AE@% is a "library function." %@NL@%
- %@NL@%
- When you link a program, the linker looks in the current library for any
- functions that were not defined in the program. If your source file calls
- %@AB@%printf%@AE@%, for example, the linker looks in the library for the machine code
- that executes the function, adds it to the executable program, and resolves
- any references to %@AB@%printf%@AE@%. %@NL@%
- %@NL@%
- A library, then, is just a set of commonly used functions that have been
- gathered into one place. The American National Standards Institute (ANSI)
- defines a great number of library functions (including %@AB@%printf%@AE@%). Microsoft
- QuickC adds even more. In C, the keywords and operators number in the
- dozens, while the library functions number in the hundreds. Incidentally,
- you can add your own heavily used functions to the library (or combine them
- into a separate library) if you wish. See %@AI@%Microsoft QuickC Tool Kit%@AE@% for more
- information on using the Library Manager (LIB.EXE). %@NL@%
- %@NL@%
- One of the key jobs performed by SETUP.EXE is building at least one large
- "combined library." Individual smaller parts of the library are called
- "component libraries." The two component libraries you must have are the
- memory model library and the math package library. The two additional
- component libraries containing graphics functions are optional. %@NL@%
- %@NL@%
- You'll ultimately use one of the combined libraries when you compile and
- link a program. %@NL@%
- %@NL@%
- %@NL@%
- %@4@%%@AB@%SETUP Options%@AE@%%@EH@%%@NL@%
- %@NL@%
- SETUP has two options for shortcuts: /H and /L. You should %@AI@%not%@AE@% use these
- options the first time you run SETUP. %@NL@%
- %@NL@%
- Use the /L option after you have already installed QuickC and you want to
- build additional combined libraries without going through the entire setup
- process. %@NL@%
- %@NL@%
- Combined libraries are described above (see "Understanding Libraries"). If
- you wish to add more libraries in the future, use the /L option: %@NL@%
- %@NL@%
- %@AS@% SETUP /L%@AE@%%@NL@%
- %@NL@%
- The /H option suppresses the SETUP help information sent to the screen. If
- you install QuickC again, you can bypass the help information by using the
- /H option: %@NL@%
- %@NL@%
- %@AS@% SETUP /H%@AE@%%@NL@%
- %@NL@%
- %@NL@%
- %@3@%%@CR:C6A00020004 @%%@AB@%SETUP Stage One%@AE@%%@EH@%%@NL@%
- %@NL@%
- Before SETUP can install QuickC, it needs some information about your system
- and the type of programming you intend to do. This first stage of SETUP is a
- series of questions split into three screens. %@NL@%
- %@NL@%
- %@NL@%
- %@4@%%@AB@%First Screen: The Libraries%@AE@%%@EH@%%@NL@%
- %@NL@%
- The first screen asks these questions: %@NL@%
- %@NL@%
- %@AS@% Source of disk images [A:]:
- %@AS@% Math Options: Emulator [Y]:8087 [N]:
- %@AS@% Memory Models:Small[Y]:Medium[N]:Compact[N]:Large[N]:
- %@AS@% Delete the component libraries when finished [Y]:
- %@AS@% Include in combined libraries: GRAPHICS.LIB [N]:PGCHART.LIB [N]
- %@AS@%
- %@AS@% Do you want to change any of the above options [Y]:%@AE@%%@NL@%
- %@NL@%
- The questions appear on the screen one at a time. An explanation of each
- option appears at the bottom of the screen, unless you added the /H option
- when you ran SETUP. Answer the questions by typing in your responses and
- pressing ENTER. %@NL@%
- %@NL@%
- Each question ends with a default answer inside square brackets (%@AS@%[Y]%@AE@%, for
- example). Press ENTER to accept the default. %@AI@%If you are unsure of the proper
- %@AI@%reply for any of these questions, consider the default a good place to
- %@AI@%start.%@AE@% If you later find you would have preferred to make another choice,
- you can always run SETUP again. %@NL@%
- %@NL@%
- Each screen concludes by asking if you want to change any of your choices.
- When you're satisfied, press N (the default answer is Y, which returns you
- to the first question on the screen). If you start over, the default answers
- become the choices you made previously. %@NL@%
- %@NL@%
- %@NL@%
- %@4@%%@AB@%Which Disk Drive?%@AE@%%@EH@%%@NL@%
- %@NL@%
- The first question on the first screen asks where you're starting from (the
- drive containing the distribution disks): %@NL@%
- %@NL@%
- %@AS@% Source of disk images [A:]:%@AE@%%@NL@%
- %@NL@%
- %@NL@%
- %@4@%%@AB@%Which Math Library?%@AE@%%@EH@%%@NL@%
- %@NL@%
- Your answer to the second question determines which math component libraries
- will be included in the combined library: %@NL@%
- %@NL@%
- %@AS@% Math Options: Emulator [Y]: 8087 [N]:%@AE@%%@NL@%
- %@NL@%
- Some computers contain an 8087 or 80287 math coprocessor chip and some
- don't. %@NL@%
- %@NL@%
- If your machine is equipped with a coprocessor, linking your programs with
- the combined library tailored for the 8087 will speed up all floating-point
- calculations. However, these programs will run only on a machine that has an
- 8087 or 80287 chip. %@NL@%
- %@NL@%
- Programs linked with the emulator library, on the other hand, will run on
- any computer, whether it has a coprocessor or not. The emulator library does
- check for the presence of a math coprocessor. If the computer has a
- coprocessor, it performs all floating-point math operations. If no
- coprocessor is installed, the emulator library "emulates" (imitates) the
- actions of a coprocessor. %@NL@%
- %@NL@%
- If you're not sure which math library to include, choose the emulator
- library because it's the most flexible. %@NL@%
- %@NL@%
- You may include both math libraries, but doing so doubles the number of
- combined libraries SETUP builds, thus doubling the time it takes to install
- QuickC. If you intend to install all possible library configurations, you'll
- need approximately 6 megabytes of available space on your hard disk. If you
- install just one library, you'll need about 2.7 megabytes of free space. %@NL@%
- %@NL@%
- %@NL@%
- %@4@%%@AB@%Which Memory Model?%@AE@%%@EH@%%@NL@%
- %@NL@%
- The next question asks which memory models you plan to use: %@NL@%
- %@NL@%
- %@AS@% Memory Models: Small [Y]: Medium [N]: Compact [N]: Large [N]:%@AE@%%@NL@%
- %@NL@%
- The small memory model is the default. If you're in a hurry to install
- QuickC, accept the default answer by pressing ENTER four times and bypass
- the explanation below. Should you discover that you need additional memory
- for your programs, you can run the SETUP program again. If you're curious
- about memory models, read on. %@NL@%
- %@NL@%
- The 8086 processor and its relatives access memory in 64K blocks called
- "segments." To move outside of the current 64K segment requires additional
- machine instructions. Also, an address within the 64K segment can be
- specified with only two bytes. If you wish to access more than 64K of memory
- locations, their addresses must include additional bytes (which makes
- pointer variables longer and program execution slower). %@NL@%
- %@NL@%
- C programs have two parts: the code (machine instructions) and the data
- (variables and constants). If you write programs that fit either the code or
- the data entirely within one 64K segment of memory, the program will execute
- faster and use less memory. However, if you need to use multiple memory
- segments for the code or the data, you may, although the program will run
- more slowly. %@NL@%
- %@NL@%
- The various configurations of memory usage are called "memory models."
- QuickC supports six standard memory models. Table 2.1 illustrates the
- relationship between the six available memory models and the limits placed
- on their code and data segments. %@NL@%
- %@NL@%
- %@AB@%Table 2.1 %@AB@%Memory Models%@AE@%%@AE@%
-
- %@TH: 9 538 02 14 25 37 @%
- Memory Model Code Segment Limit Data Segment Limit
- %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
- Tiny 64K total Code and Data ─
- Small 64K 64K
- Medium None 64K
- Compact 64K None
- Large None None
- Huge None None
- %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
- %@TE: 9 538 02 14 25 37 @%
-
- For a great many applications, the small memory model suffices. The tiny
- memory model is similar to the small model except it is limited to 64K per
- program (including both code and data) and it produces .COM files instead of
- .EXE files. If you're working on a large database manager, you might want
- one of the models that provides unlimited data segments (compact, large, or
- huge). If you're writing a program with many functions, you might want to
- remove the limit on the code segment (medium, large, or huge). %@NL@%
- %@NL@%
- The huge memory model uses the same library as the large model, so the SETUP
- program offers only four choices. The difference between large and huge is
- that %@NL@%
- %@NL@%
- the huge model allows individual arrays to exceed 64K, whereas the large
- model limits arrays to 64K. %@NL@%
- %@NL@%
- Any or all of these memory models may be selected, but SETUP.EXE will build
- a separate combined library for each model. For example, if you choose the
- small memory model and the math emulator, the library file SLIBCE.LIB is
- created. If you choose the medium model and the 8087 math package,
- MLIBC7.LIB is created. The small memory model libraries start with the
- letter "S," medium with "M," compact with "C," and large with "L."
- Similarly, the emulator math package is shown by a final "E" in the file
- name, the 8087 package by a "7." %@NL@%
- %@NL@%
- Given four memory models and two math packages, you can create a total of
- eight combined libraries. But the more combined libraries you create, the
- more space they'll take on your hard disk and the longer the installation
- process will take. %@NL@%
- %@NL@%
- The first time you install QuickC, create only one or two combined
- libraries. If you find a need for other memory models or math packages, just
- run the SETUP program again. %@NL@%
- %@NL@%
- %@NL@%
- %@4@%%@AB@%Include Graphics Libraries?%@AE@%%@EH@%%@NL@%
- %@NL@%
- The graphics library GRAPHICS.LIB contains numerous functions for drawing
- lines, rectangles, circles, and other shapes. If you plan to write programs
- that use these functions, press Y to answer the first of these two
- questions: %@NL@%
- %@NL@%
- %@AS@% Include in combined libraries:GRAPHICS.LIB[N]: PGCHART.LIB[N]: %@AE@%%@NL@%
- %@NL@%
- However, if you plan to write programs that use text output only, then you
- probably don't need GRAPHICS.LIB taking up room on your disk. Press N to
- omit the graphics library. (If you very rarely need graphics functions, you
- can omit the graphics library and, whenever you need the functions,
- explicitly link the graphics library GRAPHICS.LIB. See the %@AI@%Microsoft QuickC
- %@AI@%Tool Kit%@AE@% manual for more information about linking with a specific library.)
- %@NL@%
- %@NL@%
- The PGCHART.LIB library contains presentation graphics functions for
- creating high-resolution graphs (line graphs, bar charts, column charts,
- scatter diagrams, and pie charts). Again, if you want to display such
- graphics in your programs, press Y to include this component library. If
- you'll use presentation graphics rarely or not at all, press N to omit this
- library. %@NL@%
- %@NL@%
- %@NL@%
- %@4@%%@AB@%Second Screen: Extra Files%@AE@%%@EH@%%@NL@%
- %@NL@%
- The next screen asks the following questions about copying additional files
- to your hard disk: %@NL@%
- %@NL@%
- %@AS@% Install Microsoft Mouse [Y]:
- %@AS@% Copy documentation files [Y]:
- %@AS@% Copy the DOS patch files [N]:
- %@AS@% Copy sample C programs [N]:
- %@AS@% Copy the QuickC tutorial files [N]:
- %@AS@%
- %@AS@% Do you want to change any of the above options [Y]:%@AE@%%@NL@%
- %@NL@%
- SETUP will copy these extra files to your hard disk if you want them. %@NL@%
- %@NL@%
- As before, each of these questions is accompanied by an explanation at the
- bottom of your screen to help you decide if these files would be useful. %@NL@%
- %@NL@%
- %@NL@%
- %@4@%%@AB@%Third Screen: The Directories%@AE@%%@EH@%%@NL@%
- %@NL@%
- The final set of questions asks for the names of directories in which to
- store the various files. %@NL@%
- %@NL@%
- %@AS@% Directory for Executable files [C:\QC25\BIN]:
- %@AS@% Directory for Libraries [C:\QC25\LIB]:
- %@AS@% Directory for Include files [C:\QC25\INCLUDE]:
- %@AS@% Directory for Sample files [C:\QC25\SAMPLES]:
- %@AS@% Directory for Tutorial files [C:\QC25\TUTORIAL]:
- %@AS@%
- %@AS@% Do you want to change any of the above options [Y]:%@AE@%%@NL@%
- %@NL@%
- You don't have to choose any of the default options. You might decide you
- want your executable programs in C:\QC25\BIN and your source files in
- C:\C_CODE, for example. Type in the names of directories you want SETUP to
- use (including the drive name in the path). If the directories don't exist,
- SETUP asks if you want to create them. %@NL@%
- %@NL@%
- QuickC can be used in conjunction with the Microsoft C Professional
- Development System version 6.0. To use QuickC with Microsoft C, choose the
- directories where Microsoft C stores executable files, libraries, and header
- files: their default names are C:\C600\BIN, C:\C600\LIB, and
- C:\C600\INCLUDE; corresponding QuickC directories are C:\QC25\BIN,
- C:\QC25\LIB, and C:\QC25\INCLUDE. %@NL@%
- %@NL@%
- %@NL@%
- %@4@%%@AB@%Checking the Available Disk Space%@AE@%%@EH@%%@NL@%
- %@NL@%
- Before moving on to stage two, the SETUP program checks your hard disk to
- see how much free space is available. If you don't have enough room to
- install QuickC (the amount needed varies according to the options you've
- chosen), an error message tells you how much space is required for the files
- you've requested. If you attempt to install all possible libraries, you'll
- need approximately 6 megabytes. If you install just one combined library,
- you'll need roughly 2.7 megabytes. %@NL@%
- %@NL@%
- If you don't have enough room on your hard disk, you have two choices.
- First, you can delete files from the hard disk until there's enough room for
- the libraries you want to create. Second, you can reduce the number of
- libraries you request (or you can choose not to copy the samples and
- documentation files) to cut down the amount of space you need. Either way,
- you'll have to run SETUP again. %@NL@%
- %@NL@%
- %@NL@%
- %@3@%%@CR:C6A00020005 @%%@AB@%SETUP Stage Two%@AE@%%@EH@%%@NL@%
- %@NL@%
- Now that you've specified your system and programming needs, SETUP goes to
- work. This stage requires you to swap the distribution disks in and out of
- the drive. Insert the disks as SETUP asks for them and press ENTER. If you
- put in the wrong disk, SETUP will ask again for the proper disk. %@NL@%
- %@NL@%
- At this point, all SETUP needs is the go-ahead from you. It starts building
- the combined libraries you requested, placing them in the directories you
- specified. %@NL@%
- %@NL@%
- %@NL@%
- %@3@%%@CR:C6A00020006 @%%@AB@%SETUP Stage Three%@AE@%%@EH@%%@NL@%
- %@NL@%
- When SETUP finishes creating the combined libraries, it creates two files:
- NEW-VARS.BAT and NEW-CONF.SYS. To install these files permanently, you must
- now adjust the DOS environment and modify both your AUTOEXEC.BAT and
- CONFIG.SYS files. %@NL@%
- %@NL@%
- ────────────────────────────────────────────────────────────────────────────%@NL@%
- NOTE
-
- %@AI@%If you use other languages that have their own LINK.EXE program, you may not
- %@AI@%want to put the QuickC linker in your path. If this is the case, you can
- %@AI@%modify CONFIG.SYS and run NEW-VARS.BAT each time you use QuickC.%@AE@%%@NL@%
- ────────────────────────────────────────────────────────────────────────────%@NL@%%@NL@%
- %@NL@%
- %@NL@%
- %@4@%%@AB@%Changing AUTOEXEC.BAT%@AE@%%@EH@%%@NL@%
- %@NL@%
- The file NEW-VARS.BAT created by SETUP might look something like this: %@NL@%
- %@NL@%
- %@AS@% PATH=C:\QC25\BIN;C:\DOS;C:\MYEXE;C:\WIN386;C:\WORD
- %@AS@% set LIB=C:\QC25\LIB
- %@AS@% set INCLUDE=C:\QC25\INCLUDE%@AE@%%@NL@%
- %@NL@%
- PATH is a system variable that tells your computer where to find executable
- programs. The LIB and INCLUDE variables tell QuickC where to find the
- libraries and the include files. %@NL@%
- %@NL@%
- To make the change permanent, load your current AUTOEXEC.BAT file into an
- editor or word processor (you'll find AUTOEXEC.BAT in the root directory),
- add the new path names, and save the modified file. %@NL@%
- %@NL@%
- You can edit the AUTOEXEC.BAT file with the QuickC editor if you wish.
- Change to the directory containing the QC.EXE program (for example, type %@AS@% CD
- %@AS@%\QC25\BIN%@AE@% ) and type %@AS@% QC \AUTOEXEC.BAT %@AE@%(the backslash indicates that the
- file is in the root directory). Then use the File menu Merge command to
- merge NEW-VARS.BAT into AUTOEXEC.BAT. %@NL@%
- %@NL@%
- In most cases, it is best to change the AUTOEXEC.BAT file and reboot.
- How-ever, if you use other languages and other compilers, you may wish to
- leave the AUTOEXEC.BAT file alone and run the NEW-VARS.BAT file before each
- QuickC session. %@NL@%
- %@NL@%
- If you want to use the 8087 math library instead of the emulator library,
- use the /FPi87 option as a custom flag within the QuickC Linker Flags dialog
- box or at the command line using QCL. If you compile and link from the
- QuickC environment, either add the line below to your AUTOEXEC.BAT file or
- type it at the command line: %@NL@%
- %@NL@%
- %@AS@% SET CL=/FPi87%@AE@%%@NL@%
- %@NL@%
- To maintain compatibility between the QuickC and Microsoft C compilers, the
- CL environment variable is used. If you include options that the Microsoft C
- compiler recognizes but QuickC doesn't, QuickC issues an error message. %@NL@%
- %@NL@%
- %@NL@%
- %@4@%%@AB@%Modifying CONFIG.SYS%@AE@%%@EH@%%@NL@%
- %@NL@%
- The NEW-CONF.SYS file might look like this: %@NL@%
- %@NL@%
- %@AS@% files=20
- %@AS@% buffers=10%@AE@%%@NL@%
- %@NL@%
- You need to be sure that the %@AS@% files %@AE@% and %@AS@% buffer %@AE@% values are large enough to
- contain QuickC. Load your CONFIG.SYS file into an editor or word processor
- (again, it should be in the root directory), change the two lines that refer
- to files and buffers, and save the modified file. If your current CONFIG.SYS
- file has higher numbers ( %@AS@%files = 30%@AE@%, for example), you can leave the higher
- value in effect. The numbers in NEW-CONF.SYS are minimums; you may safely
- use higher values. %@NL@%
- %@NL@%
- ────────────────────────────────────────────────────────────────────────────%@NL@%
- NOTE
-
- %@AI@%Merely changing the AUTOEXEC.BAT and CONFIG.SYS files does not affect the
- %@AI@%current DOS environment. To put the changes into effect, you must reboot
- %@AI@%your machine by powering off and then on or by pressing CTRL+ALT+DEL%@AI@%.%@AE@%%@AE@%%@NL@%
- ────────────────────────────────────────────────────────────────────────────%@NL@%%@NL@%
- %@NL@%
- After installing QuickC, changing the files, and rebooting, you can proceed
- to Chapter 3, "Using QuickC." %@NL@%
- %@NL@%
- %@NL@%
- %@NL@%
- %@NL@%
- %@NL@%
- %@NL@%
- %@CR:C6A00030001 @%%@1@%%@AB@%Chapter 3 Using QuickC%@AE@%%@EH@%%@NL@%
- %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
- %@NL@%
- If you followed the instructions in Chapter 2, "Installing QuickC," you now
- have a working version of the QuickC Compiler and are ready to write your
- first program. This chapter introduces the QuickC environment─a powerful
- tool to help you write and test programs. %@NL@%
- %@NL@%
- In this chapter you'll work through a sample compiling and linking session.
- When you finish, you will have written, saved, built, and tested a working
- program. %@NL@%
- %@NL@%
- If you'd prefer to experiment on your own or if you've previously used an
- older version of QuickC, you can skip this chapter (or skim through it). We
- strongly suggest, however, that if you do nothing else, review the next
- chapter, "Getting Help." In addition, we recommend that all QuickC users run
- the LEARN program, which teaches how to use the QuickC environment. %@NL@%
- %@NL@%
- %@NL@%
- %@2@%%@CR:C6A00030002 @%%@AB@%The QuickC Environment%@AE@%%@EH@%%@NL@%
- %@NL@%
- QuickC is a window-based programming environment that integrates a text
- editor, a compiler, a linker, a debugger utility, a make utility, and an
- on-line help database. This chapter introduces and describes the following
- aspects of QuickC: %@NL@%
- %@NL@%
- %@AB@%Windows and Menus%@AE@% - The menu system allows you to quickly find the command
- or action you need. The first part of this chapter explains how to open and
- close windows and how to navigate the menus. It also defines certain terms
- used throughout the chapter.%@NL@%
- %@NL@%
- %@AB@%Editor%@AE@% - When you're writing source code, you'll spend a lot of time using
- the QuickC editor. If you know WordStar(R) commands, you'll know how to use
- the QuickC editor. If you'd prefer to customize the editor, you can use the
- MKKEY utility, which is explained in the "Customizing the Editor" section.%@NL@%
- %@NL@%
- %@AB@%Compiler/Linker%@AE@% - You can compile, link, and test a program without ever
- leaving the editor. QuickC's integrated environment saves you hours of
- development time. This part of the chapter defines and illustrates the
- various compiling and linking options.%@NL@%
- %@NL@%
- %@AB@%Debugger%@AE@% - The debugger allows you to set breakpoints, to monitor the status
- of key variables, and to trace program execution line by line. This section
- of the chapter provides a brief overview of the debugger utility. The LEARN
- program includes a lesson that provides more details about the new, advanced
- debugging enhancements.%@NL@%
- %@NL@%
- %@NL@%
- %@2@%%@CR:C6A00030003 @%%@AB@%Using Windows and Menus%@AE@%%@EH@%%@NL@%
- %@NL@%
- Even if you've never used windows and menus before, you'll find the QuickC
- programming environment easy to learn. %@NL@%
- %@NL@%
- This section introduces the QuickC environment. You'll learn how to control
- windows and to choose commands from the menus. %@NL@%
- %@NL@%
- %@NL@%
- %@3@%%@CR:C6A00030004 @%%@AB@%Getting Started%@AE@%%@EH@%%@NL@%
- %@NL@%
- To run QuickC, type %@NL@%
- %@NL@%
- %@AS@% QC%@AE@%%@NL@%
- %@NL@%
- at the DOS prompt. You'll immediately enter the QuickC editor. %@NL@%
- %@NL@%
- If you enter a file name after the %@AS@% QC %@AE@% command, for example, %@NL@%
- %@NL@%
- %@AS@% QC MYFILE%@AE@%%@NL@%
- %@NL@%
- QuickC automatically adds the extension .C that marks a C source file.
- Typing the line above causes QuickC to load MYFILE.C. %@NL@%
- %@NL@%
- If QuickC can't find the file you specified in the current directory, it
- asks if you want to create a new file. %@NL@%
- %@NL@%
- If you do not enter a file name after the %@AS@% QC %@AE@% command, QuickC opens an
- empty file named UNTITLED.C, which you can rename later or save with another
- name. %@NL@%
- %@NL@%
- %@NL@%
- %@4@%%@AB@%Command-Line Options%@AE@%%@EH@%%@NL@%
- %@NL@%
- Depending on your particular hardware, you may be required to include one of
- the following options on the command line after the %@AS@% QC %@AE@% command but before
- the file name, for example, %@AS@% QC /b MYPROG%@AE@%. %@NL@%
- %@NL@%
- %@AB@%Option%@AE@% %@AB@%Hardware%@AE@%
- %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
- %@AS@%/b%@AE@% For black-and-white systems, including
- Hercules(R) monochrome monitors, LCD
- screens, and black-and- white monitors.
-
- %@AS@%/g%@AE@% For AT-compatible systems that refresh
- the screen at a slower rate than the
- standard AT (including some COMPAQ(R)
- systems).
-
- %@AS@%/h%@AE@% For systems equipped with EGA-, VGA-, or
- MCGA-compatible graphics cards capable
- of displaying more than 25 lines of text.
- EGA cards can display 43 lines of text,
- VGA cards can display 50. You can use a
- Microsoft (or fully compatible) mouse
- with this option. If you encounter
- problems, contact the manufacturer of
- the mouse.
-
- %@AS@%/k%@AE@% Loads a key file with customized QuickC
- editor
- commands.
-
- %@AS@%/nohi%@AE@% For systems that don't support
- high-intensity colors (including LCD
- monochrome monitors and some Amdek(R)
- color monitors).
-
- %@NL@%
- %@3@%%@CR:C6A00030005 @%%@AB@%Using the Mouse and Keyboard%@AE@%%@EH@%%@NL@%
- %@NL@%
- You can enter all commands from the keyboard. If you own a Microsoft (or
- fully compatible) Mouse, you can choose to use either the keyboard or the
- mouse to enter commands. When this book explains a command, the two options
- are marked with icons of a key or a mouse as follows: %@NL@%
- %@NL@%
- Press the ALT key. %@NL@%
- %@NL@%
- Click the File menu, then click Save. %@NL@%
- %@NL@%
- Unless the right button is specifically mentioned, "clicking" means that you
- click the mouse's left button once. %@NL@%
- %@NL@%
- %@NL@%
- %@3@%%@CR:C6A00030006 @%%@AB@%Windows%@AE@%%@EH@%%@NL@%
- %@NL@%
- The system of windows and menus is simple to use and intuitive. Many
- programmers can learn how to use the QuickC environment without learning the
- terms that describe the various menus and buttons. In addition, if you're
- confused about windows or menus, you can almost always call up a help window
- that explains how a menu works (see Chapter 4, "Getting Help"). However, if
- you want to read further in this chapter, you'll have to understand the
- terms that are used. %@NL@%
- %@NL@%
- Figure 3.1 shows a typical QuickC screen, with labels that describe its
- parts. Some of the parts provide information only. For example, if the CAPS
- LOCK key is on, a letter %@AS@% C %@AE@% appears in the bottom right corner. The letter %@AS@%
- %@AS@%C %@AE@% is informational (it tells you the CAPS LOCK key is on). Other parts of a
- window perform actions triggered by a specific key or mouse action. For
- example, if you click the little box in the upper-left corner of a window,
- the window closes. The box is not informational; it's active. %@NL@%
- %@NL@%
- %@AU@%(This figure may be found in the printed book.)%@AE@%%@NL@%
- %@NL@%
- The parts of a window, their status, and their use are listed in Table 3.1.
- %@NL@%
- %@NL@%
- %@AB@%Table 3.1 %@AB@%Parts of a Window%@AE@%%@AE@%
-
- %@TH: 25 1346 02 17 22 37 @%
- Name Status Use
- %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
- Close button Active Closes the current window (the
- source window cannot be closed).
- Appears in upper-left corner.
-
- Menu bar Active Lists names of the available menus.
-
- Title bar Informational Shows name of the window (the
- source window title bar lists the
- file currently being edited).
-
- Source window Active Contains source code for the
- program you're writing. Seven other
- windows are supported: Debug, Help,
- Locals, Registers, Notepad, Output,
- and Errors.
-
- Maximize button Active Shrinks or enlarges the current
- window.
-
- Reference bar Informational/ Lists shortcut keystrokes (keyboard
- Active users) and direct commands to
- QuickC (mouse users).
-
- %@TE: 25 1346 02 17 22 37 @%
-
- %@AB@%Table %@AB@%3.1 (continued)%@AE@%%@AE@%
-
- %@TH: 25 1519 02 24 15 37 @%
- Name Status Use
- %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
- Scroll bars Active Indicate your position in the
- current file. If you click in the
- gray area on either side of the
- position marker, you move in that
- direction. If you click the arrows,
- you move one line (or one character)
- in that direction. If you click and
- drag the position indicator, you
- can move anywhere within the file.
-
- Line/Column Informational Show the current line and column of
- indicators the text cursor.
- C means CAPS LOCK is on.
- N means NUM LOCK is on.
-
- File status indicators Informational R means the file is set to Read
- Only status.
- D means Debugging History is on.
- I means the debugging history
- includes user input.
-
- %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
-
- %@TE: 25 1519 02 24 15 37 @%
-
- %@NL@%
- %@4@%%@AB@%Using the Menu Bar%@AE@%%@EH@%%@NL@%
- %@NL@%
- To choose a command from a menu, you "pull down" or "open" the menu and
- choose the command you want: %@NL@%
- %@NL@%
- %@NL@%
- 1. Press the ALT key to activate the menu bar.%@NL@%
- %@NL@%
- 2. Press the highlighted character in the menu name (F = File, for
- example).%@NL@%
- %@NL@%
- 3. Press the highlighted character in the item name (in the File menu, S
- = Save, for example).%@NL@%
- %@NL@%
- %@NL@%
- Or follow these steps: %@NL@%
- %@NL@%
- %@NL@%
- 1. Press the ALT key.%@NL@%
- %@NL@%
- 2. Use the RIGHT and LEFT arrow keys to move to the menu you want.%@NL@%
- %@NL@%
- 3. Use the UP and DOWN arrow keys to highlight the command.%@NL@%
- %@NL@%
- 4. Press ENTER.%@NL@%
- %@NL@%
- %@NL@%
- Or: %@NL@%
- %@NL@%
- %@NL@%
- 1. Open the menu by clicking the menu name.%@NL@%
- %@NL@%
- 2. Click the command.%@NL@%
- %@NL@%
- %@NL@%
- %@NL@%
- %@4@%%@AB@%Making the Menu Disappear%@AE@%%@EH@%%@NL@%
- %@NL@%
- If at any point you decide that you don't want to choose a command from a
- menu, you can make the menu disappear: %@NL@%
- %@NL@%
- Press the ESC key. %@NL@%
- %@NL@%
- Click somewhere on the screen outside of the menu. %@NL@%
- %@NL@%
- %@NL@%
- %@4@%%@AB@%Shortcut Keys%@AE@%%@EH@%%@NL@%
- %@NL@%
- In the menus below, you'll notice that certain menu items are followed by
- names of keys. These are the "shortcut keys" for heavily used commands. For
- example, the Run menu Restart command is followed by SHIFT+F5, which means
- that instead of opening the Run menu and choosing the Restart command, you
- can instead hold down the SHIFT key and press F5. %@NL@%
- %@NL@%
- ────────────────────────────────────────────────────────────────────────────%@NL@%
- NOTE
-
- %@AI@%The reference bar displays commonly used shortcut keys. In addition, the
- %@AI@%inside front cover of this book lists the important shortcut keys for easy
- %@AI@%reference.%@AE@%%@NL@%
- ────────────────────────────────────────────────────────────────────────────%@NL@%%@NL@%
- %@NL@%
- %@NL@%
- %@3@%%@CR:C6A00030007 @%%@AB@%Menus%@AE@%%@EH@%%@NL@%
- %@NL@%
- The menu bar contains ten menus, which you can pull down at any time. If you
- don't know what a menu does, invoke the online help system by highlighting
- the menu title (or highlighting a command within a menu) and pressing F1 or
- clicking the right mouse button. QuickC uses the following menus: %@NL@%
- %@NL@%
- %@TH: 85 5504 01 37 39 @%
- %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
- %@AU@%(Please refer to the printed book.)%@AE@% The File menu controls files,
- allowing you to clear the source
- window (New), load an existing source
- file (Open), append a file to the
- source code in memory (Merge), save
- the current file (Save), rename the
- current file (Save As), print the
- source code (Print), temporarily quit
- to DOS (DOS Shell) and return to
- QuickC by typing EXIT at the command
- line, or permanently exit QuickC
- (Exit).
-
- %@AU@%(Please refer to the printed book.)%@AE@% From the Edit menu you manipulate
- text by deleting, cutting, copying,
- and pasting lines of code. You can
- also set Read Only status to protect
- source files.
-
- %@AU@%(Please refer to the printed book.)%@AE@% The View menu controls the visible
- screen. You can rapidly switch
- between multiple modules (Source),
- read through include files (Include)
- make visible the output screen
- (Output Screen), expand the source
- window (Maximize), or open and close
- the various windows (Windows).
-
- %@AU@%(Please refer to the printed book.)%@AE@% The Search menu invokes the commands
- that find or replace text or
- functions in source files. It also
- moves to a specified line and
- searches for the next source line
- that caused a compiler error.
-
- %@AU@%(Please refer to the printed book.)%@AE@% The Make menu allows you to compile
- (Compile) or to compile and link
- (Build) programs. From this menu, you
- also create or edit program lists
- that name the components of a
- multimodule program.
-
- %@AU@%(Please refer to the printed book.)%@AE@% Once a program is compiled and
- residing in memory, use the Run menu
- to run it. You can run it from
- beginning to end, selectively run
- individual sections, or trace through
- the program line by line.
-
- %@AU@%(Please refer to the printed book.)%@AE@% If your program contains logic errors,
- the Debug menu allows you to set
- breakpoints, watchpoints, and watch
- values. In addition, you can keep
- track of variables and their changing
- values. (This feature means there's
- no need to sprinkle %@AB@%printf%@AE@% functions
- throughout your program just to watch
- variables as they change values.)
-
- %@AU@%(Please refer to the printed book.)%@AE@% The Utility menu allows you to run
- DOS commands and programs from within
- the QuickC environment. You can run
- the online QuickC tutorial ("Learn
- QuickC"), or if you find that you use
- certain programs often, you may want
- to add them to the Utility menu
- (Customize Menu). For example, you
- can add your favorite program editor
- to this menu if you wish.
-
- %@AU@%(Please refer to the printed book.)%@AE@% The items on the Options menu control
- the integrated environment. For
- example, the Options menu Color
- command allows you to change the
- colors used on the screen. The
- Options menu Make command controls
- flags that affect the actions of the
- compiler and linker.
-
- %@AU@%(Please refer to the printed book.)%@AE@% The Help menu is one route to the
- online help system. For more about
- this topic, see Chapter 4, "Getting
- Help."
-
- %@TE: 85 5504 01 37 39 @%
-
- %@NL@%
- %@4@%%@AB@%Short Menus and Full Menus%@AE@%%@EH@%%@NL@%
- %@NL@%
- If you open the Options menu, you'll see one of the two menus below: %@NL@%
- %@NL@%
- %@TH: 2 220 01 37 39 @%
- %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
- %@AU@%(Please refer to the printed book.)%@AE@% %@AU@%(Please refer to the printed book.)%@AE@%
- %@TE: 2 220 01 37 39 @%
-
- When six commands are listed under Options and a dot appears beside Full
- Menus, it means full menus are turned on. When the Options menu holds only
- two commands and Full Menus has no dot, short menus are in effect. %@NL@%
- %@NL@%
- To change from full menus to short menus or vice versa, choose the Full
- Menus command. The command is a toggle button; that is, it changes from on
- to off, or off to on, when pressed. %@NL@%
- %@NL@%
- The short menus contain all the commands you need to write, compile, and run
- a C program. The short menus may seem easier to use, especially for
- beginners. If you prefer to see every possible option, you should enable
- Full Menus. The choice is yours. %@NL@%
- %@NL@%
- ────────────────────────────────────────────────────────────────────────────%@NL@%
- NOTE
-
- %@AI@%When you set preferences from the Options menu─full menus, memory models,
- %@AI@%compile options, and so on─your choices are saved in the current directory
- %@AI@%in a file called QC.INI. If you set an option, it stays set from one QuickC
- %@AI@%session to the next, or until you change it.%@AE@%%@NL@%
- ────────────────────────────────────────────────────────────────────────────%@NL@%%@NL@%
- %@NL@%
- %@NL@%
- %@4@%%@AB@%Shaded Commands%@AE@%%@EH@%%@NL@%
- %@NL@%
- When a command within a menu is shaded, it is unavailable. You can't use it.
- %@NL@%
- %@NL@%
- For example, when you first run QuickC and haven't yet compiled or linked a
- program, you can open the Search menu and see that both Next Error and
- Previous Error are shaded. You haven't done anything to generate errors, so
- there are no errors to view. %@NL@%
- %@NL@%
- %@NL@%
- %@4@%%@AB@%Ellipses%@AE@%%@EH@%%@NL@%
- %@NL@%
- When a command is followed by three periods (an ellipsis), it means QuickC
- needs more information before it executes the command. If a command is not
- followed by an ellipsis, choosing the command causes it to execute
- immediately. %@NL@%
- %@NL@%
- For example, the File menu contains both the Save and Save As... commands.
- Choosing Save causes QuickC to save the current file with the current name
- (the file name appearing at the top of the source window). Choosing Save
- As... causes a dialog box to appear (see the following section). Within that
- dialog box, you type the new name for your file. %@NL@%
- %@NL@%
- %@NL@%
- %@3@%%@CR:C6A00030008 @%%@AB@%Dialog Boxes%@AE@%%@EH@%%@NL@%
- %@NL@%
- Very often, invoking a menu command causes a dialog box to appear. For
- example, Figure 3.2 shows the dialog box opened by the Options menu Display
- command. %@NL@%
- %@NL@%
- %@AU@%(This figure may be found in the printed book.)%@AE@%%@NL@%
- %@NL@%
- ────────────────────────────────────────────────────────────────────────────%@NL@%
- NOTE
-
- %@AI@%Dialog boxes usually offer a set of shortcut keys. Press %@AI@%ALT %@AE@%%@AI@%to see which
- %@AI@%keys are active within a dialog box.%@AE@%%@AE@%%@NL@%
- ────────────────────────────────────────────────────────────────────────────%@NL@%%@NL@%
- %@NL@%
- Dialog boxes can contain one or more of the items on the following list. Use
- the TAB key to move between the various items in a dialog box. %@NL@%
- %@NL@%
- Option Buttons () Option buttons offer a list of choices,
- of which you choose only one. Use the
- arrow keys to move between the choices.
- In Figure 3.2, four option buttons allow
- you to pick the screen color you prefer.
- These are sometimes called "radio
- buttons" because they're similar to the
- buttons on a car radio: pushing in one
- button causes the others to pop out.
-
- Check Box [X] A check box is a yes/no switch. If the
- box is empty, the feature is turned off.
- If it contains a letter X, the feature
- is on. Press the SPACEBAR to turn a
- check box on or off. Use the TAB key to
- move between check boxes.
-
- Text Box [ ] A text box contains text that you enter.
- In Figure 3.2, the setting for Tab Stops
- requires you to type in the number of
- spaces to be inserted when you press the
- TAB key.
-
- Command Buttons Command buttons enclosed in angle
- < OK > brackets pass commands to the dialog box.
- The OK button means you're satisfied
- with the choices you've made. The Cancel
- button allows you to exit the dialog box
- with no changes. If one of the command
- buttons is highlighted, pressing ENTER
- invokes that command.
-
- List Boxes Certain dialog boxes display the current
- disk directory inside a list box. If the
- number of files is too large for the
- list box, you may use the arrow keys and
- PGUP/PGDN (keyboard) or click the scroll
- bar to move around the list (mouse).
-
- %@NL@%
- %@2@%%@CR:C6A00030009 @%%@AB@%Using the Editor%@AE@%%@EH@%%@NL@%
- %@NL@%
- QuickC's program editor is an important part of the QuickC environment. This
- part of the chapter provides a brief overview of its many functions. %@NL@%
- %@NL@%
- %@NL@%
- %@3@%%@CR:C6A00030010 @%%@AB@%Moving Around in a Source File%@AE@%%@EH@%%@NL@%
- %@NL@%
- Many of the keys within the editor act as you would expect. The PGDN and
- PGUP keys advance you forward or back within the source code. The HOME key
- moves the cursor to the beginning of the current line. The END key moves the
- cursor to the end of the current line. The arrow keys move the cursor one
- character at a time. QuickC also has a command for moving around in a source
- file: The Go to command in the Search menu moves the cursor to a specified
- line number. %@NL@%
- %@NL@%
- ────────────────────────────────────────────────────────────────────────────%@NL@%
- NOTE
-
- %@AI@%For a complete list of editor commands, use online help. Open the Help menu,
- %@AI@%choose the Contents command, then get help about the Keyboard under the
- %@AI@%Orientation heading.%@AE@%%@NL@%
- ────────────────────────────────────────────────────────────────────────────%@NL@%%@NL@%
- %@NL@%
- You can invoke many of the editor commands in two different ways. For
- example, to move one word to the right, you can press either CTRL+RIGHT or
- CTRL+F. The second choice is part of the WordStar-compatible command set. If
- you're familiar with WordStar commands, you already know how to use the
- QuickC editor. There is one difference you should know: you don't use
- separate commands to mark the beginning and end of a block of text. %@NL@%
- %@NL@%
- %@NL@%
- %@4@%%@AB@%Defining a Block%@AE@%%@EH@%%@NL@%
- %@NL@%
- While you're working on a C program, you may want to delete a large block of
- text or copy it to another place in the program. To do this, you must define
- the block: %@NL@%
- %@NL@%
- Move the cursor to the beginning of the block. Hold down the SHIFT key and
- move to the end of the block. Use the other editing keys (HOME, END,
- CTRL+RIGHT, and so on) while you're holding down SHIFT to extend the block.
- %@NL@%
- %@NL@%
- Move the mouse cursor to the beginning of the block. While holding down the
- left button, move to the end of the block. %@NL@%
- %@NL@%
- After defining a block, you can do several things: use the DELETE key to
- erase it or use SHIFT+DEL to copy it into the Paste buffer (then use
- SHIFT+INS to insert the buffer into the source file at the current cursor
- location). %@NL@%
- %@NL@%
- While a block is defined, anything you type will replace the defined text. %@NL@%
- %@NL@%
- You can also press the TAB key to indent the entire block an additional tab
- setting or SHIFT+TAB to remove all tab settings. %@NL@%
- %@NL@%
- %@NL@%
- %@3@%%@CR:C6A00030011 @%%@AB@%Customizing the Editor%@AE@%%@EH@%%@NL@%
- %@NL@%
- If you'd prefer to use another set of editing commands, QuickC comes with
- four "key" files, which are files that define the keystrokes for editor
- commands, along with a utility for making your own key file. The four key
- files are QC.KEY, ME.KEY, BRIEF.KEY, and EPSILON.KEY. Refer to Appendix A
- for a complete list of the commands they control (for example, the QuickC
- and Microsoft editors use CTRL+E to move the cursor up, while Epsilon(tm)
- uses CTRL+P). %@NL@%
- %@NL@%
- To change to a new key file, use the /k: option when you run QuickC. For
- example, to load the BRIEF.KEY file, enter this line, using just the file
- name and not the fully qualified path: %@NL@%
- %@NL@%
- %@AS@% QC /k:BRIEF.KEY%@AE@%%@NL@%
- %@NL@%
- Your preference is automatically saved in the QC.INI file. In future editing
- sessions, you won't need to specify the key file. %@NL@%
- %@NL@%
- %@NL@%
- %@4@%%@AB@%Creating Your Own Key File%@AE@%%@EH@%%@NL@%
- %@NL@%
- The MKKEY program allows you to make your own key file. You must use three
- options: -c, -i, and -o. The first (-c) specifies the type of conversion:
- ASCII to binary (ab) or binary to ASCII (ba). The two others specify the
- input file (-i) and the output file (-o). %@NL@%
- %@NL@%
- To modify the default QC.KEY file, you first convert it to an editable ASCII
- file: %@NL@%
- %@NL@%
- %@AS@% MKKEY -c ba -i QC.KEY -o MYEDITOR.TXT%@AE@%%@NL@%
- %@NL@%
- You can use any text editor (including QuickC's) to edit the file named
- MYEDITOR.TXT, which lists the keystrokes that perform certain actions. For
- example, you press CTRL+G to delete a character. The line in MYEDITOR.TXT
- looks like this: %@NL@%
- %@NL@%
- %@AS@% Del : CTRL+G%@AE@%%@NL@%
- %@NL@%
- You could change that command to any other keystroke (CTRL+D, for example),
- as long as the key isn't already assigned to another function. Elsewhere in
- the file, CTRL+D is assigned to CharRight, so you'd have to delete or change
- that line if you wanted to use CTRL+D for the Del function. %@NL@%
- %@NL@%
- When you're satisfied with the new functions, you must convert the ASCII
- file to binary, so that it can be loaded into the QuickC editor: %@NL@%
- %@NL@%
- %@AS@% MKKEY -c ab -i MYEDITOR.TXT -o MYEDITOR.KEY%@AE@%%@NL@%
- %@NL@%
- Finally, to load the new key file, use the /k: option described above. %@NL@%
- %@NL@%
- ────────────────────────────────────────────────────────────────────────────%@NL@%
- NOTE
-
- %@AI@%If you customize the QuickC editor by creating a key file, you are not
- %@AI@%allowed to assign functions to CTRL+@%@AI@%.%@AE@%%@AE@%%@NL@%
- ────────────────────────────────────────────────────────────────────────────%@NL@%%@NL@%
- %@NL@%
- %@NL@%
- %@3@%%@CR:C6A00030012 @%%@AB@%Using Another Editor%@AE@%%@EH@%%@NL@%
- %@NL@%
- If you'd prefer to use your favorite word processor or text editor for
- writing programs, use the Customize Menu command in the Utility menu. This
- allows you to run any other program (including word processors) from within
- the QuickC environment. When you exit the program, you'll return to QuickC.
- %@NL@%
- %@NL@%
- To use another editor, choose the Customize Menu command in the Utility
- menu. Highlight the Custom &Editor item and select the Edit button. List the
- path and the name of the editor in the Path Name text box. (It isn't
- necessary to include the .EXE extension.) For example, you could list
- \BIN\B,\EDITORS\EPS or MYDIR\M. If you're using Brief, Epsilon, or the
- Microsoft Editor, read the appropriate section below. %@NL@%
- %@NL@%
- %@NL@%
- %@4@%%@AB@%Brief%@AE@%%@EH@%%@NL@%
- %@NL@%
- Type the following in the Arguments text box: %@NL@%
- %@NL@%
- %@AS@% -m"editat $LINE $COL" $FILE%@AE@%%@NL@%
- %@NL@%
- Add the following macro to your Brief macro file: %@NL@%
- %@NL@%
- %@AS@% ;*** editat ─ interface to QC Utility.Edit menu
- %@AS@% ; SYNOPSIS
- %@AS@% ; b -m"editat $LINE $COL" $FILE
- %@AS@% ; DESCRIPTION
- %@AS@% ; editat positions Brief at the specified line and column in the
- %@AS@% ; current file. It is invoked from the command line (i.e -m).
- %@AS@% ;*
- %@AS@%
- %@AS@% (macro editat
- %@AS@% (
- %@AS@% (int line col)
- %@AS@%
- %@AS@% (get_parm 0 line)
- %@AS@% (get_parm 1 col)
- %@AS@% (move_abs line col)
- %@AS@% )
- %@AS@% )%@AE@%%@NL@%
- %@NL@%
- %@NL@%
- %@4@%%@AB@%Epsilon%@AE@%%@EH@%%@NL@%
- %@NL@%
- Type the following in the Arguments text box: %@NL@%
- %@NL@%
- %@AS@% $FILE +$LINE%@AE@%%@NL@%
- %@NL@%
- %@NL@%
- %@4@%%@AB@%M Editor%@AE@%%@EH@%%@NL@%
- %@NL@%
- Type the following in the Arguments text box: %@NL@%
- %@NL@%
- %@AS@% /e "Arg \"$LINE\" Mark" $FILE%@AE@%%@NL@%
- %@NL@%
- %@NL@%
- %@2@%%@CR:C6A00030013 @%%@AB@%Compiling and Linking%@AE@%%@EH@%%@NL@%
- %@NL@%
- Your ultimate goal in writing C programs is to create an executable program.
- To convert a C source file to a runnable program, you must compile and link
- it. This section introduces the commands that compile and link programs, a
- process called "building." %@NL@%
- %@NL@%
- When QuickC builds a program, it performs two steps: %@NL@%
- %@NL@%
- %@NL@%
- 1. It compiles the .C source file into an object (.OBJ) file.%@NL@%
- %@NL@%
- 2. It links the object file with other object files or libraries to
- create an executable (.EXE) file.%@NL@%
- %@NL@%
- %@NL@%
- Although you have the option of going through these two steps, it's
- generally easier and more convenient to build a program with a single
- command. %@NL@%
- %@NL@%
- %@NL@%
- %@3@%%@CR:C6A00030014 @%%@AB@%Building within the QuickC Environment%@AE@%%@EH@%%@NL@%
- %@NL@%
- This section illustrates how to compile and link a C program. First, type in
- this program and use the Save As command in the File menu to save the file
- as HI.C: %@NL@%
- %@NL@%
- %@AS@% /* HI.C: Prints hello and a name */
- %@AS@%
- %@AS@% #include <stdio.h>
- %@AS@%
- %@AS@% main()
- %@AS@% {
- %@AS@% char name[80];
- %@AS@%
- %@AS@% printf( "Type your name, please.\n" );
- %@AS@% gets( name );
- %@AS@% printf( "Hello, %s\n", name );
- %@AS@% }%@AE@%%@NL@%
- %@NL@%
- The output of this simple program tells you to type your name. You enter any
- string of characters, and it says hello to you. %@NL@%
- %@NL@%
- The program calls two library functions: %@AB@%printf%@AE@% and %@AB@%gets%@AE@%. For more
- information about what these functions do, use the online help system.
- Position the cursor on the function name and press F1. To close the Help
- window, press ESC. Online help is explained in greater detail in the next
- chapter. %@NL@%
- %@NL@%
- ────────────────────────────────────────────────────────────────────────────%@NL@%
- NOTE
-
- %@AI@%By default, QuickC names a new file UNTITLED.C. You should always explicitly
- %@AI@%name your file before you compile.%@AE@%%@NL@%
- ────────────────────────────────────────────────────────────────────────────%@NL@%%@NL@%
- %@NL@%
- %@NL@%
- %@4@%%@AB@%Compiling and Linking%@AE@%%@EH@%%@NL@%
- %@NL@%
- To build a program, open the Make menu and choose Build Program. Or use one
- of these shortcuts: %@NL@%
- %@NL@%
- Press SHIFT+F5 to build the program. %@NL@%
- %@NL@%
- Click the %@AS@%<Shift+F5=Restart>%@AE@% button on the reference bar at the bottom of
- the screen. %@NL@%
- %@NL@%
- A dialog box appears on the screen to show you how far the compiler and
- linker have progressed. The compiler or linker may halt if anything goes
- wrong. When the source file contains errors, the Errors window appears and
- the offending line is highlighted in the source window. %@NL@%
- %@NL@%
- Note that incremental linking uses expanded memory, as defined by the
- Lotus-Intel-Microsoft (LIM) specification versions 3.2 and higher, if it is
- available. If you have installed additional memory on an 80286 or 80386
- system, you may encounter problems when linking incrementally, especially if
- you have configured the board to use both extended and expanded memory. In
- particular, your computer may lock up if you use incremental linking in
- conjunction with a Talltrees AT3 expanded memory board. (Other boards may or
- may not be subject to this problem.) If this happens, you have several
- choices: %@NL@%
- %@NL@%
- %@NL@%
- ■ Contact the manufacturer of the memory board for information on
- solving this problem.%@NL@%
- %@NL@%
- ■ Remove the Expanded Memory Manager (EMM) device driver and continue to
- link incrementally.%@NL@%
- %@NL@%
- ■ Disable extended memory (used by VDISK) and continue to link
- incrementally.%@NL@%
- %@NL@%
- ■ Leave the memory device driver in place, but turn off incremental
- linking. From the QuickC environment, choose the Make command in the
- Options menu and select the Linker Flags button. From the command
- line, avoid the /Li option.%@NL@%
- %@NL@%
- ■ Contact Microsoft Product Support for additional suggestions.%@NL@%
- %@NL@%
- %@NL@%
- %@NL@%
- %@4@%%@AB@%Running the Program%@AE@%%@EH@%%@NL@%
- %@NL@%
- When the program has been built, the reference bar displays several new
- items, including %@AS@% <F5=Run>%@AE@%. To run the program, open the Run menu and choose
- Go. Or use the shortcuts: %@NL@%
- %@NL@%
- Press F5. %@NL@%
- %@NL@%
- Click %@AS@% <F5=Run> %@AE@% on the reference bar. %@NL@%
- %@NL@%
- %@NL@%
- %@4@%%@AB@%Compiling, Linking, and Running%@AE@%%@EH@%%@NL@%
- %@NL@%
- It's not necessary to press SHIFT+F5 (to build the program) before you press
- F5 (to run it). If you simply press F5, the QuickC editor knows if the
- source code in memory has changed. If it %@AI@%has%@AE@% changed, you'll be asked if you
- want to rebuild the program. %@NL@%
- %@NL@%
- %@NL@%
- %@4@%%@AB@%Viewing the Output Window%@AE@%%@EH@%%@NL@%
- %@NL@%
- When you choose Go from the Run menu (or press F5), the output is
- automatically directed to the output screen. To see this output: %@NL@%
- %@NL@%
- Press F4 to toggle between the two screens. %@NL@%
- %@NL@%
- Open the View window and choose Output Screen. Click once to return to the
- source window. %@NL@%
- %@NL@%
- If you'd prefer to have both the Output and source windows visible at the
- same time, choose the Windows command from the View menu and then choose
- Output. %@NL@%
- %@NL@%
- %@NL@%
- %@4@%%@AB@%Saving the Program%@AE@%%@EH@%%@NL@%
- %@NL@%
- To save the source file using the current name, go to the File menu and
- choose either Save or Save As. If you use Save, QuickC automatically saves
- the file under the name listed on the top line of the source window. If you
- prefer to use another name, choose Save As. The following dialog box
- appears: %@NL@%
- %@NL@%
- %@AU@%(This figure may be found in the printed book.)%@AE@%%@NL@%
- %@NL@%
- Type in the new name of the source file. If you don't add an extension,
- QuickC automatically adds .C (HI becomes HI.C, for example). %@NL@%
- %@NL@%
- %@NL@%
- %@3@%%@CR:C6A00030015 @%%@AB@%Building from Multiple Source Files%@AE@%%@EH@%%@NL@%
- %@NL@%
- Now we'll make things a little more complicated by writing a multiple-module
- program. %@NL@%
- %@NL@%
- First, edit the HI.C program, adding a few lines: %@NL@%
- %@NL@%
- %@AS@% /* HIA.C: Illustrates external functions */
- %@AS@%
- %@AS@% #include <stdio.h>
- %@AS@%
- %@AS@% main()
- %@AS@% {
- %@AS@% char name[80];
- %@AS@%
- %@AS@% welcome();
- %@AS@% outsider();
- %@AS@% printf( "Type your name, please.\n" );
- %@AS@% gets( name );
- %@AS@% printf( "Hello, %s\n", name );
- %@AS@% }
- %@AS@% welcome()
- %@AS@% {
- %@AS@% printf( "Welcome to the program.\n" );
- %@AS@% }%@AE@%%@NL@%
- %@NL@%
- The %@AS@% main %@AE@% function calls two new functions: %@AS@% welcome %@AE@% and %@AS@% outsider%@AE@%. Unlike
- %@AS@% printf %@AE@% and %@AS@% gets%@AE@%, which are library functions, %@AS@% welcome %@AE@% and %@AS@%outsider%@AE@% are
- functions defined within the program. Note the definition of %@AS@% welcome %@AE@% below
- the %@AS@% main %@AE@% function. %@NL@%
- %@NL@%
- Don't compile the program yet. Save it as HIA.C and then choose New from the
- File menu. Type in this second program: %@NL@%
- %@NL@%
- %@AS@% /* HIB.C: Second program for HIA.C */
- %@AS@%
- %@AS@% outsider()
- %@AS@% {
- %@AS@% printf( "This line is from the HIB.C file.\n" );
- %@AS@% }%@AE@%%@NL@%
- %@NL@%
- Save it as HIB.C. Now there are two source files on your disk: HIA.C and
- HIB.C. %@NL@%
- %@NL@%
- There are several reasons to split a file into multiple modules. If you
- write a function that's used in several programs, you can give it its own
- source file. If you write long programs, splitting the file up makes editing
- easier. In addition, the Build Program command takes less time because it
- recompiles only the source files you've changed, instead of the entire
- program. %@NL@%
- %@NL@%
- %@NL@%
- %@4@%%@AB@%Creating a Program List%@AE@%%@EH@%%@NL@%
- %@NL@%
- Since the example program now uses two source files, we must create a
- program list (also called a "make file") that tells QuickC which source
- files should be compiled. %@NL@%
- %@NL@%
- Open the Make menu and choose Set Program List (you must have Full Menus
- enabled). Type the name HIA.MAK as the name of the file containing the
- program list (the MAK extension is used for make files), and when QuickC
- asks if it should create the file, press ENTER. %@NL@%
- %@NL@%
- The following dialog box appears: %@NL@%
- %@NL@%
- %@AU@%(This figure may be found in the printed book.)%@AE@%%@NL@%
- %@NL@%
- Now you must add both HIA.C and HIB.C to the list of programs. %@NL@%
- %@NL@%
- Press TAB until the cursor is within the list box containing the directory
- of C source files (another list box lists the directory names). Use the
- arrow keys to move to the HIA.C file. Press ENTER and the file name will
- appear in the program list below. Repeat this action to add HIB.C to the
- program list. (A second option is to type the file names in the text box at
- the top of the screen.) When you're finished, press TAB until the Save List
- command button is highlighted, and then press ENTER. %@NL@%
- %@NL@%
- Click HIA.C once and click the Add/Delete button (or just double-click
- HIA.C). Do the same for HIB.C. When both programs appear in the program
- list, click the Save List command button to save the make file. %@NL@%
- %@NL@%
- This program list tells QuickC that several source files are to be combined
- into one program. %@NL@%
- %@NL@%
- ────────────────────────────────────────────────────────────────────────────%@NL@%
- NOTE
-
- %@AI@%Within a program list, you can include source files (ending with the .C
- %@AI@%extension), object files (.OBJ), or libraries (.LIB). For example, if you
- %@AI@%didn't include graphics in the combined library when you ran the SETUP
- %@AI@%program, you can place GRAPHICS.LIB in the program list to gain access to
- %@AI@%graphics functions.%@AE@%%@NL@%
- ────────────────────────────────────────────────────────────────────────────%@NL@%%@NL@%
- %@NL@%
- Notice that the base name of the program list (HIA.MAK) matches the name of
- one of the source files (HIA.C). Because the names match, when you load
- HIA.C in the future, QuickC will ask if you wish to use the program list
- HIA.MAK. You don't have to give the source file and the make file the same
- names, but it's a good idea to do so. %@NL@%
- %@NL@%
- The order that you list the files is inconsequential. It doesn't matter
- which file is first or second. %@NL@%
- %@NL@%
- When you choose the Rebuild All command from the Make menu, every .C file in
- the program list is compiled into a .OBJ file. Then all of the .OBJ files
- are linked with .LIB files to create one .EXE file. %@NL@%
- %@NL@%
- However, if you press SHIFT+F5 or choose the Build Program command, QuickC
- checks the time and date stamps on the source and object files. If the
- source code has not changed since the last time a Build Program command
- executed, there's no need to recompile the unchanged .OBJ files. Any files
- that have changed are recompiled; the others are not. This means the Build
- command is often faster than the Rebuild All command when you have multiple
- source files. %@NL@%
- %@NL@%
- %@NL@%
- %@4@%%@AB@%About Directories%@AE@%%@EH@%%@NL@%
- %@NL@%
- You can change directories whenever you open or save a file: %@NL@%
- %@NL@%
- Press TAB until the cursor is within the Drives/Dirs: list box containing
- the directory names (see Figure 3.4). Use the arrow keys to move to the
- desired directory, and press ENTER. %@NL@%
- %@NL@%
- Double-click the name of the desired directory. %@NL@%
- %@NL@%
- To move to the parent directory, select the two periods (..) at the top of
- the list. %@NL@%
- %@NL@%
- When you exit QuickC, you return to the directory you started (the default
- directory), regardless of how many other directories you may have accessed.
- %@NL@%
- %@NL@%
- QuickC puts all object (.OBJ) files and executable (.EXE) files in the
- default directory. For example, suppose you run QuickC from the C:\ZEBRA
- directory and open the file TAPIR.C from the C:\AARDVARK directory. Because
- ZEBRA is the default directory, the files TAPIR.OBJ and TAPIR.EXE are
- created in the ZEBRA directory when you compile the program. If you prefer
- to keep all related files in the AARDVARK directory, choose the Run DOS
- Command from the Utility menu and type %@NL@%
- %@NL@%
- %@AS@% CHDIR \AARDVARK%@AE@%%@NL@%
- %@NL@%
- The CHDIR directory command redirects the object and executable files to the
- other directory. %@NL@%
- %@NL@%
- %@NL@%
- %@3@%%@CR:C6A00030016 @%%@AB@%Compiling and Linking from the Command Line%@AE@%%@EH@%%@NL@%
- %@NL@%
- If you're new to the C language, you can skip this section. You don't need
- to know how to compile and link from the command line; you can do everything
- within the QuickC environment. %@NL@%
- %@NL@%
- However, if you want to, you can exit the QuickC environment to build
- programs from the DOS prompt. This gives you slightly more control over the
- various options. In addition, if you're building a series of related
- executable programs, you can either put the compile and link commands in a
- batch file or create your own make file. Either method is faster than
- building programs individually. %@NL@%
- %@NL@%
- The program that builds from the command line is called QCL.EXE (the C and L
- in the file name stand for "Compile" and "Link"). To build the HI.EXE
- program, type this: %@NL@%
- %@NL@%
- %@AS@% QCL HI.C%@AE@%%@NL@%
- %@NL@%
- You can include a variety of command-line options between QCL and the file
- name. For example, %@NL@%
- %@NL@%
- %@AS@% QCL /AM HI.C%@AE@%%@NL@%
- %@NL@%
- forces the linker to use the medium memory model (the default is the small
- model). If you try this example, you must have a medium memory model library
- installed. You will find a complete list of compiler and linker options in
- the %@AI@%Microsoft QuickC Tool Kit%@AE@% manual (or type %@AS@% QCL /help%@AE@%). %@NL@%
- %@NL@%
- QCL can also build multiple-module programs. Since HIA.C and HIB.C are two
- parts of a multiple-module program, the following line does %@AI@%not%@AE@% build a
- program: %@NL@%
- %@NL@%
- %@AS@% QCL HIA.C%@AE@%%@NL@%
- %@NL@%
- The compiler works correctly, creating a .OBJ file, but when the linker
- looks for the %@AS@% outsider %@AE@% function (which is in HIB.C), it fails and returns
- the error %@AS@%unresolved external%@AE@%. %@NL@%
- %@NL@%
- One solution is to specify both source files: %@NL@%
- %@NL@%
- %@AS@% QCL HIA.C HIB.C%@AE@%%@NL@%
- %@NL@%
- The example above builds a program called HIA.EXE because HIA.C is listed
- first. %@NL@%
- %@NL@%
- Another solution is to compile the two files and then link them yourself: %@NL@%
- %@NL@%
- %@AS@% QCL /c HIA.C
- %@AS@% QCL /c HIB.C
- %@AS@% QLINK HIA.OBJ HIB.OBJ%@AE@%%@NL@%
- %@NL@%
- The /c option tells the QCL program to compile but not link. It must be
- entered as a lowercase character. %@NL@%
- %@NL@%
- Since you created a make file called HIA.MAK, which contained the program
- list, you can also use the NMAKE program to build HIA.EXE. Simply pass it
- the name of the make file: %@NL@%
- %@NL@%
- %@AS@% NMAKE /F HIA.MAK%@AE@%%@NL@%
- %@NL@%
- For a complete list of compiler, linker, and NMAKE options, see %@AI@%Microsoft
- %@AI@%QuickC Tool Kit%@AE@%. %@NL@%
- %@NL@%
- The -qc option allows you to run the QuickC compiler from Microsoft C
- Professional Development System version 6.0. To use the QuickC compiler from
- Microsoft C use the command line %@NL@%
- %@NL@%
- %@AS@% CL = B1 qccom -qc%@AE@%%@NL@%
- %@NL@%
- QuickC ships with the QLINK linker, a subset of LINK. %@NL@%
- %@NL@%
- %@NL@%
- %@2@%%@CR:C6A00030017 @%%@AB@%The Debugger%@AE@%%@EH@%%@NL@%
- %@NL@%
- When you make obvious mistakes like misspelling a function name or
- forgetting to end a line with a semicolon, your code causes a compile-time
- error. The compiler (or linker) refuses to continue until you fix the
- mistake. %@NL@%
- %@NL@%
- Other mistakes cause run-time errors. Attempting to divide by zero is one
- such example. %@NL@%
- %@NL@%
- Still other mistakes are called logic errors. When a program includes a
- logic error, it may run, but it eventually acts unpredictably or yields
- incorrect results. %@NL@%
- %@NL@%
- QuickC's built-in debugger helps you track down and correct logic errors. In
- the Run menu, you'll find Trace Into and Step Over, which execute the
- program in memory line by line. Trace Into follows functions when they're
- called; Step Over lets you execute a function without showing its inner
- workings. %@NL@%
- %@NL@%
- You can use the Debug menu to set watchpoints and breakpoints and run a
- program up to the breakpoint. %@NL@%
- %@NL@%
- The Watch Value command from the Debug menu is also useful. You enter one or
- more variable names and then monitor their values as you step through the
- program. There's no need to place %@AB@%printf%@AE@% statements at various points in a
- program just to monitor the value of a variable. The Quickwatch command
- gives you even faster access to variables or expressions you want to watch.
- %@NL@%
- %@NL@%
- If you turn on Debugging History, the debugger records everything that
- happens during the session. Later, you can review the events and watch for
- the logic error. %@NL@%
- %@NL@%
- The online tutorial includes a lesson explaining how to use the debugger,
- with a special section devoted to using Debugging History. If you're
- interested in exploring this topic, run the LEARN program from the command
- line or choose the Learn QuickC command from the Utility menu. You can also
- consult online help for detailed information about the debugger. %@NL@%
- %@NL@%
- ────────────────────────────────────────────────────────────────────────────%@NL@%
- IMPORTANT
-
- %@AI@%The CodeView debugger cannot handle files that have been incrementally
- %@AI@%compiled or incrementally linked. If you plan to examine QuickC programs
- %@AI@%with CodeView, be sure the incremental compiling and linking options are
- %@AI@%turned off. From the command line, use QCL without the /Gi or /Li options.
- %@AI@%From the QuickC environment, use the Make command from the Options menu to
- %@AI@%turn off incremental compiling and linking and to turn on CodeView info.
- %@AI@%This restriction applies only to CodeView. QuickC's built-in debugger can
- %@AI@%handle incrementally compiled and linked programs.%@AE@%%@NL@%
- ────────────────────────────────────────────────────────────────────────────%@NL@%%@NL@%
- %@NL@%
- %@NL@%
- %@NL@%
- %@NL@%
- %@NL@%
- %@NL@%
- %@CR:C6A00040001 @%%@1@%%@AB@%Chapter 4 Getting Help%@AE@%%@EH@%%@NL@%
- %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
- %@NL@%
- The QuickC Compiler environment offers a complete online reference system
- called the Microsoft Advisor. The Microsoft Advisor provides information on
- the C language, run-time libraries, and utilities provided with QuickC. %@NL@%
- %@NL@%
- The first section of this chapter, "Structure of the Microsoft Advisor,"
- outlines the structure and contents of the help database. The second
- section, "Navigating through the Microsoft Advisor," takes you on a quick
- tour of the system. %@NL@%
- %@NL@%
- %@NL@%
- %@2@%%@CR:C6A00040002 @%%@AB@%Structure of the Microsoft Advisor%@AE@%%@EH@%%@NL@%
- %@NL@%
- The Microsoft Advisor can be compared to a librarian managing a collection
- of books. Each book, or help file, has its own table of contents, index, and
- pages of information. The Advisor organizes the books with an overall table
- of contents and index. All of the books are listed, and their specific
- tables of contents and indexes can be accessed through the overall
- references. The global contents screen is shown in Figure 4.1. %@NL@%
- %@NL@%
- %@AU@%(This figure may be found in the printed book.)%@AE@%%@NL@%
- %@NL@%
- You can access a variety of information from the online reference system.
- Information regarding the C language, run-time libraries, errors, and the
- reference system itself can all be displayed. %@NL@%
- %@NL@%
- %@NL@%
- %@2@%%@CR:C6A00040003 @%%@AB@%Navigating through the Microsoft Advisor%@AE@%%@EH@%%@NL@%
- %@NL@%
- You request information about a topic in a window by positioning the cursor
- over it and pressing F1. The help system then searches through the help
- files for information about the topic. If it finds the topic, the help
- system displays information in the Help window. If help cannot be found for
- a particular word or symbol, a message informs you that no information is
- associated with the topic. Sometimes, a topic with the same name occurs in
- several help files. In such cases, a dialog box is displayed in which you
- can select the context of the topic. %@NL@%
- %@NL@%
- %@NL@%
- %@3@%%@CR:C6A00040004 @%%@AB@%Using the Help Menu%@AE@%%@EH@%%@NL@%
- %@NL@%
- The simplest method for accessing the online reference is with the commands
- found in the Help menu. All of these commands present information in the
- Help window. %@NL@%
- %@NL@%
- %@AB@%Command%@AE@% %@AB@%Description%@AE@%
- %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
- Index Displays the alphabetical index of
- help-file categories (see Figure 4.2).
-
- Contents Displays the global contents screen for
- the categories found in the help files.
-
- Topic: Provides information about the topic
- that the cursor is currently positioned
- over. If information about the topic is
- available, the topic's name is appended
- to the Topic: command. Otherwise, this
- menu option is grayed.
-
- Help on Help Displays information about using the
- online reference itself.
-
- %@AU@%(This figure may be found in the printed book.)%@AE@%%@NL@%
- %@NL@%
- ────────────────────────────────────────────────────────────────────────────%@NL@%
- NOTE
-
- %@AI@%SHIFT+F1%@AI@% is the shortcut key for the Help on Help menu command. If you have
- %@AI@%a terminate-and-stay-resident (TSR) utility such as the Norton Guides%@AE@%%@AI@%(tm)%@AE@%%@AI@%
- %@AI@%installed and you invoke that program with SHIFT+F1%@AE@%%@AI@%, then you can't use
- %@AI@%SHIFT+F1%@AE@%%@AI@% as a shortcut to Help on Help. Choose Help on Help from the Help
- %@AI@%menu instead, or change the key that invokes the TSR.%@AE@%%@AE@%%@NL@%
- ────────────────────────────────────────────────────────────────────────────%@NL@%%@NL@%
- %@NL@%
- %@NL@%
- %@3@%%@CR:C6A00040005 @%%@AB@%Using the F1 Key%@AE@%%@EH@%%@NL@%
- %@NL@%
- You can use the F1 key to get information about any menu command or QuickC
- dialog box, as well as information on C keywords, operators, and library
- functions. %@NL@%
- %@NL@%
- %@NL@%
- %@4@%%@AB@%Menu Help%@AE@%%@EH@%%@NL@%
- %@NL@%
- To view information about a menu item, first pull down the menu, then %@NL@%
- %@NL@%
- Use the cursor keys to highlight the command and press F1. %@NL@%
- %@NL@%
- Move the mouse cursor on the command and click the Right mouse button. %@NL@%
- %@NL@%
- Figure 4.3 shows the help information for the Cut command in the Edit menu.
- %@NL@%
- %@NL@%
- %@AU@%(This figure may be found in the printed book.)%@AE@%%@NL@%
- %@NL@%
- %@NL@%
- %@4@%%@AB@%Keyword and Library-Function Help%@AE@%%@EH@%%@NL@%
- %@NL@%
- To view information about a C keyword, operator, or run-time library
- function, %@NL@%
- %@NL@%
- Put the cursor on the keyword or function name and press F1. %@NL@%
- %@NL@%
- Click on the command with the Right mouse button. %@NL@%
- %@NL@%
- %@NL@%
- %@4@%%@AB@%Dialog-Box Help%@AE@%%@EH@%%@NL@%
- %@NL@%
- To view information about a QuickC dialog box, simply press F1 while the
- dialog box is displayed, or click on the Help button. %@NL@%
- %@NL@%
- %@NL@%
- %@3@%%@CR:C6A00040006 @%%@AB@%Using Hyperlinks%@AE@%%@EH@%%@NL@%
- %@NL@%
- Hyperlinks are cross-references that connect related topic information. %@NL@%
- %@NL@%
- Hyperlinks enclosed by the < and > characters are called "buttons." Navigate
- through the online help system by using these buttons. %@NL@%
- %@NL@%
- You can press TAB to move to the next hyperlink button within the current
- help window. SHIFT+TAB moves back to the previous button. Typing any letter
- moves the cursor to the next button that begins with the letter; holding
- SHIFT down and typing a letter moves the cursor backward. %@NL@%
- %@NL@%
- The Microsoft Advisor also recognizes C keywords, library functions,
- constants defined by QuickC, and similar identifiers as hyperlinks, but they
- are unmarked hyperlinks. Unmarked hyperlinks are recognized by the Microsoft
- Advisor wherever they appear in the help-information text or %@AI@%in your source
- %@AI@%code%@AE@%. However, an unmarked hyperlink is not delimited with the < and >
- characters, and you can't move to it with the TAB key. An unmarked hyperlink
- can only be executed by placing the cursor on it and pressing F1, or
- pointing to it with the mouse cursor and clicking the Right mouse button. %@NL@%
- %@NL@%
- You can access a hyperlink in several ways. First move either the mouse or
- text cursor to a hyperlink, then %@NL@%
- %@NL@%
- Press F1. %@NL@%
- %@NL@%
- Click the Left mouse button twice (double-click). Then click the Right mouse
- button once. %@NL@%
- %@NL@%
- Highlighted button hyperlinks can also be executed by pressing ENTER or the
- SPACEBAR. %@NL@%
- %@NL@%
- Any of these actions displays information about the topic the cursor is
- positioned on. If the topic isn't a hyperlink, a message informs you that no
- information on the topic could be found. %@NL@%
- %@NL@%
- %@NL@%
- %@3@%%@CR:C6A00040007 @%%@AB@%Using Help Windows and Dialog Boxes%@AE@%%@EH@%%@NL@%
- %@NL@%
- The Microsoft Advisor displays information in windows or dialog boxes. Help
- windows and dialog boxes function the same as other QuickC windows and
- dialog boxes. For a complete description of windows and dialog boxes, refer
- to Chapter 3, "Using QuickC." %@NL@%
- %@NL@%
- %@NL@%
- %@4@%%@AB@%Using the Help Window%@AE@%%@EH@%%@NL@%
- %@NL@%
- The help window displays various contents, indexes, and information about
- selected topics. Some screens of information are larger than the help
- window; information beyond the window borders can be viewed by using the
- scroll bars or the arrow keys. The - - symbol indicates the end of
- information in the help window. %@NL@%
- %@NL@%
- %@NL@%
- %@4@%%@AB@%Navigating with Hyperlink Buttons%@AE@%%@EH@%%@NL@%
- %@NL@%
- At the top of the Help window is a group of hyperlink buttons that are
- useful for moving through the reference system: %@NL@%
- %@NL@%
- %@AB@%Button%@AE@% %@AB@%Description%@AE@%
- %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
- < Up > Moves upward in the hierarchy of help
- screens. Since information is ordered in
- a logical way, moving from the general
- to the specific, this command is useful
- for moving up the information tree.
-
- < Contents > Displays the global contents screen.
- This command is useful because it always
- returns you to a known point in the
- online help system hierarchy.
-
- < Index > Displays the index list. Selecting a
- letter from the list displays the index
- for entries beginning with that
- letter.
-
- < Back > Moves you to the last online help screen
- you saw.
-
- Screens on a particular topic frequently are physically grouped together in
- a help file. You can press CTRL+F1 to display information about the next
- physical topic in the help file. %@NL@%
- %@NL@%
- %@NL@%
- %@4@%%@AB@%Viewing the Previous Help Screen%@AE@%%@EH@%%@NL@%
- %@NL@%
- The Microsoft Advisor remembers the last 20 help screens you've accessed. To
- return to a previous screen, use the "Back" button or hold down the ALT key
- and press F1 as many times as necessary to return to the screen you want to
- see. The help screen that appears is active; you can ask for help on any of
- its hyperlinks or topics. %@NL@%
- %@NL@%
- You can always return to the global contents screen by pressing SHIFT+F1. %@NL@%
- %@NL@%
- %@NL@%
- %@4@%%@AB@%Copying and Pasting Information%@AE@%%@EH@%%@NL@%
- %@NL@%
- Any text that appears in the help window can easily be copied to another
- window. For example, to test an example program from the help window, you
- only have to copy it to the source window and compile it. %@NL@%
- %@NL@%
- To copy and paste with the keyboard, follow these steps: %@NL@%
- %@NL@%
- %@NL@%
- 1. Move the cursor to the beginning or the end of the text you want to
- select. Hold down the SHIFT key and move the cursor to the other end
- of the text. The text is now highlighted.%@NL@%
- %@NL@%
- 2. Execute the Copy command: press ALT to activate the menus, E for Edit,
- then C for Copy. Note that the menu lists the shortcut command
- (CTRL+INS), which can be substituted for ALT+E, then C.%@NL@%
- %@NL@%
- 3. Press F6 to switch to another window. Position the cursor where you
- want to insert the text, and execute the Paste command: ALT+E, then P,
- or use the SHIFT+INS shortcut. The text from the help window is
- inserted at the current cursor position.%@NL@%
- %@NL@%
- %@NL@%
- To copy and paste using the mouse, follow these steps: %@NL@%
- %@NL@%
- %@NL@%
- 1. Click the Left mouse button and drag the cursor (hold the button down
- while moving the mouse) to select the text you want to copy.%@NL@%
- %@NL@%
- 2. Choose Copy from the Edit menu (or press CTRL+INS).%@NL@%
- %@NL@%
- 3. Move the mouse cursor to the location where you want to insert the
- text, and click once. Then choose Paste from the Edit menu. The text
- from the help window is inserted at the current cursor position.%@NL@%
- %@NL@%
- %@NL@%
- %@NL@%
- %@4@%%@AB@%Closing the Help Window%@AE@%%@EH@%%@NL@%
- %@NL@%
- Once you're through working with the online reference system, close the
- active help window and return to the source window: %@NL@%
- %@NL@%
- Press ESC. %@NL@%
- %@NL@%
- Click the Close button in the upper left corner of the window with the Left
- mouse button. %@NL@%
- %@NL@%
- %@NL@%
- %@4@%%@AB@%Using Help Dialog Boxes%@AE@%%@EH@%%@NL@%
- %@NL@%
- Help dialog boxes contain information about menu commands and their dialog
- boxes. A help dialog box differs from a help window in that it is displayed
- over the source window and any other windows that are displayed. Unlike the
- help window, a help dialog box must be closed before you can execute any
- menu commands. The Cancel button in the lower right portion of the dialog
- box closes the help dialog box. %@NL@%
- %@NL@%
- To view information about any QuickC dialog box, you can %@NL@%
- %@NL@%
- Press F1. %@NL@%
- %@NL@%
- Click the Help button in the dialog box with the Left mouse button. %@NL@%
- %@NL@%
- Either of these commands causes a help dialog box to appear. To close a help
- dialog box, %@NL@%
- %@NL@%
- Press F1. %@NL@%
- %@NL@%
- Click the dialog box's Cancel button by using the Left mouse button. %@NL@%
- %@NL@%
- %@NL@%
- %@3@%%@CR:C6A00040008 @%%@AB@%Accessing Different Types of Information%@AE@%%@EH@%%@NL@%
- %@NL@%
- This section presents some strategies for accessing the different types of
- information available within the online reference system. %@NL@%
- %@NL@%
- %@NL@%
- %@4@%%@AB@%Keyword Information%@AE@%%@EH@%%@NL@%
- %@NL@%
- To get information about any keyword, operator, symbolic constant, or
- library function, go to the index, select the keyword's first letter, then
- scroll down the list of entries and select the topic hyperlink. If you know
- the exact name of a keyword, it is often quicker to simply type it in the
- source window and press F1 than to locate it through an index. %@NL@%
- %@NL@%
- Figure 4.4 shows the information screen for the %@AB@%printf%@AE@% function. %@NL@%
- %@NL@%
- %@AU@%(This figure may be found in the printed book.)%@AE@%%@NL@%
- %@NL@%
- When information about a function is displayed in the help window, two
- additional hyperlink buttons are displayed. %@NL@%
- %@NL@%
- %@NL@%
- ■ <Description> provides a detailed explanation of the function. When
- the information is displayed, the button changes to <Summary>,
- allowing you to return to the summarized information about the
- function.%@NL@%
- %@NL@%
- ■ <Example> displays C source code that provides an example of how the
- function is used. The code can be pasted into the source window to
- compile.%@NL@%
- %@NL@%
- %@NL@%
- %@NL@%
- %@4@%%@AB@%Topical Information%@AE@%%@EH@%%@NL@%
- %@NL@%
- The online reference system is useful when you want an overview of the
- available reference topics, or when you only have a general idea of what
- information you need. Start with the global contents screen, then select any
- hyperlinks that appear to relate to the topic. You can traverse the
- hyperlinks until you locate the necessary information. %@NL@%
- %@NL@%
- %@NL@%
- %@4@%%@AB@%Menu and Dialog-Box Information%@AE@%%@EH@%%@NL@%
- %@NL@%
- You can get information about any menu command or dialog box by pressing F1
- when the menu command is highlighted or the dialog box is displayed. This is
- helpful when you are first learning to use QuickC, and may not be completely
- familiar with all of the features. %@NL@%
- %@NL@%
- %@NL@%
- %@4@%%@AB@%Error Information%@AE@%%@EH@%%@NL@%
- %@NL@%
- The Microsoft Advisor provides information about compiler and linker error
- messages. %@NL@%
- %@NL@%
- To find the meaning of an error message using the keyboard, %@NL@%
- %@NL@%
- %@NL@%
- 1. Press F6 to move the cursor to the error window%@NL@%
- %@NL@%
- 2. Position the cursor on the error number%@NL@%
- %@NL@%
- 3. Press F1%@NL@%
- %@NL@%
- %@NL@%
- Or: %@NL@%
- %@NL@%
- %@NL@%
- 1. Position the mouse cursor on the error number%@NL@%
- %@NL@%
- 2. Click the Right mouse button%@NL@%
- %@NL@%
- %@NL@%
- %@NL@%
- %@NL@%
- %@NL@%
- %@NL@%
- %@NL@%
- %@CR:C6A00050001 @%%@1@%%@AB@%Chapter 5 Where to Go from Here%@AE@%%@EH@%%@NL@%
- %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
- %@NL@%
- You've installed the QuickC Compiler on your system and tried a sample
- editing session. What you do next depends on your level of experience. You
- can experiment, or you can further investigate some of the other books in
- this package. %@NL@%
- %@NL@%
- %@NL@%
- %@4@%%@AB@%Read README.DOC%@AE@%%@EH@%%@NL@%
- %@NL@%
- The README.DOC file lists all known corrections and additions to the printed
- manuals. Before you continue, please read this file. You can view it from
- within online help or you can use the QuickC editor (type %@AS@% QC README.DOC %@AE@% to
- read the file). %@NL@%
- %@NL@%
- %@NL@%
- %@4@%%@AB@%For All Programmers%@AE@%%@EH@%%@NL@%
- %@NL@%
- The QuickC environment has been designed with you, the programmer, in mind.
- You'll find writing, compiling, and debugging QuickC programs faster and
- easier than ever. To learn more about the editor, compiler, linker, and
- debugger, you should run the disk-based tutorial on the QuickC distribution
- disk labeled "Learning the Microsoft QuickC Integrated Environment." %@NL@%
- %@NL@%
- The \QC2\TUTORIAL directory holds the tutorial program, LEARN.COM. The LEARN
- program contains four lessons: %@NL@%
- %@NL@%
- %@NL@%
- 1. How to Use This Tutorial%@NL@%
- %@NL@%
- 2. Getting Around in QuickC%@NL@%
- %@NL@%
- 3. Creating Programs in QuickC%@NL@%
- %@NL@%
- 4. Debugging in QuickC%@NL@%
- %@NL@%
- %@NL@%
- You can run LEARN from the command line or choose the Learn QuickC command
- from the Utility menu. %@NL@%
- %@NL@%
- QuickC searches the current path and runs the first LEARN.COM program it
- finds. If it finds a LEARN.COM for another program, such as Microsoft Word,
- QuickC will run that LEARN program instead of the one for QuickC. %@NL@%
- %@NL@%
- If this happens while you are working from the command line, either switch
- to the \QC2\TUTORIAL directory and type %@AS@%LEARN%@AE@%, and press ENTER, or run the
- NEW-VARS batch file. %@NL@%
- %@NL@%
- ────────────────────────────────────────────────────────────────────────────%@NL@%
- NOTE
-
- %@AI@%Since most of the changes to QuickC 2.5 are language additions that don't
- %@AI@%affect the QuickC environment or the operation of the compiler or linker,
- %@AI@%the LEARN tutorial program has not been updated to include changes found in
- %@AI@%version 2.5.%@AE@%%@NL@%
- ────────────────────────────────────────────────────────────────────────────%@NL@%%@NL@%
- %@NL@%
- %@NL@%
- %@4@%%@AB@%For Programmers New to the C Language%@AE@%%@EH@%%@NL@%
- %@NL@%
- The book %@AI@%C for Yourself%@AE@% was written for people who already know how to
- program (in BASIC, Pascal, or some other language) but have never used C.
- Part 1, "Learning C," covers everything from functions to flow control and
- from data types to pointers. If you've never programmed in C or if you need
- a refresher course, start with %@AI@%C for Yourself%@AE@%. %@NL@%
- %@NL@%
- The introduction in %@AI@%C for Yourself%@AE@% lists several additional books that
- newcomers to C may find helpful. %@NL@%
- %@NL@%
- Another good source of information about how C works is the online help
- system. Prototypes, explanations, and examples for any function are
- immediately available at the press of a key. You may ask for help about a
- specific topic or browse through the contents screen. %@NL@%
- %@NL@%
- %@NL@%
- %@4@%%@AB@%For C Programmers New to QuickC%@AE@%%@EH@%%@NL@%
- %@NL@%
- Appendix A of %@AI@%C for Yourself%@AE@% is a quick reference to the QuickC
- implementation of C. Both the proposed ANSI standard and the original
- Kernighan & Ritchie standard are supported. %@NL@%
- %@NL@%
- Appendix B of %@AI@%C for Yourself%@AE@% summarizes the most useful QuickC library
- functions, listing the header files to include, values to pass, and values
- returned. %@NL@%
- %@NL@%
- For specific details on the compiling, linking, library, and other support
- programs, see %@AI@%Microsoft QuickC Tool Kit%@AE@%. %@NL@%
- %@NL@%
- %@NL@%
- %@4@%%@AB@%For QuickC Programmers New to Version 2.5%@AE@%%@EH@%%@NL@%
- %@NL@%
- If you've used an older version of QuickC, you should read Appendix B of
- this book. It lists features that were added to both QuickC version 2.0 and
- the current 2.5 version. %@NL@%
- %@NL@%
- Advanced C topics and features unique to QuickC are covered in %@AI@%C for
- %@AI@%Yourself%@AE@%. Part 2, "Using C," includes detailed information about the new
- functions such as real coordinate graphics, presentation graphics, fonts,
- and in-line assembly. If you've previously used version 1.0 of QuickC, we
- recommend that you read through Part 2 of %@AI@%C for Yourself%@AE@%. In addition,
- Appendix B, "C Library Guide," summarizes commonly used functions in the
- QuickC run-time library. %@NL@%
- %@NL@%
- %@NL@%
- %@4@%%@AB@%Additional Tools%@AE@%%@EH@%%@NL@%
- %@NL@%
- QuickC offers more than just an integrated editor, compiler, and linker.
- Additional utilities include the QCL program (for compiling from the DOS
- command line), the LINK program (for linking object modules), the NMAKE
- program (for automating the compile/link process and maintaining programs),
- and the LIB program (for creating your own libraries). %@NL@%
- %@NL@%
- %@AI@%Microsoft QuickC Tool Kit%@AE@% explains how to use these advanced tools to best
- advantage. Part 1, "Tool Kit Tutorial," is a tutorial that explains
- step-by-step how these programs work. Part 2, "Reference to QuickC Tools,"
- is a complete and exhaustive reference guide that summarizes the many
- options. %@NL@%
- %@NL@%
- %@NL@%
- %@NL@%
- %@NL@%
- %@NL@%
- %@NL@%
- %@CR:C6A-A0001 @%%@1@%%@AB@%Appendix A Editor Functions%@AE@%%@EH@%%@NL@%
- %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
- %@NL@%
- This appendix has two parts. The first part, Table A.1, lists the keystrokes
- that invoke commands within the QuickC Compiler Editor and three other
- editors. The second part, Table A.2, lists the editor functions
- alphabetically and defines them. %@NL@%
- %@NL@%
- Each editor has its own .KEY file. Chapter 3, "Using QuickC," explains how
- to use the /k: option to load one of the four .KEY files supplied with
- QuickC. It also contains directions for using MKKEY.EXE to customize the
- commands within a .KEY file. Functions are not assigned default values. If
- you omit Backspace from your customized .KEY file, you will be unable to
- backspace. %@NL@%
- %@NL@%
- Note that in Table A.1 below, the plus sign indicates that both keys should
- be held down. For example, CTRL+H means that you hold down the CTRL key
- while you press H. When keys are pressed separately, they are separated with
- a comma. For example, ESC, D means that you press (and release) ESC and then
- press the D key. %@NL@%
- %@NL@%
- The CAPS LOCK key affects individual keystrokes, but not CTRL or ALT
- sequences. Holding down the SHIFT key defines a block of text. %@NL@%
- %@NL@%
- %@AB@%Table %@AB@%A.1 Editor Keystrokes%@AE@%%@AE@%
-
- %@TH: 18 790 02 11 19 14 11 21 @%
- Function QuickC Microsoft BRIEF(R) Epsilon
- %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
- Backspace CTRL+H CTRL+H CTRL+H ─
-
- BegLine CTRL+Q, CTRL+S ─ ─ ─
- CTRL+Q, S
-
- BegPgm CTRL+HOME ALT+A, PGUP CTRL+PGUP CTRL+HOME
- CTRL+Q, CTRL+R ESC, <
- CTRL+Q, R
-
- Cancel ESC ESC ESC F12
-
- Cancel2 F12 F12 F12 ESC
-
- Change CTRL+Q, CTRL+A CTRL+L ALT+T ESC, %
- CTRL+Q, A CTRL+\
-
- %@TE: 18 790 02 11 19 14 11 21 @%
-
- %@AB@%Table %@AB@%A.1 (continued)%@AE@%%@AE@%
-
- %@TH: 42 1951 02 18 18 15 11 15 @%
- Function QuickC Microsoft BRIEF(R) Epsilon
- %@AB@%─────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
- CharLeft CTRL+S CTRL+S LEFT CTRL+B
- LEFT LEFT
-
- CharRight CTRL+D CTRL+D RIGHT CTRL+F
- RIGHT RIGHT
-
- Del DEL DEL DEL DEL
- CTRL+G CTRL+G CTRL+D
-
- DelWord CTRL+T ALT+D
- ESC, D
-
- DoEsc ESC ─ ─ ─
-
- DoQuoteCharacter CTRL+P CTRL+P ALT+Q CTRL+Q
-
- DoTab TAB TAB TAB TAB
- ALT+TAB ALT+TAB
-
- EndLine END END END END
- CTRL+Q, CTRL+D CTRL+E
- CTRL+Q, D
-
- EndPgm CTRL+END ALT+A, PGDN CTRL+PGDN CTRL+END
- CTRL+Q, CTRL+C ESC, >
- CTRL+Q, C
-
- EndScn CTRL+Q, CTRL+X ALT+A, DOWN CTRL+DOWN ─
- CTRL+Q, X
-
- EraseEol CTRL+Q, CTRL+Y ALT+A, CTRL+Y ALT+K CTRL+K
- CTRL+Q, Y
-
- Find CTRL+Q, CTRL+F ─ ALT+S CTRL+S
- CTRL+Q, F
-
- GotoBookmark0 CTRL+Q, 0 ─ ─ ─
-
- GotoBookmark1 CTRL+Q, 1 ─ ─ ─
-
- %@TE: 42 1951 02 18 18 15 11 15 @%
-
- %@AB@%Table %@AB@%A.1 (continued)%@AE@%%@AE@%
-
- %@TH: 48 1897 02 16 16 12 11 21 @%
- Function QuickC Microsoft BRIEF(R) Epsilon
- %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
- GotoBookmark2 CTRL+Q, 2 ─ ─ ─
-
- GotoBookmark3 CTRL+Q, 3 ─ ─ ─
-
- HomeLine HOME HOME HOME HOME
- CTRL+A
-
- HomeScn CTRL+Q, CTRL+E ALT+A, UP CTRL+HOME ─
- CTRL+Q, E
-
- KillLine CTRL+Y CTRL+Y ALT+D ─
-
- LineDown DOWN DOWN DOWN DOWN
- CTRL+X CTRL+X CTRL+N
-
- LineUp UP UP UP UP
- CTRL+E CTRL+E CTRL+P
-
- MatchBrace CTRL+] ─ ─ CTRL+]
-
- Menu ALT F11 ALT ALT
-
- Menu2 F11 ALT+M F11 F11
-
- NewLine CTRL+M CTRL+M CTRL+M CTRL+M
-
- NextLine CTRL+J ─ ─ CTRL+J
-
- PageDown PGDN PGDN PGDN PGDN
- CTRL+C CTRL+C CTRL+V
-
- PageLeft CTRL+PGUP ─ ─ CTRL+PGUP
-
- PageRight CTRL+PGDN ─ ─ CTRL+PGDN
-
- PageUp PGUP PGUP PGUP PGUP
- CTRL+R CTRL+R ALT+V
- ESC, V
-
- ResetState CTRL+K, CTRL+U ─ ─ ─
- CTRL+Q, CTRL+U
- CTRL+U
-
- ScrollDown CTRL+Z, CTRL+Z CTRL+D CTRL+Z CTRL+DOWN
- CTRL+DOWN
-
- %@TE: 48 1897 02 16 16 12 11 21 @%
-
- %@AB@%Table %@AB@%A.1 (continued)%@AE@%%@AE@%
-
- %@TH: 34 1680 02 18 18 18 12 21 @%
- Function QuickC Microsoft BRIEF(R) Epsilon
- %@AB@%───────────────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
- ScrollUp CTRL+UP CTRL+W CTRL+U CTRL+UP
- CTRL+W ESC, Z
- F4
-
- SearchNext CTRL+L ─ ─ ─
-
- SetBookMark0 CTRL+K, 0 ─ ALT+M ─
-
- SetBookMark1 CTRL+K, 1 ─ ─ ─
-
- SetBookMark2 CTRL+K, 2 ─ ─ ─
-
- SetBookMark3 CTRL+K, 3 ─ ─ ─
-
- SplitLine CTRL+N CTRL+N ─ CTRL+O
-
- ToggleInsertMode INS INS ALT+I INS
- CTRL+V CTRL+V
-
- Undo CTRL+Q, CTRL+L ALT+H ALT+U ─
- CTRL+Q, L
-
- WordLeft CTRL+LEFT CTRL+LEFT CTRL+LEFT CTRL+LEFT
- CTRL+A CTRL+A ALT+B
- ESC, B
-
- WordRight CTRL+RIGHT CTRL+RIGHT CTRL+RIGHT CTRL +RIGHT
- CTRL+F CTRL+F ALT+F
- ESC, F
-
- %@AB@%───────────────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
-
- %@TE: 34 1680 02 18 18 18 12 21 @%
-
- %@AB@%Table %@AB@%A.2 Function Definitions%@AE@%%@AE@%
-
- %@TH: 72 3271 02 34 42 @%
- Function Description
- %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
- Backspace Moves the cursor left and erases the
- character in that position.
-
- Beep Causes the computer to beep, usually
- when an unassigned key is pressed.
-
- BegLine Moves the cursor to the beginning of the
- line (column 1), ignoring any
- indentation.
-
- BegPgm Moves the cursor to the beginning of the
- program (line 1, column 1).
-
- Cancel Closes help windows and cancels dialog
- boxes.
-
- Cancel2 Cancels dialog boxes.
-
- Change Searches for selected text and changes
- it to something else.
-
- CharLeft Moves the cursor one character left.
-
- CharRight Moves the cursor one character right.
-
- Del Deletes the character under the cursor.
-
- DelWord Deletes the word from the current cursor
- position to the next white-space
- character.
-
- DoEsc Cancels the current selected text.
-
- DoQuoteCharacter Inserts the next typed character into
- the text (except carriage returns,
- linefeeds, and nulls). This allows you
- to insert characters such as CTRL+C.
-
- DoTab Indents the entire defined block by one
- tab setting. A shifted DoTab removes the
- tabs from a block.
-
- Endline Moves the cursor to the last nonspace
- character in the current line.
-
- EndPgm Moves the cursor to column 1 of the last
- line in the current file.
-
- EndScn Moves the cursor to the bottom line of
- the current screen. The current column
- is
- maintained.
-
- EraseEol Erases all characters from the cursor
- position to the end of the line. The
- characters are placed in the insert
- buffer.
-
- Find Searches from the current cursor
- position to the end of the file for
- defined text.
-
- GotoBookmark0 Moves the cursor to bookmark 0.
-
- GotoBookmark1 Moves the cursor to bookmark 1.
-
- GotoBookmark2 Moves the cursor to bookmark 2.
-
- GotoBookmark3 Moves the cursor to bookmark 3.
-
- %@TE: 72 3271 02 34 42 @%
-
- %@AB@%Table %@AB@%A.2 (continued)%@AE@%%@AE@%
-
- %@TH: 65 2824 02 34 42 @%
- Function Description
- %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
- HomeLine Moves the cursor to the first nonspace
- character on the line.
-
- HomeScn Moves the cursor to line 1 of the
- current screen, maintaining the current
- column
- position.
-
- IgnoreChar Does nothing. In addition, the editor
- doesn't beep as it would for undefined
- keys.
-
- KillLine Erases everything on the current line
- and places the line in the insert buffer.
-
- LineDown Moves the cursor to the next line.
-
- LineUp Moves the cursor to the previous line.
-
- MatchBrace Finds matching (parentheses), [square
- brackets], or {curly braces}. The editor
- searches for opening or closing braces,
- depending on which type the cursor is
- resting on.
-
- Menu Activates the menu bar.
-
- Menu2 Activates the menu bar.
-
- NewLine Splits the current line into two lines
- at the cursor position. The new line is
- automatically indented to match the line
- above.
-
- PageDown Moves forward one screen.
-
- PageLeft Moves left one screen.
-
- PageRight Moves one screen to the right (each line
- on a screen may contain up to 255
- characters).
-
- PageUp Moves back one screen.
-
- ResetState Cancels prefix tables.
-
- ScrollDown Scrolls down one line at a time,
- maintaining the current cursor position.
-
- ScrollUp Scrolls the text up one line at a time,
- maintaining the current cursor position.
-
- SearchNext Repeats the Find command.
-
- SetBookMark0 Sets bookmark 0. You may later return to
- this position with GotoBookMark0.
-
- SetBookMark1 Sets bookmark 1.
-
- SetBookMark2 Sets bookmark 2.
-
- SetBookMark3 Sets bookmark 3.
-
- %@TE: 65 2824 02 34 42 @%
-
- %@AB@%Table %@AB@%A.2 (continued)%@AE@%%@AE@%
-
- %@TH: 21 1070 02 34 42 @%
- Function Description
- %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
- SplitLine Splits a line in two (like NewLine), but
- leaves the cursor at the end of the
- first line instead of the beginning of
- the second.
-
- ToggleInsertMode Toggles between insert mode and overtype
- mode.
-
- Undo Cancels any commands that might have
- been performed on the current line. Undo
- works only when the cursor remains on
- the line being edited.
-
- WordLeft Moves the cursor to the previous word.
-
- WordRight Moves the cursor to the next word.
-
- %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
-
- %@TE: 21 1070 02 34 42 @%
-
- %@NL@%
- %@NL@%
- %@NL@%
- %@NL@%
- %@NL@%
- %@CR:C6A-B0001 @%%@1@%%@AB@%Appendix B QuickC Differences%@AE@%%@EH@%%@NL@%
- %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
- %@NL@%
- The QuickC Compiler version 2.5 incorporates a variety of new features. If
- you've used version 1.0, you'll find many new features were added to version
- 2.0, in addition to those added in the current 2.5 release. %@NL@%
- %@NL@%
- This appendix summarizes some of the significant differences between QuickC
- versions 1.0 and 2.0, and offers a comprehensive guide to the changes found
- in version 2.5. For detailed information about a feature, consult the online
- help, %@AI@%C for Yourself%@AE@%, or %@AI@%Microsoft QuickC Tool Kit%@AE@%. %@NL@%
- %@NL@%
- %@NL@%
- %@2@%%@CR:C6A-B0002 @%%@AB@%QuickC Version 2.0 Additions%@AE@%%@EH@%%@NL@%
- %@NL@%
- Additions to version 2.0 include %@NL@%
- %@NL@%
- %@NL@%
- ■ Expanded and improved online help system invoked by pressing F1%@NL@%
- %@NL@%
- ■ New presentation and real-coordinates graphics functions%@NL@%
- %@NL@%
- ■ Small, medium, compact, large, and huge memory models%@NL@%
- %@NL@%
- ■ Support of in-line assembly-language routines%@NL@%
- %@NL@%
- ■ New Local Variables, Notepad, and Registers windows%@NL@%
- %@NL@%
- ■ Text cut and paste support%@NL@%
- %@NL@%
- ■ Command line compiling and linking with QC.EXE and QCL.EXE%@NL@%
- %@NL@%
- ■ Incremental compilation%@NL@%
- %@NL@%
- ■ MKKEY utility for customizing editor key commands %@NL@%
- %@NL@%
- %@NL@%
- %@NL@%
- %@2@%%@CR:C6A-B0003 @%%@AB@%QuickC Version 2.5 Additions and Changes%@AE@%%@EH@%%@NL@%
- %@NL@%
- Additions and changes to version 2.5 affect both the QuickC environment and
- the C language implementation. The following sections list those changes. %@NL@%
- %@NL@%
- %@NL@%
- %@3@%%@CR:C6A-B0004 @%%@AB@%Interface and Environment Changes%@AE@%%@EH@%%@NL@%
- %@NL@%
- This section describes changes to the QuickC user interface and programming
- environment. %@NL@%
- %@NL@%
- %@NL@%
- ■ The Go To command in the Search menu moves to a specified line number
- in the source.%@NL@%
- %@NL@%
- ■ The Quickwatch command in the Debug menu gives faster access in
- viewing variables and expressions.%@NL@%
- %@NL@%
- ■ The Color command in the Options menu allows you to select four
- different sets of colors and to change the color of items such as
- menus, borders, and buttons.%@NL@%
- %@NL@%
- ■ Tabs can now be treated as spaces or actual tab characters.%@NL@%
- %@NL@%
- %@NL@%
- %@NL@%
- %@3@%%@CR:C6A-B0005 @%%@AB@%Language and Compiler Changes%@AE@%%@EH@%%@NL@%
- %@NL@%
- This section describes changes to the QuickC implementation of the C
- language and changes in the compiler's behavior. %@NL@%
- %@NL@%
- %@NL@%
- %@4@%%@AB@%Memory Models%@AE@%%@EH@%%@NL@%
- %@NL@%
- %@NL@%
- ■ QuickC 2.5 now supports the tiny memory model, which produces .COM
- rather than .EXE files. In the tiny memory model, all of your
- program's code and data must fit in a single 64K segment.
- Additionally, tiny programs do not support graphics.%@NL@%
- %@NL@%
- ■ QuickC 2.5 supports custom memory models, such as huge-compact, with
- the /A compiler option. Refer to %@AI@%Microsoft QuickC Tool Kit%@AE@% for
- additional information.%@NL@%
- %@NL@%
- %@NL@%
- %@NL@%
- %@4@%%@AB@%Constants%@AE@%%@EH@%%@NL@%
- %@NL@%
- %@NL@%
- ■ Both %@AB@%long %@AE@%and %@AB@%unsigned long%@AE@% values are allowed in switch expressions
- and case constants. Previous versions of QuickC allow only %@AB@%char%@AE@% and
- %@AB@%int%@AE@% values in this context.%@NL@%
- %@NL@%
- ■ QuickC supports %@AB@%unsigned long%@AE@% decimal constants. It is now possible to
- initialize %@AB@%unsigned long%@AE@% variables with values larger than %@AB@%MAX_LONG%@AE@%
- using decimal (rather than hexadecimal or octal) constants.%@NL@%
- %@NL@%
- ■ The constant %@AB@%NULL %@AE@%is now defined as %@AS@% ((void *)0)%@AE@%. Previous versions of
- QuickC defined %@AB@%NULL%@AE@% as 0x0000 in small and medium models and
- 0x00000000L in compact and large models.%@NL@%
- %@NL@%
- %@NL@%
- %@NL@%
- %@4@%%@AB@%Keywords%@AE@%%@EH@%%@NL@%
- %@NL@%
- %@NL@%
- ■ Storage classes or types (or both) are now required on variable
- declarations. QuickC previously assumed that untyped variables (such
- as %@AS@% a;%@AE@%) were integers. This declaration now generates a warning.%@NL@%
- %@NL@%
- ■ The %@AB@%volatile%@AE@% keyword, which was previously implemented only
- syntactically, is now also implemented semantically.%@NL@%
- %@NL@%
- ■ To identify implementation-defined keywords as non-ANSI, an underscore
- has been added. Thus, %@AB@%far%@AE@%, %@AB@%near%@AE@%, %@AB@%huge%@AE@%, %@AB@%cdecl%@AE@%, %@AB@%fortran%@AE@%, %@AB@%interrupt%@AE@%, and
- %@AB@%pascal%@AE@% have been changed to %@AB@%_far%@AE@%, %@AB@%_near%@AE@%, %@AB@%_huge%@AE@%, %@AB@%_cdecl%@AE@%, %@AB@%_fortran%@AE@%,
- %@AB@%_interrupt%@AE@%, and %@AB@%_pascal%@AE@%. QuickC still accepts the obsolescent versions
- of these keywords, unless you use the /Za (disable extensions) option.%@NL@%
- %@NL@%
- ■ A new pseudo-instruction, %@AB@%_emit%@AE@%, has been added for use with the
- in-line assembler. It allows you to define a single immediate byte at
- the current location in the current text segment.%@NL@%
- %@NL@%
- ■ The %@AB@%const%@AE@% and %@AB@%volatile%@AE@% qualifiers must be placed after the name of the
- type they qualify. Consult online help for more information about
- %@AB@%const%@AE@% and %@AB@%volatile%@AE@%.%@NL@%
- %@NL@%
- ■ The new %@AB@%_fastcall%@AE@% function attribute causes QuickC to pass function
- arguments in processor registers instead of on the stack. This results
- in faster functions when a QuickC program is built with Microsoft C
- version 6.0.%@NL@%
- %@NL@%
- %@NL@%
- %@NL@%
- %@4@%%@AB@%Locale-Specific Information%@AE@%%@EH@%%@NL@%
- %@NL@%
- %@NL@%
- ■ The LOCALE.H header file is new to version 2.5. It declares functions
- and structures for describing conventions, such as the currency
- symbol, that vary from one country to the next.%@NL@%
- %@NL@%
- %@NL@%
- %@NL@%
- %@4@%%@AB@%Based Objects%@AE@%%@EH@%%@NL@%
- %@NL@%
- %@NL@%
- ■ QuickC 2.5 supports the following new keywords and operators, which
- are used to declare and manipulate based objects: %@AB@%_based%@AE@%, %@AB@%_segment%@AE@%,
- %@AB@%_segname%@AE@%, and %@AB@%:>%@AE@% (the based operator). Based object support is
- included in QuickC 2.5 for the sake of compatibility with Microsoft C
- version 6.0. Please refer to Chapter 2, "Managing Memory," in the
- Microsoft C Professional Development System %@AI@%Advanced Programming
- %@AI@% Techniques%@AE@% guide for further details.%@NL@%
- %@NL@%
- %@NL@%
- %@NL@%
- %@4@%%@AB@%Data Types%@AE@%%@EH@%%@NL@%
- %@NL@%
- %@NL@%
- ■ QuickC version 2.0 recognizes %@AB@%long double%@AE@% and %@AB@%double%@AE@% as different
- types, with both types stored in memory as 64-bit quantities.%@NL@%
- %@NL@%
- %@STUB@% Because the 80%@AI@%x%@AE@%87 family of math coprocessors supports an 80-bit
- floating-point type, QuickC version 2.5 stores %@AB@%long double%@AE@% variables
- in the 80%@AI@%x%@AE@%87 10-byte (80-bit) form.%@NL@%
- %@NL@%
- %@STUB@% Certain library functions have been modified to handle the %@AB@%long double%@AE@%
- type. The %@AB@%printf%@AE@% and %@AB@%scanf%@AE@% family of functions supports %@AB@%long double%@AE@%
- values identified by a trailing %@AB@%l%@AE@% in the format specifier. The library
- contains new versions of the transcendental functions as well as
- intrinsic forms that accept %@AB@%long double%@AE@% arguments. These are
- identified by a trailing %@AB@%l%@AE@% in the function name (e.g., %@AB@%cosl%@AE@%).%@NL@%
- %@NL@%
- ■ Integer promotion rules have changed. Earlier versions of QuickC
- attempted to preserve an expression's unsigned nature as much as
- possible. Version 2.5 attempts to preserve the expression's value.%@NL@%
- %@NL@%
- %@STUB@% In version 2.0, an %@AB@%unsigned char%@AE@% promotes to an %@AB@%unsigned int%@AE@%; an
- %@AB@%unsigned int%@AE@% promotes to an %@AB@%unsigned long%@AE@%.%@NL@%
- %@NL@%
- %@STUB@% In version 2.5, an %@AB@%unsigned char%@AE@% promotes to a %@AB@%signed int%@AE@%; an %@AB@%unsigned
- %@AB@% int%@AE@% promotes to a %@AB@%signed long%@AE@%.%@NL@%
- %@NL@%
- ■ Shift operators now give a result that is of the same type as the left
- operand. QuickC previously yielded a result that was of the same type
- as the largest of the two values.%@NL@%
- %@NL@%
- %@NL@%
- %@NL@%
- %@4@%%@AB@%Preprocessor%@AE@%%@EH@%%@NL@%
- %@NL@%
- %@NL@%
- ■ QuickC 2.5 allows longer macro expansions (up to 12K). In low memory
- conditions, the macro expansion space may be limited to 6K.%@NL@%
- %@NL@%
- ■ The %@AB@%data_seg%@AE@% pragma has been deleted.%@NL@%
- %@NL@%
- ■ Version 2.0 of QuickC treated conditional compilation expressions as
- %@AB@%signed long%@AE@% values. Version 2.5 evaluates these expressions using the
- same rules as are used for all other expressions in C.%@NL@%
- %@NL@%
- %@NL@%
- %@NL@%
- %@4@%%@AB@%Structures, Unions, Arrays, and Bit Fields%@AE@%%@EH@%%@NL@%
- %@NL@%
- %@NL@%
- ■ If a structure or union is nested inside another structure or union,
- you can declare it without using a variable name. This rule simplifies
- references to inner members of such nested constructs.%@NL@%
- %@NL@%
- ■ QuickC now allows an unsized or zero-sized array as the last member of
- a structure. Unsized arrays can appear only as the last member of a
- structure. Structures containing unsized array declarations can be
- nested within other structures as long as no element of the enclosing
- structure follows the unsized array. Arrays of such structures are not
- allowed.%@NL@%
- %@NL@%
- ■ QuickC now allows longer string literals (up to 2K).%@NL@%
- %@NL@%
- ■ You may declare %@AB@%signed%@AE@% as well as %@AB@%unsigned%@AE@% bit fields.%@NL@%
- %@NL@%
- ■ Bit fields are permitted in unions.%@NL@%
- %@NL@%
- %@NL@%
- %@NL@%
- %@4@%%@AB@%Memory Management%@AE@%%@EH@%%@NL@%
- %@NL@%
- %@NL@%
- ■ The memory-management routine %@AB@%sbrk%@AE@% has been deleted.%@NL@%
- %@NL@%
- ■ The %@AB@%_fmalloc %@AE@%function attempts to allocate far memory. In previous
- versions of QuickC, %@AB@%_fmalloc%@AE@% called %@AB@%_nmalloc %@AE@%if far memory was not
- available. Now it returns a null pointer if far memory isn't
- available, even if near memory is available.%@NL@%
- %@NL@%
- ■ Previous versions of QuickC placed the command-line argument strings
- and environment strings in the near heap. Now they are allocated
- through %@AB@%malloc%@AE@%. Because %@AB@%malloc%@AE@% maps to %@AB@%_fmalloc%@AE@% in the compact and
- large memory models, environment strings and command-line argument
- strings are in far memory in those memory models.%@NL@%
- %@NL@%
- %@NL@%
- %@NL@%
- %@4@%%@AB@%Miscellaneous%@AE@%%@EH@%%@NL@%
- %@NL@%
- %@NL@%
- ■ QuickC supports a new warning level (4), which provides even more
- stringent error checking than the warning levels in version 2.0. You
- can set this warning level from the command line, by supplying the /W4
- compiler option, or from the QuickC environment, with the Compiler
- Flags button shown with the Make command in the Options menu. At
- warning level 4, QuickC generates warnings for nonportable (non-ANSI)
- constructs and for undefined or implementation-defined constructs.%@NL@%
- %@NL@%
- ■ 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
- changed. Consult online help for additional information.%@NL@%
- %@NL@%
- ■ In QuickC 2.0, a prototype or definition that returns a %@AB@%float%@AE@% value
- actually returns a %@AB@%double%@AE@% value. Version 2.5 interprets such a
- function as returning a %@AB@%float%@AE@% value.%@NL@%
- %@NL@%
- ■ QuickC version 2.5 does not align a %@AB@%char%@AE@% variable to an even address
- unless the variable is local. Likewise, a literal constant string is
- not aligned as in QuickC 2.0.%@NL@%
- %@NL@%
- ■ To maintain ANSI compatibility and portability between QuickC and
- other systems, QuickC now supports trigraphs such as %@AS@%??= %@AE@% equivalent
- to %@AS@%#%@AE@%.%@NL@%
- %@NL@%
- %@NL@%
- %@NL@%
- %@NL@%
-