home *** CD-ROM | disk | FTP | other *** search
/ Programmer 7500 / MAX_PROGRAMMERS.iso / INFO / TURBOPAS / TURBOSCR.ZIP / TURBSCRN.DOC < prev   
Encoding:
Text File  |  1986-01-02  |  7.2 KB  |  137 lines

  1.  
  2.  
  3.  
  4. *****************************************************************************
  5. *****************************************************************************
  6. ******                                                                 ******
  7. ****                       T U R B O S C R E E N S                       ****
  8. ***                        ==-==-==-==-==-==-==-==                        ***
  9. ***                    Turbo Pascal Source Code Generator                 ***
  10. ***                                                                       ***
  11. ***                                   By                                  ***
  12. ***                            Joel E. Kozikowski                         ***
  13. ****                                                                     ****
  14. ******                                                                 ******
  15. *****************************************************************************
  16. *****************************************************************************
  17.  
  18. INTRODUCTION:
  19.  
  20.    TurboScreens is a simple utility that takes a text file image of a screen
  21. created with any editor and generates Turbo Pascal code necessary to reproduce
  22. that screen during runtime.  The screen image may contain any characters,
  23. including IBM graphic characters.  Each line in the file should be a maximum
  24. of 80 characters long.  Anything above the 80 character mark will be ignored.
  25. Note that TurboScreens does no checking on the number of lines in the file-
  26. it is possible for code to be generated that references screen positions out-
  27. side of the 25 line limit.  It is your responsibility to keep you text file
  28. the proper side.
  29.  
  30. GENERATING THE SOURCE CODE:
  31.  
  32.     To generate source code, it is first necessary, obviously, to create a
  33. screen.  Any word processor that is capable of creating text files (such as
  34. WordStar (tm)) can be used.  I do recommend, however, that you use one of
  35. the many screen editors available in the public domain that are used to create
  36. files for Bulletin Board Systems.  These editors usually allow you to use the
  37. block graphic characters of the IBM, and make much nicer screens, since they
  38. are specially designed for this purpose. The editor I used to use TurboScreens
  39. is Super Graph 3, which is usually found under the file name SG3.COM on most
  40. IBM bulletin boards.
  41.     After you have created a screen, you need to get to the DOS prompt and
  42. issue the TURBSCRN command.  After the program title page, you will be
  43. prompted for the screen file name.  You must type in the full name, including
  44. the extension.  After TurboScreens has verified the existence of such a file,
  45. you must supply the source code file name.  If you supply no extension,
  46. TurboScreens assumes .PAS.  After you supply a source code name, a few brief
  47. moments will supply you with usable source code to be included or inserted
  48. into your programs.
  49.  
  50. USING THE SOURCE CODE:
  51.  
  52.     In order for the source code generated by TurboScreens to work, you must
  53. include a copy of the function `StringOf()' in your program source code.  This
  54. function is identical to the STRING function in BASIC (i.e. it returns a 
  55. string of a character repeated a certain number of times).  This procedure
  56. must come before any code that has been generated by TurboScreens.
  57.     StringOf() also has some special program conditions.  In your global
  58. TYPE definitions, there must be a statement declaring a type String255 =
  59. String[255].  This is the type returned by a function call to StringOf().
  60. You should also set the string parameter checking compiler option passive
  61. (i.e. {$V-}).  The two statements that do this are included in the source
  62. code of the StringOf() function located in the text file STRINGOF.PAS that
  63. was included with TurboScreens.
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70. SOME NOTES ABOUT THE SOURCE CODE:
  71.  
  72.     TurboScreens uses the following criteria when generating code:
  73.  
  74.  
  75. Each line of code will not exceed an 80 column limit (i.e. when included
  76. in you program, it will not take up more than one line).  If a line of your
  77. screen file will take more than 80 columns of source code to reproduce it,
  78. TurboScreens will generate another Write statement.
  79.  
  80. Normal display characters (such as alphabetic and numeric characters) will
  81. be contained within single quotes in a Write statement- as will most of the
  82. characters that can be typed on your keyboard.  Special graphic characters
  83. and the single quote (which would generate a syntax error if used within
  84. single quotes in a Write statement) are represented with their ASCII numbers
  85. (Example: The heart character would appear like Write(#3); ).
  86.  
  87. Any character that is repeated in your screen file enough consecutive times
  88. that it would be shorter to use the StringOf() function instead will be
  89. represented as such.  It take about 16 characters of source code to use
  90. the StringOf() function, so 16 or more normal characters will be coded using
  91. the StringOf() function. Also, 4 or more graphic characters (each written as
  92. #nnn) will also be compressed using the StringOf() function.
  93.  
  94. A string of 8 or more spaces in the source code generally makes reading the
  95. code very difficult.  For this reason, when 8 or more spaces are encountered,
  96. they are not coded.  Instead, a GotoXY statement and a new Write statement are
  97. issued and coding resumes.
  98.  
  99. For easier readability, the code generated is indented within the procedure
  100. created.  Each block of code generated for each line of your screen is 
  101. separated by a blank line so you may see which statements represent which 
  102. lines.
  103.  
  104.  
  105. SOME SUGGESTIONS:          
  106.  
  107. TurboScreens generates a procedure called ScreenGen, which is commented as to
  108. which screen file generated it.  This title is just for the sake of
  109. completeness.  You may (and are really expected to) change the procedure
  110. name, as well as any of the code generated.
  111.  
  112. I have found TurboScreens to be very helpful in a number of areas.  It can
  113. be used to code title screens for your programs, data entry screens, help
  114. screens, and instruction screens.  When help screens or instructions are
  115. relatively short (say, one or two screens), it is much better to have them
  116. "Hard Coded" in your program rather than having them stored in a separate 
  117. program that your program reads in.  This eliminates the need for a separate 
  118. file that can be, if you distribute your program on Bulletin Board systems,
  119. forgotten.  It also eliminates need for extra disk access.
  120.  
  121. When creating complicated data entry screens, it may be a good idea to have
  122. TurboScreens write a "shell" procedure that puts up on the screen the things
  123. that never change (such as field labels, boarders, etc.)  If you make a 
  124. second copy of your screen file, you may place `X's in the places where
  125. you wish to have the actual data, and you can erase all of the other
  126. characters on the screen (such as the field labels).  By using this second
  127. file, you can have TurboScreens give you a quick list of all of the screen
  128. coordinates where your data is to be located.  This allows you to use
  129. your screen editor as "electronic graph paper".
  130.  
  131.  
  132. A LAST WORD:
  133.   If you have any suggestions for the program, or if you find any bugs,
  134. please let me know.  I would like to hear your ideas (and your complaints!)
  135. Write to  Joel Kozikowski
  136.           937 Stockton Street
  137.           Indianapolis, IN  46260