home *** CD-ROM | disk | FTP | other *** search
Text File | 1987-12-12 | 42.1 KB | 1,057 lines |
-
-
- ScnDsign Program Version 2.01
-
-
-
-
-
-
-
-
- Program ScnDsign
-
- By: Iddo L. Enochs
- 403 Cherokee Drive
- Mc Comb, MS 39648
-
- TABLE OF CONTENTS
-
- INTRODUCTION.......................................... 1
- MAKING A BACK-UP COPY................................. 2
- FILES ON SCNDSIGN DISK................................ 3
- SOME DEFINITIONS...................................... 3
- A QUICK TOUR.......................................... 3
- GETTING STARTED....................................... 4
- CHANGING ATTRIBUTES................................... 6
- CENTERING A LINE...................................... 6
- GRAPHICS AND DUPLICATING CHARACTERS................... 6
- MOVING A BLOCK OF SCREEN.............................. 7
- INSERTING A LINE...................................... 8
- DELETING A LINE....................................... 8
- ENDING THE PROGRAM.................................... 8
- DEFINING VARIABLES.................................... 8
- DELETING A VARIABLE................................... 9
- INSERTING A VARIABLE.................................. 9
- RETURNING FROM VARIABLE DEFINITION TO MAIN PART....... 9
- RECALLING THE VARIABLE INFORMATION.................... 9
- VARIABLE FORMATTING...................................10
- SAVING A SCREEN ON DISK...............................10
- COMPILING AND RUNNING THE SCREEN PROGRAM..............10
- DEFAULT VARIABLE VALUES...............................11
- RESTRICTING VARIABLE ENTRY............................12
- USING VARIABLE ARRAYS IN YOUR PROGRAM.................12
- VERSION...............................................14
- CHANGING THE PROGRAM FOR YOUR COMPUTER................14
- CONCLUSION........................................... 14
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- ScnDsign Program Version 2.01
-
-
-
-
- INTRODUCTION:
-
- Welcome to the Program ScnDsign. First of all, I should
- tell you a few things about the program and a few things that
- the program is not. One of the tedious parts of programming
- is the design and lay-out of screens for input of data. This
- program will enable you to do that with a minimum of effort.
- You can design the screen just as you want it to appear in
- your program. You can specify where and what type of
- variables you wish to enter when running the program and
- ScnDsign will take care of the details for you. The program
- will then generate the source code in Turbo Pascal which you
- can then compile and run. The compiled program will lay out
- your screen on the console and then call forth the variable
- information you have placed in your program. The screens will
- also be saved on disk in condensed form so that they can be
- recalled at a later time.
-
- This program is distributed under the Freeware concept.
- That is, you are free to use it without charge and to make
- copies for anyone else. If you find it useful, please send a
- contribution to the address below. The suggested amount is
- $25.00. However, any amount will be appreciated.
-
- Iddo L. Enochs
- 403 Cherokee Drive
- Mc Comb, MS 39666
-
- Please send a copy of this document with the program.
- Thanks for making the Freeware program work.
-
- To experienced computer users I apologize if this
- documentation seems a little pedestrian. However, I have
- written it with the beginner in mind hoping I can save him
- some of the grief I well recall when I was trying to
- understand a program the instructions to which were seemingly
- written in Swahili. I have also tried to keep the computer
- jargon to a minimum.
-
- In order to use the program, it is necessary that you be
- familiar with Turbo Pascal by Borland International and know
- how to edit, compile and run pascal program files with this
- program.
-
- The program is written in Turbo Pascal and generates
- Turbo Pascal code for use in the program you are creating.
- The program is written specifically for the IBM PC but should
- work with most compatibles. Version 2.01 is designed to work
- with both the monochrome adapter and the graphics adapter
- with a monochrome monitor. The program checks to see which
- adapter is installed and then adjusts itself automatically.
- Earlier versions worked only with the monochrome adapter.
-
-
-
- Page 1
-
-
-
-
-
- ScnDsign Program Version 2.01
-
-
-
- MAKING A BACK-UP COPY:
-
- To begin with, make one or more back-up copies of your
- program disk. You can do this if you have only one disk drive
- in the following manner.
- 1. Place your DOS diskette in your drive and at the DOS
- prompt of A>_ type
-
- FORMAT B:/S
-
- and press [Enter].
- The message "Insert new diskette for drive B:
- and strike any key when ready"
- will appear.
- 2. Remove you DOS diskette and put a blank disk into the
- drive and strike any key. DOS will format your disk.
- Using the /S option causes DOS to install DOS system
- files on the diskette so that it can be used without
- having to switch to a separate DOS diskette from time
- time.
- 3. Follow the instructions on the screen until you get
- another DOS prompt.
- 4. Then insert the ScnDsign disk in your drive and type
-
- COPY *.* B:
-
- and press [Enter].
- 5. Follow the directions with the understanding that the
- ScnDsign disk is the scource disk and the newly
- formatted disk is the target disk.
- 6. All of the files on your ScnDsign disk will now be
- copied to the newly formatted disk.
-
-
- With two disk drives the copying process is slightly
- simpler.
-
- 1. With your DOS disk in drive A and a blank disk in
- drive B ,at the DOS prompt of A>_ type
-
- FORMAT B:/S
-
- and press [Enter].
- 2. Follow the instructions until you get another DOS
- prompt of A>_.
- 3. Then insert the ScnDsign disk in drive A and type
-
-
-
- COPY *.* B:
-
- and press [Enter].
- 4. All of the files on your ScnDsign disk will now be
- copied to the newly formatted disk in drive B.
-
-
- Page 2
-
-
-
-
-
- ScnDsign Program Version 2.01
-
-
-
-
- FILES ON THE SCNDSIGN DISK:
-
- You will find the following files on your ScnDsign disk.
-
-
- 1. ScnDsign.pas This is the Pascal scource code file
- for the ScnDsign program.
- 2. ScnDsign.com This is the compiled program for
- designing screens.
- 3. Help.scn This is the help screen (designed with the
- ScnDsign program) which is used to give you helpful
- information when using the ScnDsign program.
- 4. Var.scn This is a screen used in the Define
- Variable part of the program.
- 5. Demo.scn This is a demonstration screen to give you
- an example of the screens you can design.
- 6. General.Inc This file is used with the program file
- which is generated by the ScnDsign program. This file
- will be "Included" at the time the program file (the
- one generated by the ScnDsign program) is compiled.
- It contains the various variable definitions,
- procedures, etc. which will be needed in the program
- file. Don't worry about this file at this time.
-
- SOME DEFINITIONS:
-
- Source code : A program written is some language such as
- pascal to be compiled & run.
- Current drive : The default drive or the drive that DOS
- uses unless directed to do otherwise.
- Work Screen : The screen you are designing.
-
- A QUICK TOUR:
-
- If you would like a quick tour of the program without
- all of the bells and whistles, just continue with this
- paragraph. If you want to learn most of the features while
- designing a demonstration screen, then skip to GETTING
- STARTED.
-
- With the ScnDsign.com, Help.scn and the Var.scn files
- all on the default drive, type "ScnDsign" (without the
- quotes) and press [Enter]. After the Help and Var screens are
- read into memory, follow instructions by pressing any key to
- clear the screen. Then press the Escape key twice to display
- the Help screen which contains most of the information you
- will need to run the program.
-
- Press any key to get back to the main part of the
- program. Then move to approximately the center of the screen
- and type the following:
-
-
-
-
- Page 3
-
-
-
-
-
- ScnDsign Program Version 2.01
-
-
-
- Demonstration
-
- String Entry :
-
- Then press the F8 key to get to the DefineVariable part
- of the program. Define your variable by naming it Stringvar
- and then making it a string variable type. You will then be
- taken to the work screen (the screen you have just laid out)
- and asked to position the variable. Move the cursor to the
- immediate right of the colon and press F1. Then move the
- cursor 7 or 8 more positions to the right and press F1 again.
- Then press the space bar to go back to the variable screen.
- Then press F10 to return to the main part of the program.
-
- Your screen should now look like this with the ones in
- reverse video:
-
- Demonstration
-
- String Entry :1111111111
-
- The ones signify that this is variable number one.
-
- Now press F6 in order to generate the pascal scource
- file for your program. When you are asked for a name of your
- screen, reply with the name Demo10. Now press F10 in order to
- leave the ScnDsign program. You will be given a chance to
- define your variables and save your screen but, since you
- have already done so, ignore this.
-
- A pascal program named Demo10.pas will have been
- generated which will display the screen you designed and will
- call for the string input you specified. A Demo10.scn file
- and a Demo10.var file will also be generated by the program.
- Just ignore the latter two files for the time being.
-
- Now get into Turbo Pascal and compile and run the Demo10
- program. Be sure that you have the General.inc file on the
- current drive when you compile the Demo10.pas program since
- this file will be included at the time of compilation.
-
- As you can see, designing a screen will take just a
- fraction of the time it normally would.
-
- Use your Help screen to learn of the other features of
- the program or read further in these instructions.
-
- GETTING STARTED:
-
- Without further ado let's get started. I will take you
- through a brief session using most of the features of
- ScnDsign and then cover some of the finer points later on.
-
- The files ScnDsign.com, Help.scn, and Var.scn must all
-
-
- Page 4
-
-
-
-
-
- ScnDsign Program Version 2.01
-
-
-
- be on your current drive before beginning. To start the
- program, just type SCNDSIGN and [Enter] at the DOS prompt
- with the working copy of your program in drive A. The
- program will load itself and will then advise you that it is
- reading the two screen files (Help.scn and Var.scn) into
- memory. After the screens are read into memory, the message
- "Press the Escape twice for help" will appear on the screen.
- Also, the message "Press any key to continue" will appear.
- Press any key (the spacebar for example) and the screen will
- go blank. You are ready to begin the session.
-
- To see how the Help screen is activated, press the
- Escape key twice and the Help screen will appear instantly.
- You will notice that there is no disk access. The Help screen
- is merely moved from one area of memory to the screen. The
- Help screen should be pretty well self-explanatory and covers
- the functions when designing the screen and when in the Move
- Block procedure part of the program (more about that later).
- Incidentally,the Help screen cannot be called up later on
- when you get into the Define Variable part of the program,
- but it is not needed then as the Var.scn being used at that
- time has all of the help information you will need.
-
- The Help screen is a good example of the type of screen
- you can quickly and easily design with the ScnDsign program.
- Notice the use of intense characters at some points and the
- use of the blinking B, both of which are easy to make as you
- will soon see.
-
- The IBM screen occupies a total of 4000 bytes of memory
- since there are a total of 25 lines times 80 columns on the
- screen, each of which position occupies one byte of memory,
- or a total of 2000 bytes and a like amount of bytes of
- Attributes which go with each of the screen positions.
- However, if you check the Help.scn file you will notice that
- it occupies only 1335 bytes of memory on the disk. This is
- because the screen information is in condensed form when it
- is saved to disk by the ScnDsign program.
-
- You might like to see one other example of a screen
- designed with this program before proceeding with this
- session. If so, press any key(the space bar will do) to get
- back to the main part of the program. Then use F5 to display
- a screen from a disk file. You will be told that proceeding
- will overwrite what may be on the screen at the time and
- asked if you do wish to proceed. Answer with a "Y". You
- will be asked for the name of the screen filename you wish to
- display. Respond with the name "Demo". The Demo screen should
- appear on your screen. Again notice the use of intense
- characters at some positions on the screen and the use of a
- border around a portion of the screen.
-
- Now you can clear the Demo screen in order to start
- designing your very own screen. An easy way to clear the
-
-
- Page 5
-
-
-
-
-
- ScnDsign Program Version 2.01
-
-
-
- screen is to position the cursor on the topmost line on which
- there are characters and to then press F3 which will delete
- that line. Continue to hold F3 down and successive lines will
- be deleted until the screen is cleared. You can then begin
- using the program to design the screen as you see fit. The
- four arrow keys work just as they normally do; that is, they
- move the cursor around the screen without destroying what is
- on the screen. The Enter key acts as a line feed. The
- Backspace key backs up the cursor and deletes the character
- to the left of the cursor. The Delete key deletes the
- character at the cursor position and moves the line to the
- right of the cursor one position to the left. The Insert key
- toggles the program between the insert mode and the overwrite
- mode. When in insert mode the cursor will be enlarged so that
- you will be aware the insert mode is on.
-
- CHANGING ATTRIBUTES:
-
- For an exercise in screen design, lay out the screen
- approximately as shown below, placing it anywhere on the
- screen. (We will use the Move Block part of the program to
- center it later on) Before typing the title "Demonstration
- Screen", use F4 to change the Attribute mode to intense. When
- you do so, a menu will appear on the screen giving you the
- option of selecting various Attribute options. Select number
- five by entering the numeral five and pressing the [Enter]
- key. You will then notice that selection number five will
- intensify on the screen indicating that this option has been
- selected. Then select option number six in order to return
- to the program. Your Work Screen will instantly reappear.
- From now until you change Attribute again, what you write on
- the screen will appear in the intensified form.
-
-
- Demonstration Screen
-
-
- This is an Integer Variable :
- This is a Real Variable :
- This is a String Variable :
- This is a Boolean Variable :
-
-
- CENTERING A LINE:
-
- With the cursor on the line where you have just written
- "Demonstration Screen", use F1 to center the line on the
- screen. Change Attribute to Normal before completing the rest
- of the screen.
-
- GRAPHICS AND DUPLICATING CHARACTERS:
-
- Now we will place a border around the screen you have
- designed. Place the cursor at the position you want the
-
-
- Page 6
-
-
-
-
-
- ScnDsign Program Version 2.01
-
-
-
- upper left corner of your border, hold down the Alternate key
- with your left hand and enter the numerals 201 using the
- numerical pad. Then release the Alternate key. The ASCII
- character 201 should appear on the screen (a double-lined
- corner emblem). Now, at the screen position immediately to
- the right of this last character, enter the ASCII character
- 205 in like manner. It would be laborious indeed if you had
- to enter each character in the same manner all around the
- border. That is where the Duplicate Character facilities come
- in handy. Position the cursor under the last character you
- entered (two horizontal lines). Then press F7. If you
- continue to hold the F7 key down, these horizontal lines will
- be duplicated across the screen. When you get to the point
- where the upper right corner of the border should be, enter
- the ASCII character 187. Immediately below this character,
- enter the character 186 for two vertical lines. Position the
- cursor under this character and duplicate downward by using
- the Shift and the F7 keys. That is, hold the shift and the F7
- keys down at the same time. Using similar methods, you can
- now complete the left and lower sides of the of the border.
- The ASCII values for the lower left and lower right corners
- of the double lined border are 200 and 188, respectively.
-
- In order to do more graphic work you might wish to get
- access to all of the ASCII Character codes. They are in
- Appendix G of the IBM Basic Manual and in the Sidekick
- Program by Borland International among other places. You can
- then use the Alternate key together with the numeric pad to
- generate any of these characters you may wish. Remember that
- you can only duplicate characters downward and to the right
- but this is no impediment. Just start at the top or to the
- left of the line of characters you wish to make.
-
- MOVING A BLOCK OF SCREEN:
-
- If your border is not quite centered on the screen, we
- will now use the Move Block part of the program to center it.
- Press the F9 key. This gets you into the Move Block part of
- the program. You will be instructed to position the cursor
- at the upper left corner of the block to be moved and to then
- press F1. Do so. You will then be instructed to move the
- cursor to the lower right corner of the block and to then
- again press F1. Do so. Reverse video will then cover the
- block you have outlined. You may then use the four arrow
- keys to move the block around the screen. Do not worry about
- running off the screen as the block movement will stop when
- the block runs into the limits of the screen. One note of
- caution though; the movement of the block will obliterate
- anything in it's path. Now center the block you have outlined
- by using the four arrow keys. To return to the main part of
- the program, press F10. If you care to do so, you may then
- re-position the writing inside the border by using the method
- just outlined.
-
-
-
- Page 7
-
-
-
-
-
- ScnDsign Program Version 2.01
-
-
-
- INSERTING A LINE:
-
- To insert a line, merely use F2. Be aware that if there
- are characters on line 25(the last line on the screen), these
- characters will be lost when a new line is inserted.
-
- DELETING A LINE:
-
- Deleting a line is done with F3.
-
-
- ENDING THE PROGRAM:
-
- To end the program you press the F10 key. However, don't
- do so until you have defined your variables. When you do end
- the program, you will be given the opportunity to save the
- work screen and to define your variables if you have not
- already done so.
-
- DEFINING VARIABLES:
-
- To define the variables now that you have designed you
- screen, press F8. The Var.scn will appear almost immediately.
- The instructions and explanations on the Var.scn should
- enable you to use this part of the program without much
- further help.
-
- At position one in the variable table, enter the name of
- your first variable, IntVar for example. You may use as many
- as ten characters in the variable name. When prompted for the
- type of variable, enter I for integer. You will immediately
- be taken from the Var.scn to the screen you have just
- designed for positioning the place on the screen at which the
- IntVar variable will be entered. Move the cursor immediately
- to the right of the colon after where the screen shows "This
- is an Integer Variable". Then press F1 to tell the program
- that this is where the variable entry point will start. A
- single digit (the last digit of the variable number) will
- appear in reverse video. You will then be prompted to
- position the cursor at the point where the entry point ends
- and to press F1 again. The rest of the variable space will
- be filled with digits. To return to the variable screen,
- merely press any key such as the space bar. If you want a
- variable with a length of one , you can enter F1 the second
- time at the same position you entered the first F1.
-
- There are a few things to notice about this part of the
- program. First of all, you can position the variable where
- there are characters on the screen but these characters will
- be overwritten by the variable. This feature was included
- purposefully so that you may undeline the area in which a
- variable is to be entered if you so wish. Second, the cursor
- will not move off the line where the first F1 is entered.
- Third, the second F1 will not be accepted unless the cursor
-
-
- Page 8
-
-
-
-
-
- ScnDsign Program Version 2.01
-
-
-
- is at or to the right of the first F1 position.
-
- You may select one of four types of variables; integer,
- real, string and boolean. If you select boolean, you will be
- unable to move the cursor after entering the first F1 since a
- boolean variable has a length of one. The boolean variable
- entry will accept only the letters Y or N.
-
- In like manner, name and position the other three
- variables using the names RealVar, StrVar, and BolVar for
- example. Also specify that variable two is a real variable,
- variable three is a string variable, and variable four is a
- boolean variable. You may define up to total of eighty
- variables.
-
- To amend a variable entry, merely position the cursor at
- that variable position in the Variable table using the up and
- down arrow keys. If you want to change the name of the
- variable, type in the new name and then proceed just as you
- normally do. If you don't wish to change the name, just hit
- the Enter key and then proceed just as you normally do.
-
- DELETING A VARIABLE:
-
- To delete a variable, use F3 which is the same key you
- used to delete a line in the main part of the program.
-
- INSERTING A VARIABLE:
-
- To insert a variable at a particular position, position
- the cursor at that position in the variable table by using
- the up and down arrow keys and then enter F2. This is the
- same key used in the main part of the program to insert a
- line. A blank will be inserted in the variable table at that
- point so that you may then define the variable as you see
- fit.
-
- RETURNING FROM VARIABLE DEFINITION TO MAIN PART OF PROGRAM:
-
- To return to the main part of the program, press the F10
- key.
-
- RECALLING THE VARIABLE INFORMATION:
-
- While you are in the Defining Variable part of the
- program, you can recall the variable information which may
- have been saved earlier by pressing F5. You will be prompted
- for the name of the file containing this information. Be sure
- to specify the drive designation if different from the
- current drive. After the file name is properly specified,
- the varible information will be read into the variable table.
-
- VARIABLE FORMATTING:
-
-
-
- Page 9
-
-
-
-
-
- ScnDsign Program Version 2.01
-
-
-
- The program generated by ScnDsign will write real
- variables to the screen with two digits after the decimal
- point. This can be changed easily by editing the Pascal file
- which the ScnDsign program generates. Just change the third
- parameter in the Real_Entry procedure from 2 to the number of
- decimals you want.
-
- SAVING A SCREEN ON DISK:
-
- If you don't have any more work to do on your screen, it
- can be saved to disk. To save a screen to disk file, use F6.
- You will be prompted for the file name. Name the file "Demo2"
- for the screen you have just designed. Be sure to include the
- drive designation if the drive you wish to use is not the
- current drive. Do not include the extension since the
- extension .scn will automatically be added. The Help.scn and
- Var.scn are examples of screen file names. Also, remember
- that if you use the name of an existing file name, that file
- will be overwritten.
-
- When you save your program, three files will be
- generated. The first is a file with the extension scn. This
- is a file containing the information on the screen you have
- designed. The information is in condensed form. This file is
- used by the ScnDsign program to read in a screen when you
- wish to recall a screen you have saved at an earlier date.
-
- The second file is a file with the extension var
- containing the variable information from the variable table.
- You can later use this file to recall the variable table
- information.
-
- The two files mentioned above are used solely for
- recalling the screen and variable information when using the
- ScnDsign program again. If you don't need to recall this
- information, these two files can be deleted.
-
- The third file generated is the source code file with
- the extension of pas which can be compiled and run in order
- to display the screen you have designed and to then read in
- the variable information called for by the screen program.
-
- COMPILING AND RUNNING THE SCREEN PROGRAM:
-
- Now that you have designed your screen and have
- generated a program file to use the screen and variable
- information, we will see how all of this is put together. The
- Demo2.pas file that was generated by the program will have a
- line which reads "{$I General.inc}". This is a directive to
- the compiler to include the General.inc file at this point
- when the Demo2.pas file is being compiled. You might wish to
- read the chapter in the Turbo Pascal reference manual on
- Including files if you wish further explanation. It is
- imperative that you have the General.inc file on the current
-
-
- Page 10
-
-
-
-
-
- ScnDsign Program Version 2.01
-
-
-
- disk drive so that it can be included. As mentioned above,
- the General.inc file contains the general information, types,
- procedures ,etc. that will be needed by the program you have
- generated with the ScnDsign program. You might wish to call
- up the General.inc file with your editor in order to look it
- over. It contains some useful procedures which might be of
- use to you in other programs. Now compile the Demo2.pas file
- and run it. The program will delineate your screen on the
- console. It then will proceed to read in the four variables
- at the appointed positions on the screen accepting only
- appropiate characters at the points the variables are read on
- your screen.
-
- DEFAULT VARIABLE VALUES:
-
- You will notice that the Demo2.pas program sets the
- initial values of the all but the boolean variables in the
- program. The numeric variables are set to zero and the
- string variables are set to null values. This is called
- initializing in computer jargon. This is done for a couple
- of reasons at least one of which could be important to you in
- designing your program.
-
- First of all, if you wish not to make entries for
- certain variables, you may just hit the Enter key at the
- point where the variable is to be entered when running the
- program. If the initial values had not been set when you hit
- the Enter key, you might end up with some garbage for a
- variable value.
-
- Of more importance is the way the program works if you
- wish to use default values other than zero or null values for
- certain of your variables. Let us assume that you have
- thirty variables on your screen and twenty-five of these
- variables have default(other than zero or null) values which
- are used most of the time when running the program. In order
- to save the person who runs the program a great deal of time
- you can edit the program with your Turbo Pascal Editor and
- set the initial values to these default values. Now, when
- someone runs the program and comes to a variable entry point,
- he or she can merely hit the Enter key if that variable
- default value is acceptable. The three procedures in the
- General.inc file which are used for accepting integer, real
- and string variables are designed so that hitting the Enter
- key will not change the default value of that particular
- variable.
-
- To give you and example of this, go back and edit your
- Demo2.pas program so that the the IntVar, RealVar, and StrVar
- variables have default values of 99, 677.56 and
- "Demo", respectively. Now run the program and you will see
- that you can merely hit the Enter key at the point these
- variables are to be entered and the default values will be
- accepted.
-
-
- Page 11
-
-
-
-
-
- ScnDsign Program Version 2.01
-
-
-
-
- As I am sure you understand, the program generated by
- the ScnDsign program, such as the Demo2.pas program, is
- merely the nucleus of the program you will end up with.
- You can add to this program, incorporate it into another
- program, elaborate on it, or rearrange it as you see fit.
-
- RESTRICTING VARIABLE ENTRY:
-
- As you have seen, the program generated by ScnDsign will
- accept only the characters appropriate for the type variable
- being entered at that point. Only numerals and a decimal
- point will be accepted for real variables, as an example.
- However, suppose that you wish to further restrict the entry
- to only certain values.
-
- I thought of designing ScnDsign so that this could be
- accomplished, but the effort hardly seemed worth the candle.
- If you wish to restrict certain of your variables to definite
- values, I would suggest doing so in the following manner.
-
- Assume the you wish to restrict your IntVar entry to any
- value from 1 through 50 or to 75. Edit the code in your
- program file so you have a set as shown and the variable
- enrtry routine will end up looking something like the example
- below. The rest of the program is omitted for the sake of
- simplicity.
-
- Const
- OKset : set of byte = [0..50,75];
-
- Repeat
- GotoXY(52,10);
- Integer_Entry(IntVar,5);
- if IntVar not (in OKset) then write(^G);
- until IntVar in OKset;
-
- Now your program will not proceed until the proper value
- is entered for IntVAr and will beep each time that an
- improper value is entered. Incidentally, sets won't work with
- real variables, so you will be obliged to use relational
- operators to restrict real variables to certain ranges.
-
- I'm sure you get the idea that with the ScnDsign program
- as a starter, you can make your final program as elaborate as
- you wish.
-
- USING VARIABLE ARRAYS IN YOUR PROGRAM:
-
- I have used some screen design programs which required
- you to define each element of an array, a laborious job. If
- your program requires an array of variables , it seems easier
- to me to define one element of the array and to then edit
- your program code to take care of the final version of the
-
-
- Page 12
-
-
-
-
-
- ScnDsign Program Version 2.01
-
-
-
- array.
-
- As an example, let us assume the your program will
- require data entry something like that shown below.
-
- Emp. Number Last Name Salary Department
- -------------------------------------------------
- 344 Smith 12500.00 Maintenance
- 877 Jones 16750.00 Accounting
- 463 Devers 22500.00 Procurement
- 184 Johnston 13000.00 Accounting
- (assume there are 16 more lines of data)
-
- You should design your screen just as you would normally
- do. When you get to the Variable Definition part of the
- program, treat the program as if the first line of data entry
- were the only line. Part of the code generated would look
- something like the following. I have omitted the code which
- initializes the variables and writes these initial values to
- the screen. This part of the code can be omitted in the
- edited version since there will be no need for initial values
- in this type program.
-
- Var
- EmpNum : integer;
- Salary : real;
- LastName,Dept : AnyString;
-
- Begin
- GotoXY(6,3);
- Integer_Entry(EmpNum,5);
- GotoXY(17,3);
- String_Entry(LastName,10);
- GotoXY(30,3);
- Real_Entry(Salary,9);
- GotoXY(45,3);
- String_Entry(Dept,12);
- end.
-
- Now that you have the basic information of where the
- variables are placed on the first line of data entry, it is a
- relatively simple matter to edit the program changing the
- variables to arrays so that the program takes care of all of
- the elements of the array. Your newly edited program would
- look something like the following.
-
- Var
- EmpNum : array[1..20] of integer;
- Salary : array[1..20] of real;
- LastName : array[1..20] of AnyString;
- kount : integer;
-
- Begin
- for kount := 1 to 20 do
-
-
- Page 13
-
-
-
-
-
- ScnDsign Program Version 2.01
-
-
-
- begin
- GotoXY(6,kount + 2);
- Integer_Entry(EmpNum[kount],5);
- GotoXY(17,kount + 2);
- String_Entry(LastName[kount],10);
- GotoXY(30,kount + 2);
- Real_Entry(Salary[kount],9);
- GotoXY(45,kount + 2);
- String_Entry(Dept[kount],12);
- end;
- end.
-
- Now, the program will ask for all 20 lines of data
- before ending. Notice that the program now tells the cursor
- to go to line number kount + 2 rather than line 3. This is
- because kount starts out with one in the first iteration so
- the cursor still starts out on line three. Incidentally,
- don't use the variable "count" for iteration as it is used in
- the General.inc file and there could be interaction.
-
- Again, a portion of the code was left out for the sake
- of clarity. I hope, however, you can see that the program
- generated by ScnDsign is the starting point, and that with a
- little extra effort you can provide for a large amount of
- data entry with no great amount of effort.
-
- VERSION:
-
- This is version 2.01 of ScnDsign. The first version of
- the program portrayed a screen on the console by reading the
- screen imvormation directly from a condensed file into
- memory. However, this method proved somewhat slower than the
- method used in version 2.0 which consisted of writing to the
- console by generating and compiling pascal code. Those of you
- interested in the first method can find both the method of
- saving the screen information and the method of reading this
- information into screen memory in the ScnDsign.pas file
- contained on this disk.
-
- CHANGING THE PROGRAM FOR YOUR COMPUTER:
-
- Previous versions of this program were written solely
- for the IBM PC with a monochrome monitor. This made it
- necessary for you to amend the source code if you used a
- graphics adapter or a color monitor. However, this version
- adjusts itself automatically to the type monitor and adapter
- you are using.
-
- CONCLUSION:
-
- There you have it. The program can and will save you a
- great amount of time in designing screens and providing for
- data entry. It could have been made much more elaborate, but
- an effort has been made to keep it simple with the
-
-
- Page 14
-
-
-
-
-
- ScnDsign Program Version 2.01
-
-
-
- understanding that frills can be added by editing the basic
- program you get. Although I have tested the program at
- length, please understand that I cannot be responsible for
- any liability for damages or lost profits which may result
- from the use of this product.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Page 15
-
-
-
-