Browse
(440) 299-7778
Menu
(440) 299-7778
One-year parts and labor warranty30-day money-back guaranteeEnglishEspañolContact

The text of a manual · part 5 of 47

PDT 1100 Terminal Programmer's Guide: Chapter 2 Development Environment and Procedures, pages 27 to 36

Pages 27 to 36 of 413, from PDT 1100 Terminal Programmer's Guide

The original document is the PDF (3.5 MB). This is its text as extracted, unedited; tables and drawings read best in the PDF, and each page heading opens it at that page.

For the Symbol PDT-1100

Page 27

Chapter 2 Development Environment and Procedures Overview of Development Environment The following hardware and software are required for developing user programs:

Required Hardware !

! !

!

A Windows personal computer with an RS-232C interface and at least 640-kilobyte RAM area is required. When the Compiler is running, at least 400 kilobytes should be reserved in RAM as a work area. PDT 1100 terminal CRD 1100 (Optical communications unit/cradle) (not required if the PDT 1100 is directly connected with the personal computer via the direct-connect interface) RS-232C interface cable connects the CRD 1100 to the personal computer. Note: The RS-232C interface cable must have the connector and pin assignment required by the personal computer. See the PDT 1100 Product Reference Guide for connector configuration and pin assignments of the CRD 1100.

2-1

Page 28

PDT 1100 Terminal Programmer’s Guide

Required Software • MS Windows(OS)

Windows 95/NT 3.51.40

• Editor • BASIC 3.0 Compiler

BHTC3W.EXE (Windows-based) BHTC3.MSG (Error message file)

• Ir-Transfer Utility C (option)

TU3W.EXE (Windows-based) TU3C2W.EXE (Windows based)

• Ir-Transfer Utility E (option)

ITEW32.EXE (Windows- based)

Ir-Transfer Utility C and IR Transfer Utility E download user programs to the PDT 1100. The BASIC 3.0 Compiler, Ir-Transfer Utility C and Ir-Transfer Utility E are optionally provided in a floppy disk. Note: Prepare Windows and editor versions operable with the personal computer on which user programs are to be developed. For the manufacturers and models of Windows computers which support Ir-Transfer Utility C and E, refer to the PDT 1100 Terminal Transfer Utility Guide.

Overview of Developing Procedures Developing Procedures The program developing procedures using BASIC 3.0 are outlined below.

Creating a Source Program Create a source program using an editor according to the syntax of BASIC 3.0.

Compiling Compile the source program by the Compiler to generate a user program (an object program).

Downloading the User Program Download the user program to the PDT 1100 by using Ir-Transfer Utility C. 2-2

Page 29

Development Environment and Procedures

Executing the User Program Execute the user program on the PDT 1100.

Functions of the Compiler The Compiler has the following functions: Functions of the Compiler

Description

Syntax check

Detects syntax errors in source programs.

Output of a user program

Translates a source program into a user program in intermediate language. (When downloaded to the PDT 1100 by Ir-Transfer Utility C, the user program is packed to be executed by the Interpreter.)

Output of debug information

Outputs list files and debug information files.

Developing Procedure Flow The steps below shows the developing procedure.

On an Windows Personal Computer 1. Write a source program. C>EDIT userprog.SRC CLS PRINT “BASIC 3.0” END

(Tool: Editor) 2. Compile the source program. C>BHTC3 userprog.SRC

(Tool: BASIC 3.0 Compiler) If a compilation error occurs, go back to step 1 and correct the program. If no compilation error occurs and the user program is generated, proceed to step 3. 3. Download the user program. C>TU3 userprog.PD3

(Tool: Transfer Utility C)

2-3

Page 30

PDT 1100 Terminal Programmer’s Guide

C>IT3C userprog.PD3

(Tool: Ir-Transfer Utility C)

On the PDT 1100 Execute the user program in System Mode. EXECUTE PROGRAM A:USERPROG.PD3

If an execution error occurs, execute the program again.

Writing of a Source Program Writing a Source Program Using Editor To write a source program, use an editor designed for an Windows personal computer (use of a commercially available editor is recommended). See the instruction manual for the editor for information on its use. C>EDIT prog1.SRC

If you place an extension .SRC in a source program file, you may omit the filename extension in compilation. C>BHTC3 prog1

Rules for Writing a Source Program When writing a source program according to the syntax of BASIC 3.0, observe the following rules: !

A label name should begin in the first column. ABC 2000

2-4

Page 31

Development Environment and Procedures

!

A statement should begin in the second or the following columns. PRINT FOR I=1 TO 100 : NEXT I

!

!

One program line should be limited to 512 characters (excluding a CR code) and end with a CR code (the return key). If an underline (_) precedes a CR code, however, one program line can be extended up to 8192 characters. For statements other than the PRINT, PRINT#, and PRINT USING statements, you may use a comma (,) preceding a CR code. A program can contain a maximum of 9,999 program lines. Comment lines starting with a single quotation mark (') and those with a REM have the following description rules. A single quotation mark can be put in from the first or the following columns, or immediately following any other statement. A REM should be put in the second or following columns. To put a REM following any other statement, a colon (:) should precede the REM. Comment CLS ' ‘ Comment REM Comment CLS :: REM Comment

!

End the IF statement with an END IF or ENDIF, since the IF statement is treated as a block-structured statement. IF a$ = “Y” OR a$ = “y” then GOTO sub12 END IF

!

The default number of characters for a non-array string variable is 40 and for an array string variable is 20. Specifying the DIM or DEFREG statement allows a string variable to treat 1 through 255 characters. DIM b$[255] DIM c$(2,3)[255] DEFREG d$[255] DEFREG e$(2,3)[255]

Note: BASIC 3.0 does not support some of the statements and functions used in Microsoft BASIC or QuickBASIC. For details, refer to Appendix L, Unsupported Statements and Functions.

2-5

Page 32

PDT 1100 Terminal Programmer’s Guide

Compiling in Windows Setting up the Compiler Set up the BASIC 3.0 Compiler on your computer to run with Windows according to the procedure given below. 1. Start Windows. 2. Insert the BASIC 3.0 diskette in the disk drive. 3. Copy all files in the directory WIN on the diskette to the appropriate directory of the hard disk. 4. Create an appropriate group (BHT_TOOL, for example) in Program Manager, and then specify the program-item icon BHTC3W that represents the BASIC 3.0 Compiler.

36099002.eps

Figure 2-1. BHT-TOOL group

2-6

Page 33

Development Environment and Procedures

Starting the Compiler In Program Manager, double-click the program-item icon BHTC3W in the BHT_TOOL group. The main window (BASIC Compiler for Win) appears. Menu bar From the File menu, choose the Select File command to select a file to be compiled or execute the selected file.

From the Compile menu, choose the Compiling Options or Run command to set the options or execute the Compiler.

Tool bar

From the Help menu, display the version of the BASIC 3.0 Compiler. From the Editor menu, choose the Set Editor or Edit command to select the editor you want to run or start the selected editor.

The tool bar contains the tool buttons which enable you to quickly carry out the functions by clicking them. 36099003.eps

Immediately executes the Compiler if a filename is specified. (If no filename is specified, you cannot choose this button.) Starts the editor selected by the Set Editor command in the Editor menu. Opens the Select File dialog box.

Reading in the Initialization File At start-up, Windows-based Compiler reads in the initialization file named BHTC3W.INI from the directory where the file to be executed is located, for setting the options and window sizes. At the end of execution, the Compiler writes the data into the initialization file. The BHTC3W.INI file contains the following: [Settings] .. Compiler setting section List=0 : Editor=c:¥winapl¥edit.exe :

2-7

Page 34

PDT 1100 Terminal Programmer’s Guide

[Windows] AppPosX=100 :

.. Windows' location & size section

Caution Never modify the contents of the initialization file BHTC3W.INI.

Operating Procedure for the Compiler Selecting the File to be Compiled Select a file to compile using one of the following methods: !

From the File menu, choose the Select File command.

!

While holding down the Ctrl key, press the S key. Click the file selection button in the tool bar.

!

36099007.eps

Figure 2-2. Select File Dialog Box

2-8

Page 35

Development Environment and Procedures

Specifying the Compiling Options 1. From the Compile menu, choose the Compiling Options command. The Compiling Options dialog box appears.

36099008.eps

Figure 2-3. Compiling Options Dialog Box 2. Select the check boxes of the options you want to specify. For details about the compiling options, refer to Compiling Options on page 2-14 and Generating a User Program on page 2-12.

2-9

Page 36

PDT 1100 Terminal Programmer’s Guide

Executing the Compiler Execute the Compiler using one of the following methods: ! ! ! ! !

In the Select File dialog box, click the Run button. From the Compile menu, choose the Run command. While holding down the Ctrl key, press the G key. In the Compiling Options dialog box, click the Run button. Click the compile start button in the tool bar.

Note: If the compiling options have been set, you can easily start the Compiler by the Windows' drag-and-drop method, that is, dragging a file to be compiled in File Manager onto the Compiler icon.

Screen Shown During Execution of the Compiler When compiling starts, the mouse pointer turns into an hourglass shape until the process is complete.

Compiling the test TEST.SRC

36099010.eps

Figure 2-4. Compiler Dialog Box

Output from the Compiler The Compiler outputs the following information as well as user programs (object programs) to the destination depending upon the conditions. Enclosed by bold lines are descriptions exclusively applied to the Windows-based Compiler.

2-10