home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 5 Edit / 05-Edit.zip / wplog32.zip / readme.txt < prev    next >
Text File  |  1993-10-03  |  25KB  |  400 lines

  1. WPLOG32.ZIP   Four WordPerfect 5.2 for OS/2 and Windows macros
  2.  
  3. LOGMAC32.ZIP Different in name only (same macros) to differentiate between 
  4. the Windows and OS/2 WordPerfect versions.  Depending on how the macro 
  5. language changes between future releases of WPWin and WPOS/2, Windows 
  6. compatibility may be discontinued - assuming, of course, I come up with
  7. any other 'bright' ideas.
  8.  
  9. LogFiles.WCM
  10. ------------
  11.         This macro will first cycle through all open documents, making note
  12. of their names to be displayed in the LogFiles menu.  The user can then
  13. click upon the files he/she would like excluded from the logging process.  
  14. A maximum thirty-five character Work Profile name (see A Note About 
  15. Profiles) is then assigned which identifies the group of logged files.  
  16. Once the user clicks 'OK', the macro begins to log all selected files, 
  17. adding the doc.'s name and cursor location in WPWP.INI.  With version
  18. 3.2, it is now possible to select which documents you would like closed as 
  19. well as logged.  Thus, if you have 4 docs opened, you can have the macro 
  20. log docs.  1-3, but close only docs. 2 and 4. This feature is not
  21. available if the LogFiles menu has been turned off in LogState.
  22.         Also new to version 3.2 is the elimination of the 4 Work-Profile
  23. limit.  As a result, two more buttons have been added to LogFiles' dialog
  24. box - Delete Profile and Edit Name.  The first deletes all the logging
  25. information from the given profile, but leaves the [LogProfile] section in 
  26. WPWP.INI with the single line ProfName=Free.  If/when you create another 
  27. Work Profile, the macro will either add the information to the first 
  28. [LogProfile] section with a ProfName=Free key or create another section if 
  29. none is found.  The second button brings up another dialog box in which you 
  30. can rename/edit the displayed Work Profile name.  This does not overwrite 
  31. the logged information, simply the name which identifies that particular 
  32. Work Profile.  
  33.         LogFiles now minimizes the documents as the filenames are read. 
  34. This not only improves performance by eliminating the need for WP to 
  35. perform screen redraws, but it also helps to see exactly what's going on.  
  36. With the addition of the Close Selective docs. feature, knowing what 
  37. remains opened is important, especially if you intend to Resume another 
  38. Work Profile.  Doc. windows can be returned to a previous state upon
  39. macro completion (see LogState.WCM).
  40.         It also struck me that it would be advantageous to have specific
  41. profiles automatically resume in Express Mode, regardless of the default
  42. setting in LogState's group box.  As a result, a check box has been added
  43. below the Profile list box. This addition necessitated yet another addition,
  44. mentioned in the next paragraph.
  45.         The other addition is a mode overide.  If the Menu Prompt is
  46. selected in LogState (the default setting), or if the specific profile
  47. has not been marked as Express in LogFiles, you have a certain amount
  48. of time when the macro first runs to switch to Express Mode.  The same
  49. holds true for Express - hitting the ESC key will initiate a mode
  50. opposite to the one that is currently active.
  51.  
  52. Resume.WCM
  53. ----------
  54.         Resume reads the logged filenames in the selected Work Profile in
  55. WPWP.INI and displays the filenames in a menu.  The user can choose to 
  56. exclude some of the docs. from the list or fetch a different profile.  
  57. Once 'OK' is selected, the macro opens the selected files and, using the 
  58. cursor-location information logged previously, returns the cursor to its 
  59. position when the file was originally logged.  You can use the Work 
  60. Profiles generated by version 3.0.  If the macro is unable to retrieve the 
  61. cursor information, a brief message will appear informing you of the 
  62. problem, the cursor will remain at the top of the document, and the macro 
  63. will resume operation.  You'll have to hunt up the [Comment | Logged[x]] 
  64. (where [x] is either 1, 2, 3, or 4) yourself and remove it manually.  
  65. Logging the file with version 3.1 and above will add the necessary 
  66. information to the Work Profile in WPWP.INI.  
  67.         As in version 3.0, if a file has been deleted or renamed by the
  68. user between the LogFiles and Resume processes, the macro will simply 
  69. inform the user that the file in question could not be opened, and resume 
  70. operation.  
  71.         If you would rather do without the cursor repositioning feature,
  72. click on the radio button marked Leave Cursor at Top in LogState's Cursor 
  73. Repositioning group box.  If repositioning is turned off, the cursor will 
  74. remain at the top of the document after it has been opened by Resume.  You 
  75. can also turn Position and Line repositioning off.  See the description for 
  76. LogState for more on this.  As a result of the addition of the Close 
  77. Selective docs. feature, Resume first cascades all opened docs., which 
  78. allows you to see what docs are currently opened to avoid opening a doc.
  79. that is already so.  Doc. windows can be returned to a previous state upon
  80. macro completion (see LogState.WCM).  If you happen to select a file that is
  81. opened, Resume will try to open it.  In the OS/2 version, at least, WP
  82. gives you the choice of either cancelling the doc. opening or going ahead
  83. and opening it as a read-only file.  Opening it isn't a problem, but 
  84. choosing not to load it is.  It sends an Error message to Resume, which 
  85. causes the macro to branch to an ONERROR label which I used in case a user 
  86. attempted to open more docs. than WP would allow.  There was no way out of 
  87. this catch-22 as far as I could see except by issuing an ONERROR CALL 
  88. statement before the files are loaded.  In that case, if you do try to open 
  89. a file that is already opened, and you choose not to load it when WP 
  90. prompts you, the error message will be diverted away from the official 
  91. error label.  In essence, this means that the macro will continue loading 
  92. the files checked off in Resume's menu, but if you try to exceed the doc.  
  93. limit, you won't get a warning telling you that such-and-such a file was 
  94. not opened.  Instead, the macro will end abruptly but peacefully.  It was
  95. one or the other, and I thought the one was more useful than the other.
  96.         One final addition is a mode overide.  If the Menu Prompt is
  97. selected in LogState (the default setting), or if the specific profile
  98. has not been marked as Express in LogFiles, you have a certain amount
  99. of time when the macro first runs to switch to Express Mode.  The same
  100. holds true for Express - hitting the ESC key will initiate a mode
  101. opposite to the one that is currently active.
  102.  
  103. LogState.WCM
  104. ------------
  105.         This macro allows the user to specify whether the File-Selection
  106. prompt should appear when LogFiles and Resume are run.  LogState can be run 
  107. from either of the two other macros in order to configure LogFiles and 
  108. Resume.  N.B. The macro must first be compiled; otherwise, an error 
  109. message will be generated by WP.  To turn File-Selection prompts back on,
  110. run LogState again.  Turning the File-Selection prompt Off will not give 
  111. you access to the Work Profiles or Selective doc. closing in LogFiles, 
  112. however.  The last Work Profile you selected will be active until it is 
  113. changed.  Alternatively, you can press the ESC key when LogFiles or Resume
  114. first run in order to access the Interactive mode for that specific session.
  115.         New to version 3.2 is the Close Documents at Log Time menu.
  116. Selecting Close All Documents simply checks off all the documents that are 
  117. listed in LogFiles' dialog box.  Selecting Close Selective Documents simply 
  118. leaves the check boxes empty in LogFiles' dialog box.  If File-Selection 
  119. menus are turned off, Logfiles will log and close all opened documents.  
  120.         Also new to version 3.2 is the ability to launch LogFiles or Resume
  121. directly from LogState.  N.B. Both macros must first be compiled in order 
  122. to launch them directly from LogState; otherwise, WP will generete an error 
  123. message, and LogState will terminate.  After you've made your menu 
  124. selections, clicking on either the LogFiles or Resume button will first 
  125. save the LogState selections to WPWP.INI and then launch LogFiles or 
  126. Resume.  
  127.         As stated above, LogState can also turn Position or Line and
  128. Position repositioning off or shorten the timeout length.  This is 
  129. accomplished by clicking on the Timeouts button.  When cursor repositioning 
  130. is selected, the cursor first moves to the page logged in WPWP.INI.  The 
  131. macro then looks at the line number and estimates whether it lies on the 
  132. top or bottom half of the page.  If at the bottom, the cursor is 
  133. repositioned to the bottom of the page and counting begins from there, 
  134. moving up one line at a time.  Finally, the macro attempts to match the 
  135. cursor location with that found in WPWP.INI.  Like the line repositioning, 
  136. character repositioning first estimates whether the cursor should go in the 
  137. first or the second half of the line.  If the first half, then the cursor 
  138. is moved to the right one character at time.  For these reasons, Line and 
  139. Position Counters in the Cursor Repositioning Timeout dialog box cannot 
  140. exceed 50.  There wouldn't be much point in specifying a larger number, 
  141. since it would take too long for a timeout to occur if the cursor was 
  142. unable to find its previous location, and most sheets of paper will only 
  143. hold a maximum of 80 characters by 66 lines.  To turn either Line or 
  144. Position repositioning off, change the number in the appropriate counter to 
  145. 1. This will also disable the Timeout error message in Resume.  I added 
  146. these timeout procedures to take into account significant editing of a 
  147. document between logging processes and possible errors in WP's reporting 
  148. cursor location (this happened to me once).  For example, if the first log 
  149. reports cursor location on Pg 10, Ln 6.67", and Pos 3.68", but you delete 
  150. everything from Pg 10, Ln 1.00" on later and then try to Resume the 
  151. document still later, obviously, the cursor will never find its old 
  152. location.  The repositioning loop would go on endlessly since it would 
  153. continue looking for a Ln number it could never reach.  This is a problem 
  154. only for Ln and Pos repositioning.  To avoid a possible conflict, I've also 
  155. added a small verification routine when the Page reposition is executed.  
  156. If, using the previous example, you deleted everything from Pg 9 on, the 
  157. cursor would first land on Pg 9 without giving an error, and start looking 
  158. for the old cursor location on the wrong page.  To prevent this, the macro 
  159. checks the page number it lands on.  If it doesn't match the logged page 
  160. number, repositioning stops and the cursor remains on whichever page it 
  161. happens to be when the error occurs.
  162.         Two additional group boxes have been added to version 2.0, both of
  163. which set document window behaviour upon completion of LogFiles and Resume.
  164. In LogFiles, the doc. windows are normally left minized.  You can change
  165. this by clicking on a specific radio button, either Maximize, Tile, Cascade,
  166. or Minimize.  In Resume, doc. windows are normally left cascaded.  By
  167. clicking on the appropriate radio button in LogState, you can have Resume
  168. maximize the doc. windows upon exit, or, alternatively, have the doc.
  169. windows tiled or cascaded (if anyone feels a need to have docs. minimize
  170. themselves upon macro completion, drop me a line and I'll implement it).
  171.         The behaviour of the 'Timeouts' push button has also been altered to
  172. reflect the state of the 'Leave Cursor at Top' radio button in the 'Cursor 
  173. Repositioning' group box.  If it is, the 'Timeouts' button will read 
  174. 'Refresh Dialog Box' rather than 'Timeouts...'.  This serves two purposes:  
  175. to avoid confusion if the 'Leave Cursor at Top' button is selected 
  176. (in which case Timeouts are irrelevant) and to have the macro redraw 
  177. the dialog box in the event that the 'Leave Cursor at Top' radio 
  178. button is deselected and the user desires to change timeout defaults.
  179.  
  180. MenuLog.WCM
  181. -----------
  182.         This is a small macro that will add the above three macros to
  183. WordPerfect's File menu.  If you're like me, you're not overly fond of 
  184. using a mouse and/or a button bar.  By running this macro, you can press 
  185. the Alt+F, / keys to gain easy access to LogFiles, Resume, or LogState.  If 
  186. you haven't got the /m-macroname switch already when launching WP, just add 
  187. it as a parameter, e.g.  /m-menulog.  If you've already got a startup 
  188. macro, simply add a Run statement at the end of the original startup macro, 
  189. e.g.  Run("macropath\menulog.wcm") where macropath is the location of the 
  190. MenuLog macro.  It is important that the Run statement be last (before a 
  191. Quit statement, obviously), because MenuLog ends with a Return statement, 
  192. which is required by LogState.  The reason why LogState calls MenuLog is 
  193. that the Document Logging and Resume Profile submenus reflect the state of 
  194. menu prompts.  If you turn Resume's File-menu prompt off, for example, the 
  195. submenu item will read 'Resume Profile... - Express' as opposed to simply
  196. 'Resume Profile...' This is to help people like myself with short 
  197. memories.  There shouldn't be a problem if you've got some of your own 
  198. items added to the File Menu, because MenuLog attempts to add the 'Log /
  199. Resume' item only immediately after Save As...; if it encounters an 
  200. error, it tries to delete an item bearing the 'Log / Resume' name and then
  201. attempts, once again, to add 'Log / Resume' to the File Menu.  If you
  202. encounter difficulties (like MenuLog appearing to be caught in an endless 
  203. loop), try including your own items in MenuLog and then running it.  By 
  204. default, MenuLog is not invoked by LogState.  If you would like to have 
  205. LogState add and dynamically update the 'Log / Resume' menu item in WP's 
  206. File Menu, click on the Menu button in LogState, and click on the 'Add Log 
  207. / Resume to File Menu' checkbox.  
  208.  
  209. A Note About Profiles
  210. ---------------------
  211.         By 'profile' I mean a working environment.  It's easier to think of
  212. Work Profiles as different projects you are working on.  LogProfile2, for 
  213. example, could contain the documents you had opened while working on 
  214. Chapter Two of a book, whereas LogProfile1 could contain the document list 
  215. from your work on an article you intend to continue at a later time.  All 
  216. Profiles are user-definable in that the user can assign a descriptive name 
  217. of up to 35 characters to each profile.  Using the above example, 
  218. LogProfile2 could be be named 'Chapter Two' and LogProfile1 'Article - 
  219. needs a conclusion'.  In LogFiles, the profile names can be edited (by 
  220. pressing the 'Edit Names...' button) or you can add a new Work Profile
  221. simply by typing a new name in the drop box.  In Resume, profiles cannot be
  222. changed - what you see is what WPWP.INI reports.
  223.  
  224.  
  225. Cleaning up WPWP.INI
  226. --------------------
  227.         If you've used a version of LogFiles earlier than 3.0, you'll have
  228. to clean up your WPWP.INI file unless you don't mind having useless 
  229. information stored in it.  WPWP.INI is normally stored in your \os2 
  230. directory for OS/2 users, \os2\mdos\winos2 directory for WinOS/2 users, or 
  231. \windows directory for Windows users.  Open the file using any ASCII text 
  232. editor, and delete the section called [Log-Resume].  It should look 
  233. something like this:  
  234.  
  235.           [Log-Resume]
  236.           Doc1=[the document name goes here]
  237.           Doc2=[ditto]
  238.           NumberOfFiles=2
  239.  
  240. The reason for this cleanup is that version 3.x of LogFiles and Resume 
  241. looks for sections called [LogProfile{x}], where {x} is a number from 1
  242. up. The keys in the [LogProfile{x}] sections remain the same except for a
  243. few additions.  Once you've made the appropriate deletion, save WPWP.INI 
  244. as an ASCII file.  Note, however, that some ASCII editors leave an 
  245. end-of-file marker (^Z) at the end of the file.  If this is the case, 
  246. the macros will continue to function, but if you try editing WPWP.INI, 
  247. you won't see what lies beyond the ^Z mark.  For OS/2 users, bear in 
  248. mind, also, that long filenames may be wrapped to the next line, and 
  249. the text editor may append a CR/LF code at the end of the first line, 
  250. thereby effectively truncating the filename.  If this happens, Resume 
  251. will report a file-not-found error.  
  252.  
  253. Bugs
  254. ----
  255.         There are no known bugs, except for those that are generated by WP
  256. for OS/2 5.2.  According to WPOS/2 Tech. support, the inability to use
  257. mnemonics as short-cuts to various options in a menu has been documented 
  258. and is expected to be corrected in a later release (perhaps 6.0).  
  259. Similarly, pressing <Enter> to proceed or <Esc> to dismiss a dialog box
  260. do not function properly.  This falls under the mnemonic bug just mentioned.
  261. A pointing device, therefore, is required.  As far as I know, none of this
  262. Applies to WPWin 5.2.  
  263.         For some reason the 'Yes!' parameter in the FileSave(Variable; 
  264. WordPerfect51!; Yes!)  command does not overwrite an existing file without 
  265. prompting the user as it's supposed to; instead, it invariably brings up 
  266. the FileSaveAs dialog box at least on my system.  Omitting the Yes! parameter 
  267. seems to have cleared up the problem, but it may need to be added in an 
  268. interim or future releases of WP for OS/2 and/or for WPWin 5.2.  If you 
  269. find a bug, please contact me at
  270.  
  271.         G9026163@mcmail.cis.McMaster.CA
  272.  
  273. The address should be valid for the next year or so.  
  274.         What is known are the following limitations:  if you use accented 
  275. characters in your filenames, Resume may choke (and bring WordPerfect down 
  276. with it).  This may only be a limitation on the OS/2 version - I haven't 
  277. tried it on WPWin.  If you're a rapid mouse clicker, one of the macros may 
  278. go into Pause mode (this usually happens only with LogState).  If it appears 
  279. that a macro isn't doing anything, check WordPerfect's Macro menu.  If you 
  280. see a check mark beside the Pause option, simply click on it to uncheck 
  281. Pause and the macro will resume.  
  282.  
  283. Acknowledgments
  284. ---------------
  285.         I'm not much of a programmer.  My motto is, if it works, great.
  286. Many thanks must go to Ulrich Brinkman, who, way back in March '93 
  287. suggested using the DLLCall command to write and read the information to 
  288. WPWP.INI instead of to a WP document as I had originally done.  Richard 
  289. Reiner is largely responsible for version 3.0 of the WPWin set, since he 
  290. graciously permitted me to mofidy his LastFour macro, thereby allowing the 
  291. user to select the files he/she wants logged and/or reopened.  He also 
  292. permitted me to modify his NamedMrk macro to search for a specific 
  293. [Comment] rather than simply any [Comment] in the same version.  Richard 
  294. has also been exceptionally patient with me in helping to debug the various 
  295. macros and full of ideas for improvements.  
  296.  
  297. Revision History:
  298. ================
  299. Logfiles.WCM
  300. ------------
  301.         1.0:    (Feb. '93) Initial WPWin 5.2 release.
  302.         1.1:    Added If statement to correct the creation of a blank
  303.                 document if only one doc. is logged.
  304.         2.0:    (Mar.  '93) Ulrich Brinkmann's implementation of DLLCall
  305.                 code to log files in WPWP.INI.  
  306.         3.0:    (Jul.  '93) Incorporated and modified some of Richard
  307.                 Reiner's LastFour.WCM code to allow user either to log all
  308.                 currently opened documents or a selection.  Replaced two
  309.                 consecutive [Comment] codes by one [Comment] containing the
  310.                 string 'Logged[x]', where '[x]' is a number from 1 to 4.
  311.                 R.R.'s code for extracting the contents of a [Comment],
  312.                 comparing it to a specified string, and deciding whether 
  313.                 the [Comment] is the one we want or whether the macro
  314.                 should keep looking makes the one [Comment] possible. 
  315.                 Added the ability to bypass the File-Selection menu.  
  316.                 Added max. 4 user-defined profiles.  
  317.                 (Aug.  '93) Some modifications made for WPOS/2 5.2, to
  318.                 accommodate HPFS and the quirky way WPOS/2 cycles
  319.                 through open docs.  'Previous Doc' doesn't seem to
  320.                 do what it's supposed to, i.e.  it doesn't work at all! 
  321.         3.1:    (Aug.  '93) Did away with the [Comment] method of keeping
  322.                 track of the cursor location altogether, which allowed me
  323.                 to bypass the Save() command if a document has not been
  324.                 modified a real time-saver in the long run!  
  325.                 Added a small checking routine to ensure that the cursor is
  326.                 at the MainEditScreen before proceeding with the logging
  327.                 process.  This is necessary if, for example, the cursor is
  328.                 in a Foot/Endnote.  If it is, a Close() command is issued,
  329.                 and the cursor returns to MainEditScreen.  
  330.         3.2:    (Sept. '93) Added Selective Doc. Closing in LogFiles menu
  331.                 (this feature is not available if you've turned the menu
  332.                 off in LogState).  Also added a DocMinimize() command to
  333.                 speed processing up a little and to allow the user to see
  334.                 which docs. remain open after the logging process.  Removed
  335.                 the 4 Work-Profile limit and added the Delete and Edit
  336.                 buttons.  Improved some of the code for more reliable
  337.                 performance and eliminated the NumberOfFiles= key for each
  338.                 [LogProfile]. Eliminated redundant code.
  339.                 Added doc. window behaviour upon completion of macro.
  340.                 (Oct. '93) Added the 'Resume - Express' checkbox and the
  341.                 manual overide.
  342.  
  343. Resume.WCM
  344. ----------
  345.         1.0:    (Feb. '93) Initial Release.
  346.         2.0:    (Mar. '93) Ulrich Brinkmann's implementation of DLLCall 
  347.                 code to fetch the filenames from WPWP.INI before opening.
  348.         3.0:    (Jul. '93) Inclusion of Richard Reiner's code from
  349.                 LastFour.WCM to enable user to select what docs. he/she
  350.                 would like opened.
  351.                 Improved error handling Abort! message no longer 
  352.                 encountered if full document roster is used;
  353.                 Resume won't grind to a halt if a file to be reopened no
  354.                 longer exists Added the ability to bypass the 
  355.                 File-Selection menu. Added max. four user-defined profiles.
  356.                 (Aug. '93) Some modifications for the WPOS/2 5.2 version, 
  357.                 to accommodate HPFS.
  358.         3.1:    (Aug. '93) By eliminating the [Comment] method of keeping
  359.                 track of the cursor location at log time, I've managed to
  360.                 shave 30 seconds off a two document resumption (a small,
  361.                 informal, and very unscientific in-house test).  Of course,
  362.                 if cursor repositioning is turned off, you'll shave even
  363.                 more off processing time.
  364.         3.2:    (Sept. '93) Added a WindowCascade() command so that the 
  365.                 user can see the documents that are being opened, and
  366.                 choose the one he/she would like to edit after Resume is
  367.                 complete. I think clicking on the Maximize button is easier
  368.                 than going the Window | Doc. menu route.
  369.                 Added timeout routines for cursor relocation.
  370.                 Eliminated redundant code.
  371.                 Added doc. window behaviour upon completion of macro.
  372.                 (Oct. '93) Implemented the mode overide in accordance with
  373.                 the profile-specific express mode.
  374.  
  375. LogState.WCM
  376. ------------
  377.         1.0:    (Jul. '93) Initial release as LogPrmpt.WCM
  378.                 (Aug. '93) Added ability to turn cursor repositioning ON or
  379.                 OFF
  380.                 Name change from LogPrmpt.WCM to LogState.WCM to reflect
  381.                 additional function.
  382.         2.0:    (Sept. '93) Added ability to run LogFiles and Resume
  383.                 directly from LogState. Added Close Documents at Log Time
  384.                 items.
  385.                 Added the Repositioning push button and accompanying
  386.                 dialog box to configure the cursor repositioning timeout
  387.                 parameters for Line and Position.
  388.                 Added the  Menu  button and dialog box to activate MenuLog
  389.                 whenever LogState is run.
  390.                 Added the LogFiles and Resume Document Window group boxes.
  391.                 Changed the behaviour of the 'Timeouts...' push button to
  392.                 reflect the state of the 'Leave Cursor at Top' radio button.
  393.  
  394. MenuLog.WCM
  395. -----------
  396.         1.0     (Sept. '93) Initial release
  397.  
  398. Paul H. Caron                                G9026163@mcmail.cis.McMaster.CA 
  399. (3 October 1993)
  400.