⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 wguiwide.gml

📁 开放源码的编译器open watcom 1.6.0版的源代码
💻 GML
📖 第 1 页 / 共 5 页
字号:
.result
The Add File(s) dialog appears where you specify the sources you want
to add to the target. Source names must be filenames with extensions;
pathnames are not required.
.np
For the OS/2 &vip, you can add multiple source files to the target at
one time by inserting a space between each filename you enter. You can
also use the file browser to add files by clicking on the Browse...
button.
.np
For all other systems, you can enter the names of the source files
(with extensions) in the File Name field or you can use the file
browser to select files. The type of files displayed in file list
window can be controlled by modifying the List Files of Type field.
Once you have typed a name in the File Name field or selected a name
from the file list, you can add it to the list of source files to be
included by clicking the Add button. All files in the file list can be
added by clicking the Add All button. Individual names can be removed
from the "add" list by selecting them and clicking the Remove button.
.figure *depth='4.86' *scale=90 *file='ide6' Select source file names in the Add File(s) dialog
.step Enter the following source file names.
.millust begin
source1.c   (or source1.for)
source2.c   (or source2.for)
source3.rc
.millust end
.np
For the OS/2 &vip, enter all the names into the field separating each
name by a space. Click on OK when done.
.np
For all other systems, enter one name at a time into the File Name
field, pressing Enter or clicking on Add after each one has been
entered.
Click on Close when done.
.figure *depth='4.86' *scale=90 *file='ide7' Enter one or several source files in the Add File(s) dialog.
.result
The &vip adds the new source files to the target window, followed by
the characters [n/a]. This indicates that the source files are not
available, meaning that the files do not yet exist. The indicators
are:
.begpoint
.point [n/a]
This code appears if the file does not exist.
.point [r/o]
This code appears if the file is Read Only.
.point [sw]
This code appears if the user has set switches for the specified
source file.
.endpoint
.np
The &ide organizes the source files in the target window under
headers according to the filename extension. You can expand and
collapse the file groups by clicking on the folder icon.
.np
For this tutorial, we only need one source file, so now we will delete
the extra files from the target.
.step Click on the file
.fi source2.c
(or
.fi source2.for
.ct )
to select it then choose Remove Source from the Sources menu.
.result
A message box appears asking if you want to remove the selected source.
Click on the Yes button to continue. The &vip removes the selected source
file from the target window. Now we can remove
.fi source3.rc.
To do this we will perform the function of removing all source files
with a common extension.
.step Click on the (.rc) header
on the target window then choose Remove Source from the Sources menu.
.result
A message box appears on the screen asking if you want to remove all
of the ".rc" files. Click on the Yes button to continue. The message
box closes and the &vip removes the
.fi source3.rc
file from the target window. Now you can edit the remaining source
file.
.step Highlight the line
.fi source1.c
(or
.fi source1.for
.ct )
and choose Edit Text from the Sources menu to edit the selected source
file.
.result
The &edname appears. The name of the selected source
file,
.fi source1.c
(or
.fi source1.for
.ct ),
appears in the window. Here you can enter the source code.
.hint
You can also invoke the &edname by double-clicking on
the source file that you want to edit.
.ehint
.np
In this case, the &edname appears because the selected source file has
a ".c" or ".for" extension.
Performing an edit can open different editors, depending on the
extension of the selected source file.
.step Enter the following lines of source code.
.begnote
.note Important:
For the purpose of this session, we ask you to enter
.us ii
instead of
.us i
in the "print" line.
This will allow you to see how the &ide reacts to errors.
You will then be able to correct the error.
.endnote
.millust begin
#include <stdio.h>

void main()
{
    int i;
    for (i=0; i<10; i++)
    {
        printf( "Value is %d\n", ii );
    }
    printf("Press Enter...\n");
    getchar();
}
.millust end
.np
FORTRAN programmers can enter the following lines of code.
.millust begin
      program main
      implicit none
      integer i

      do i = 0, 9
        print *, 'Value is ', ii
      enddo

      print *, 'Press Enter...'
      read *

      end
.millust end
.np
You can now save your work and close the Editor in one of the
following two ways: close down the entire editor or close down only
the source file window. For this exercise, close only the source file
window as follows.
.step Choose Close
from the File menu to close down the current source file window.
.result
In both cases, if changes have been made to the file and not saved, a
message prompts you to save the changes before exiting. The advantage
of closing only the Editor window is that the Editor continues to run.
If you need to access it again, you will not need to wait for it to go
through the start-up procedures again.
.begnote
.note Important:
You must save the file. The &company compilers do not access the
source lines in the Editor's buffers.
.endnote
.step Minimize the Editor window.
.orstep Click on the &company &vip Project window
to bring it to the foreground.
.step Choose Refresh
from the Window menu.
.result
This action forces the &vip to update the display with the state of
all files.
.ix 'auto refresh'
It is not necessary to use this function if you have selected Auto
Refresh in the File menu.
If Auto Refresh is disabled then it may be necessary to alert the &vip
of the presence of the file on disk.
.ix 'save project'
.step Choose Save Project
from the File menu to save your project up to this point.
.result
You are now ready to make and run the target. Making a target is the
act of constructing a target file. In this case, it involves compiling
the source file
.fi source1.c
(or
.fi source1.for
.ct )
using the appropriate &company compiler and linking the target
executable using the &lnkname..
.step Highlight the line
.fi source1.c
and choose C Compiler Switches... from the Source Options item located
under the Sources menu to set compile options.
.np
.us FORTRAN programmers:
Highlight the line
.fi source1.for
and choose Fortran Compiler Switches... from the Source Options item located
under the Sources menu to set compile options.
.result
The C Compiler Switches dialog appears.
If you are using FORTRAN, the Fortran Compiler Switches dialog appears.
.step Click on the ">>" button
until the
.mono 7. CodeGen Strategy Switches
dialog appears.
Click on the "Multithreaded application [-bm]" checkbox button to select
this option.
.np
.us FORTRAN programmers:
Click on the ">>" button until the
.mono 9. Application Type Switches
dialog appears.
Click on the "Multithreaded application [-bm]" checkbox to select
this option.
.result
A check-mark appears in the checkbox.
.np
Note: Selecting this option is for demonstration purposes only, it is not
required for this simple application.
.np
Click OK to close the dialog.
.step Choose Make
from the Targets menu.
.result
The &vip constructs a makefile based on its knowledge of the target
and construction rules and then invokes the &makname utility to create
.fi target1.exe.
The &vip Log window appears at the bottom of the &company &vip Project
window.
Use this window to monitor the procedure.
Since you entered
.us ii
instead of
.us i,
the MAKE fails.
.figure *depth='3.79' *scale=60 *file='ide8' Use the &vip Log window to monitor the make procedure.
.step Highlight the error message
in the &vip Log window and choose Help on Message from the Log menu.
.result
Help information regarding the error message appears on the screen.
.figure *depth='1.35' *scale=60 *file='ide9' Help for error messages is available
.np
Close the Help window and edit the source file as follows.
.step Highlight the error message
in the &vip Log window and choose Edit File from the Log menu.
.orstep Double-click on the error message
in the &vip Log window.
.result
The &edname opens and the cursor appears at the position
of the error. Edit and correct the error and then save the file again.
Minimize the Editor window and bring the &vip window to the foreground.
.step Choose Make
from the Targets menu again.
.result
This time, the procedure creates the executable file
.fi target1.exe.
.step Choose Run
from the Targets menu.
.result
The &vip executes the program
.fi target1.exe.
.figure *depth='3.14' *scale=63 *file='ide10' Run from the Targets menu runs the target.
The program you wrote is a character mode application and its output
appears in a separate console window.
You are now ready to debug your target program. You probably do not need
to debug this simple program with the &dbgname but go through the steps
so that you know what to do for more complex programs.
.np
The &vip has several debugging information options which it uses as
defaults when it is started. The first thing to do is check to make
sure that your application compiled with the default debugging
information activated.
.step Choose Target Options
from the Targets menu to activate the Target Options menu.
.result
The option Use Development Switches should appear in grey text with a
check mark next to it. Development Switches automatically include
debugging information in the target. If you were to select Use Release
Switches, the &vip would select options useful for a production
version of your program. Selecting this option turns the text grey and
places a check mark beside it. The &vip uses the development switches
by default.
.begnote
.note Note:
For the purpose of this session, you should make the target with the
development switches on. If this is not the option selected, select it
and remake the target before debugging.
.endnote
.step Choose Debug
from the Targets menu.
.result
The &vip starts the &dbgname..
.step Choose Step Over
from the Run menu of the &dbgname. to step through the code.
Choose
.bd Go
from the Run menu of the &dbgname. to continue execution to the end of
the code.
For more information on using the &dbgname., refer to the
.book &dbgname. User's Guide.
.us The task has completed running
appears when the program has completed execution.
.step Choose Exit
from the File menu to terminate the debugging session.
.result
The &dbgname. closes and you return to the &company &vip Project window.
You can now exit the &vip..
.step Choose Exit
from the File menu to exit the &vip..
.result
The &vip prompts you to save the current project if you have not
saved it since the last change.
.endstep
.*
.section Review of What Happened
.*
.np
.ix '&ide' 'tutorial review'
In this session, you created a project called
.fi first.wpj.
This project had one target called
.fi target1.exe,
a 32-bit Windows executable (unless you specified another target
type). Using the &edname, you entered and edited the source text
in a file called
.fi source1.c
or
.fi source1.for
(if you tried the FORTRAN example).
You compiled and linked it into an executable program using the
&makname utility, a &company compiler, and the &lnkname..
You ran it directly and under the control of the &dbgname..
.np
When you saved the project, the &wide created the following permanent
files:
.begpoint
.point first.wpj
Describes the screen layout and refers to a file called
.fi target1.tgt
.point target1.tgt
Describes the target executable
.fi target1.exe
and all switches required to link it. It also describes
.fi source1.c
(or
.fi source1.for
.ct )
and the switches required to compile it.
.endpoint
.*
.endlevel
.*
.section The &company &vip Project Window
.*
.np
.ix '&ide' 'project window'
.ix 'project window' '&ide'
When you first start the &wide, an empty &company &vip Project window
opens. This window represents the project that is currently open in
the &vip.. The name of the current project appears in the title bar of
this window.
.np
The first thing you need to do is open a project for the &company &vip
Project window. This can be a new project you create or an existing
project you open.

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -