home *** CD-ROM | disk | FTP | other *** search
-
-
-
- *****************************************************************************
- *****************************************************************************
- ****** ******
- **** T U R B O S C R E E N S ****
- *** ==-==-==-==-==-==-==-== ***
- *** Turbo Pascal Source Code Generator ***
- *** ***
- *** By ***
- *** Joel E. Kozikowski ***
- **** ****
- ****** ******
- *****************************************************************************
- *****************************************************************************
-
- INTRODUCTION:
-
- TurboScreens is a simple utility that takes a text file image of a screen
- created with any editor and generates Turbo Pascal code necessary to reproduce
- that screen during runtime. The screen image may contain any characters,
- including IBM graphic characters. Each line in the file should be a maximum
- of 80 characters long. Anything above the 80 character mark will be ignored.
- Note that TurboScreens does no checking on the number of lines in the file-
- it is possible for code to be generated that references screen positions out-
- side of the 25 line limit. It is your responsibility to keep you text file
- the proper side.
-
- GENERATING THE SOURCE CODE:
-
- To generate source code, it is first necessary, obviously, to create a
- screen. Any word processor that is capable of creating text files (such as
- WordStar (tm)) can be used. I do recommend, however, that you use one of
- the many screen editors available in the public domain that are used to create
- files for Bulletin Board Systems. These editors usually allow you to use the
- block graphic characters of the IBM, and make much nicer screens, since they
- are specially designed for this purpose. The editor I used to use TurboScreens
- is Super Graph 3, which is usually found under the file name SG3.COM on most
- IBM bulletin boards.
- After you have created a screen, you need to get to the DOS prompt and
- issue the TURBSCRN command. After the program title page, you will be
- prompted for the screen file name. You must type in the full name, including
- the extension. After TurboScreens has verified the existence of such a file,
- you must supply the source code file name. If you supply no extension,
- TurboScreens assumes .PAS. After you supply a source code name, a few brief
- moments will supply you with usable source code to be included or inserted
- into your programs.
-
- USING THE SOURCE CODE:
-
- In order for the source code generated by TurboScreens to work, you must
- include a copy of the function `StringOf()' in your program source code. This
- function is identical to the STRING function in BASIC (i.e. it returns a
- string of a character repeated a certain number of times). This procedure
- must come before any code that has been generated by TurboScreens.
- StringOf() also has some special program conditions. In your global
- TYPE definitions, there must be a statement declaring a type String255 =
- String[255]. This is the type returned by a function call to StringOf().
- You should also set the string parameter checking compiler option passive
- (i.e. {$V-}). The two statements that do this are included in the source
- code of the StringOf() function located in the text file STRINGOF.PAS that
- was included with TurboScreens.
-
-
-
-
-
-
- SOME NOTES ABOUT THE SOURCE CODE:
-
- TurboScreens uses the following criteria when generating code:
-
-
- Each line of code will not exceed an 80 column limit (i.e. when included
- in you program, it will not take up more than one line). If a line of your
- screen file will take more than 80 columns of source code to reproduce it,
- TurboScreens will generate another Write statement.
-
- Normal display characters (such as alphabetic and numeric characters) will
- be contained within single quotes in a Write statement- as will most of the
- characters that can be typed on your keyboard. Special graphic characters
- and the single quote (which would generate a syntax error if used within
- single quotes in a Write statement) are represented with their ASCII numbers
- (Example: The heart character would appear like Write(#3); ).
-
- Any character that is repeated in your screen file enough consecutive times
- that it would be shorter to use the StringOf() function instead will be
- represented as such. It take about 16 characters of source code to use
- the StringOf() function, so 16 or more normal characters will be coded using
- the StringOf() function. Also, 4 or more graphic characters (each written as
- #nnn) will also be compressed using the StringOf() function.
-
- A string of 8 or more spaces in the source code generally makes reading the
- code very difficult. For this reason, when 8 or more spaces are encountered,
- they are not coded. Instead, a GotoXY statement and a new Write statement are
- issued and coding resumes.
-
- For easier readability, the code generated is indented within the procedure
- created. Each block of code generated for each line of your screen is
- separated by a blank line so you may see which statements represent which
- lines.
-
-
- SOME SUGGESTIONS:
-
- TurboScreens generates a procedure called ScreenGen, which is commented as to
- which screen file generated it. This title is just for the sake of
- completeness. You may (and are really expected to) change the procedure
- name, as well as any of the code generated.
-
- I have found TurboScreens to be very helpful in a number of areas. It can
- be used to code title screens for your programs, data entry screens, help
- screens, and instruction screens. When help screens or instructions are
- relatively short (say, one or two screens), it is much better to have them
- "Hard Coded" in your program rather than having them stored in a separate
- program that your program reads in. This eliminates the need for a separate
- file that can be, if you distribute your program on Bulletin Board systems,
- forgotten. It also eliminates need for extra disk access.
-
- When creating complicated data entry screens, it may be a good idea to have
- TurboScreens write a "shell" procedure that puts up on the screen the things
- that never change (such as field labels, boarders, etc.) If you make a
- second copy of your screen file, you may place `X's in the places where
- you wish to have the actual data, and you can erase all of the other
- characters on the screen (such as the field labels). By using this second
- file, you can have TurboScreens give you a quick list of all of the screen
- coordinates where your data is to be located. This allows you to use
- your screen editor as "electronic graph paper".
-
-
- A LAST WORD:
- If you have any suggestions for the program, or if you find any bugs,
- please let me know. I would like to hear your ideas (and your complaints!)
- Write to Joel Kozikowski
- 937 Stockton Street
- Indianapolis, IN 46260