home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 5 / Apprentice-Release5.iso / Utilities / Programming / EnterAct 3.7.3 / Documentation / EnterAct 3 Manual < prev    next >
Encoding:
Text File  |  1996-06-15  |  344.4 KB  |  9,011 lines  |  [TEXT/KEEN]

  1. ****************ENTERACT™ USER’s MANUAL*****************
  2. -    -    -    -    -    -    -    -    -    -    -    -
  3. Preface and Copyright
  4. -    -    -    -    -    -    -    -    -    -    -    -
  5. ____
  6. Copyright © 1991-1996 by Dynabyte. EnterAct 3.6, by Ken Earle.
  7. All rights reserved.
  8. Thanks to Zelko Jagaric, Wai Choi, Rob Gibson, Steve Olson,
  9. Jean François Cassan, Mark Wong, Scott Jenson, Bill Sears, Sandra Lakin,
  10. Nicolas Berloquin, Romain Vignes &c for help and constructive abuse.
  11.  
  12.                 (Using EnterAct? <Option>zoom to open this window up)
  13.  
  14. You can reach me at:
  15. Ken Earle
  16. 697 Spadina Ave
  17. Toronto, ON
  18. CANADA
  19. M5S 2J1
  20.  
  21. 73073,2166                                    via CompuServe,
  22. 73073.2166@compuserve.com        via InterNet.
  23. ____
  24.  
  25. The 68K version of EnterAct (3.5) is FREE.
  26. There is, as yet, no released native PPC version.
  27.  
  28. "hAWK", "Read Resource", their associated source code and
  29. manuals, and the Drag_on Modules interface are yours to keep,
  30. free, no matter what. They are governed by the Free Software
  31. Foundation's "copyleft", as described in the document "copying
  32. hAWK", included with your EnterAct package.
  33.  
  34. You may distribute full copies of EnterAct (omitting no files from
  35. the compressed archive that comprises EnterAct), provided you
  36. do not charge for EnterAct itself.
  37.  
  38. EnterAct is an editor for creating, maintaining, and reviewing C, C++
  39. and Java code. EnterAct has many capabilities (most notably
  40. real-time automatic definition and prototype display, even out of
  41. first-draft code) that just aren’t "out there" yet. This is a
  42. finite-lived product, intended to fill the gap until EnterAct’s best
  43. features are available elsewhere. Let’s hope it doesn’t take more
  44. than a year or two. That having been said, please note that
  45. EnterAct itself is a solid editor. It’s been around since 1989.
  46.  
  47. If you just want to use EnterAct as a "definition viewer" to help
  48. out some other editor, see the section
  49. ____
  50. §    EnterAct as a "definition finder"
  51. ____
  52. (to get there, use "Enter Selection" and "Find Again" on the above line).
  53.  
  54. Metrowerks codewarriors, please see Appendix 5.
  55.  
  56. Symantec lightspeeders, please see Appendix 4.
  57.  
  58. (Using EnterAct? <Option> click in the title bar here)
  59.  
  60. MPWers, start doing your happy dance.
  61.  
  62. For the very very impatient:
  63.     •1    Put EnterAct and the "Drag_on Modules" folder at the top
  64.     level of your most-used compiler folder (that's not a complete install,
  65.     please see the document "Installing EnterAct" later). TPM users, follow
  66.     instructions in your Symantec manual for using a third-party editor.
  67.     •2    Start up EnterAct.
  68.     •3    If you want to do Java, use the "File Extensions..." dialog to add
  69.     "java" as an extension for the left pane of a project. Doing it now will
  70.     affect all new projects.
  71.     •4    Make a project (New Project), just as with THINK C etc.
  72.     Select your system folder for <header> files in the next dialog that
  73.     appears, or Cancel to use the folder that contains EnterAct.
  74.     •5    Use "Add All in Folder" etc to add files. Hold down the <Shift>
  75.     key and that menu item changes to "Add All in Subfolders".
  76.     •6    "Update Dictionary". See "DON’T GIVE UP" a page or so below
  77.     if you run into a problem. Usually problems are rare, fixes are easy.
  78.     •7    Pick the "AutoLook" command.
  79.     •8    Open a project source file and browse around. Double-click on
  80.     or click just after any name that you’d like to see a definition
  81.     or prototype for. Watch the AutoLook window. Press <Enter>.
  82.     •9    Come on back here, and learn about all the other good stuff
  83.     (persistent lookup windows, cross-referencing, Automark, browser,
  84.     hyperlinks, the hAWK language, code templates, persistent undo, etc).
  85.  
  86. For the just very impatient: see "EnterAct in brief" instead of this.
  87. Included there are details on using EnterAct as a "definition viewer"
  88. while working with other editors.
  89.  
  90. -    -    -    -    -    -    -    -    -    -    -    -
  91. Requirements
  92. -    -    -    -    -    -    -    -    -    -    -    -
  93. (§)    Network and team users please read this
  94. EnterAct does not keep files open, except when in the act of
  95. reading and writing them. EnterAct is, however, SourceServer
  96. aware, and won't allow changes to a file that have been checked
  97. out as read-only unless you issue a "Modify Read Only" command
  98. or enable EnterAct's "ignore ckid's" option.
  99. So use (multiple copies of) EnterAct only if you have some way of
  100. ensuring that you won't have several people working on the same
  101. copy of a file at the same time (such as SourceServer/Projector).
  102.  
  103. (§)    System requirements
  104. System 7 required. Mac II speed (!! that is, a 68020 running
  105. at 16 mHz) is recommended if your project contains more than about
  106. 500K of text in source and header files combined. A hard disk is a
  107. practical necessity. A large screen (>= 16 inches) will
  108. allow you to take better advantage of EnterAct’s information
  109. lookup capabilities. EnterAct requires 2 Meg of memory minimum, 
  110. 7-8 Meg for big projects. The price of power.
  111.  
  112. EnterAct is intended for creating, maintaining, and reviewing Symantec,
  113. MPW, and MetroWerks C/C++/Java code. You may in rare cases
  114. find one or two small difficulties right at first (see DON’t GIVE UP
  115. just below) but you should find that EnterAct understands your
  116. C/C++/Java, and even your “C--” (first-draft stuff).
  117.  
  118. Feel free to print this manual (use EnterAct so the pictures will print).
  119. The benefits of having it on disk are that you can use Find on the
  120. table of contents and elsewhere to jump to topics of interest, and
  121. that this document is marked with chapter headings—hold down the
  122. <Command> key and click in the title bar to view the marker menu for
  123. this file.
  124.  
  125. -    -    -    -    -    -    -    -    -    -    -    -
  126. DON’T GIVE UP
  127. -    -    -    -    -    -    -    -    -    -    -    -
  128. DON’T GIVE UP if you attempt to "Update Dictionary" and the parser
  129. complains about your perfectly good source: quite often, this first
  130. problem will be your last, and easy to fix. (Note with v3.0.5
  131. EnterAct is smarter about handling complicated preprocessor
  132. tangles -- if you get stuck, please let me know and I
  133. will try to fix the problem at my end. My tech support address
  134. is up above. As of this writing EnterAct runs into problems
  135. only with rather pathological practices, such as duplicated
  136. comment starts [this check can be turned off in the Options
  137. dialog], aliases for keywords, and one or two other oddities
  138. as described in the "Source code restrictions" chapter.)
  139.  
  140. The commonest problem involves conditional #defines which
  141. duplicate important punctuation (here '{'), such as
  142. ____
  143.     #ifdef GO_LONG
  144.     long GetArrayIndex(void) {
  145.     #else
  146.     short GetArrayIndex(void) {
  147.     #endif
  148. ____
  149. —although this particular example doesn't bother EnterAct. If
  150. you do run into a problem it will almost certainly be something
  151. similar, involving duplicated punctuation such as the two '{'s above.
  152. The fix for this sort of problem is to recast the definition slightly
  153. to remove the duplicated punctuation:
  154. ____
  155.     #ifdef GO_LONG
  156.     long GetArrayIndex(void)
  157.     #else
  158.     short GetArrayIndex(void)
  159.     #endif
  160.     {
  161. ____
  162.  
  163. Similarly, if a construction such as
  164. ____
  165.     struct Thing
  166.     #ifdef _cplus_
  167.     : public BaseThing
  168.     #endif
  169.     {....
  170. ____
  171. causes a problem it will work fine if recast as
  172. ____
  173.     #ifdef _cplus_
  174.     struct Thing : public BaseThing
  175.     #else
  176.     struct Thing
  177.     #endif
  178.     {...
  179. ____
  180. although once again this example is handled correctly
  181. by EnterAct.
  182. (Note in this case the definition that appears first will be the
  183. one that appears in your Browser window.)
  184. Nested comment starts ( /*.../*...*/) will also cause the parser
  185. to hiccup. Best, fix the comment so it has one start and one end.
  186. Second best, pick "Options" from the Edit menu and deselect
  187. "Detect nested comment starts".
  188.  
  189. -    -    -    -    -    -    -    -    -    -    -    -
  190. CONTENTS
  191. -    -    -    -    -    -    -    -    -    -    -    -
  192. (Each line in quotes «» below is a "Go to" link: to go to a chapter,
  193. click on its line and select "Go to" from the Search menu.
  194. For more on "Go to" links, see chapter 17.  These chapter links
  195. are available in the popup marker menu, which you can bring up
  196. by holding down the <Command> key and clicking in the title bar.
  197.  
  198. Section names are also listed here, though they are not links or
  199. markers: to go to a section, select the name including the '§', and
  200. then use "Enter Selection" and "Find Again" from the Search menu.
  201. While within a chapter, you can advance from section to section
  202. by searching for just the '§' character, which is an <Option><6>.)
  203.  
  204. «01   Introduction»
  205. «02   About EnterAct»
  206. §    When to use EnterAct
  207. §    An overview
  208. §    Looking ahead
  209. «03   Getting started»
  210. «04   Definitions and conventions»
  211. (chapter 05 has been deleted)
  212. «06   Whirlwind tour»
  213. «07   Source code restrictions»
  214. §    Why not just compilable code?
  215. §    Aliases
  216. §    Obviously unnecessary parentheses
  217. §    Nested comment starts
  218. §    Preprocessor tangles
  219. §    All–or–nothing macro’s
  220. «08   Projects»
  221. §    Introduction
  222. §    Project files
  223. §    Creating a project
  224. §    Selecting your <system> folder
  225. §    Three panes—.c, .h, plain text
  226. §    Adding Java files
  227. §    Add Files—the one-at-a-time way
  228. §    Adding files from a list
  229. §    Add All In Folder—the fast way
  230. §    Add Mac Headers
  231. §    Add THINK Headers
  232. §    Add Standard C Headers
  233. §    The active pane
  234. §    Remove File
  235. §    Remove •'d Files
  236. §    Custom file extensions
  237. §    Distinguishing ".h" from <.h>
  238. §    Copy and search in the project window
  239. §    Project memory needs
  240. §    Multi-file selection
  241. §    Project context restoration
  242. §    Switching to other projects
  243. §    Tips
  244. «09   Dictionaries»
  245. §    Introduction
  246. §    What’s in a dictionary
  247. §    Building your dictionary
  248. §    Keeping it up to date
  249. §    How long will it take?
  250. §    Show Dictionary
  251. «10   Lookup»
  252. §    AutoLook
  253. §    Regular lookup (press <Enter>)
  254. §    <Enter> for lookup, advancing, scrolling
  255. §    Looking up the clip (press <Command><Enter>)
  256. §    Reverse lookup (press <Shift><Enter>)
  257. §    “Sounds like” lookup (press <Option><Enter>)
  258. §    Viewing other entries in lookup windows
  259. §    For faster lookup
  260. §    Hints with lookup
  261. §    Number of lookup windows
  262. §    Number of entries per lookup
  263. §    Keeping lookups around
  264. §    Looking up your notes
  265. §    EnterAct as a "definition finder" for other editors
  266. §    Looking it up with THINK Reference or Toolbox Assistant
  267. «11   Seeing where a term is defined»
  268. §    <Option>double–click
  269. §    Find Definition
  270. §    If there are multiple definitions
  271. §    Other ways of finding definitions
  272. «12   Browsing»
  273. §    The Browse command
  274. §    Finding classes in the Browser window
  275. §    Method and class popups
  276. §    Browsing classes without the browser
  277. §    Browsing methods without the browser
  278. «13   Documents and windows»
  279. §    New, Open, Close
  280. §    Save, Save As, Revert
  281. §    Close and Save Documents
  282. §    Autorevert
  283. §    Modify Read Only
  284. §    Saving window locations
  285. §    ... without being pestered
  286. §    Newly opened windows can be long or short
  287. §    <Option>–Zoom zooms just the length
  288. §    Number of windows at one time
  289. §    The Windows menu
  290. §    The display box
  291. §    Printing
  292. §    Illustrating your text
  293. «14   Editing»
  294. §    Introduction
  295. §    Undo
  296. §    Typing, Cut, Copy, Clear
  297. §    Paste preserves indentation
  298. §    Code templates
  299. §    Selection: front, next–to–front
  300. §    Paste Selection Behind
  301. §    Font, font size, tabs
  302. §    Shift Left / Right
  303. §    Reformat Selection
  304. §    Syntax coloring
  305. §    Graphic nesting display
  306. §    Arrow keys for moving around
  307. «15   Balance»
  308. §    Checks everything
  309. §    Shows the error location
  310. §    Balancing a file
  311. §    Balancing a specific delimiter
  312. §    Nested and bad comments
  313. §    Starting in the middle
  314. §    The asm problem
  315. «16   Search»
  316. §    Introduction
  317. §    Find is modeless
  318. §    Find options
  319. §    Batch Find options
  320. §    Dual Batch Find
  321. §    <Tab> and <Return>
  322. §    Find again
  323. §    Enter selection
  324. §    Recent finds are remembered
  325. §    Replace
  326. §    Replace and Find Again
  327. §    Replace All
  328. §    Multi–file searches
  329. §    Skip '-' : excluding files from a search
  330. §    THINK Find commands
  331. «17   “Go” commands»
  332. §    Go to Top/Bottom
  333. §    Go to
  334. §    Going to included files
  335. §    Going to text positions
  336. §    Going to markers
  337. §    Go Back
  338. «18   Markers and the Locations menu»
  339. §    Introduction
  340. §    Mark
  341. §    Marker menus
  342. §    Unmark
  343. §    Automark
  344. §    Copying marker names
  345. §    The Locations menu
  346. «19   Options, under the Edit menu»
  347. §    Introduction
  348. §    Number of lookup windows
  349. §    Number of entries per lookup window
  350. §    Remembering window locations
  351. §    Long or short windows
  352. §    Reformat Selection options
  353. §    Detect nested comment starts
  354. §    Ignore 'ckid's
  355. §    Automark source files, Save source/headers marks
  356. §    Relocate files automatically
  357. «20   Switching to other applications»
  358. §    Under the Finder (System 6)
  359. §    Under MultiFinder (or System 7)
  360. §    Check the disk for changes
  361. §    Working with THINK C
  362. «21   Show activities»
  363. §    Introduction
  364. §    What’s recorded
  365. §    Recording limitations
  366. §    Showing your recent activities
  367. §    What’s shown
  368. §    Temporary, obsolete, and undone activities
  369. §    Updated file names
  370. §    Reviewing activities
  371. §    Selective single undo
  372. §    Reverting a file
  373. §    Turning activity recording on and off
  374. «22  "Index" commands»
  375. §    Functions…
  376. §    Cross-Reference…
  377. §    #Includes…
  378. §    Marker Names…
  379. §    Potential Locals
  380. §    Standard Metrics
  381. §    Check Prototypes
  382. «23  Some thoughts on using EnterAct»
  383. §    Projects are cheap
  384. §    Learning from or reviewing code
  385. §    On documenting your work
  386. «24  If there's a problem»
  387. §    Out of memory
  388. §    Dictionary problems
  389. §    Lookup problems
  390. §    Editing problems
  391. §    Balance problems
  392. «25  License agreement, tech support»
  393. §    Technical support
  394. §    License
  395. «26  Appendix 1: Drag_on Modules»
  396. «27  Appendix 2: Calling hAWK programs»
  397. §    Calling hAWK from the menu
  398. §    Calling hAWK with a command line
  399. «28  Appendix 4: EnterAct as THINK's editor»
  400. §    Requirements
  401. §    Installing EnterAct as THINK’s editor
  402. §    Starting a session
  403. §    Working with EnterAct as THINK’s editor
  404. §    Using THINK’s Find commands from EnterAct
  405. «29  Appendix 5: EnterAct and Code Warrior»
  406. «30  Appendix 6: the Scripts menu»
  407.  
  408. (for all about the Drag_on Modules, please see
  409. «hAWK User’s Manual» and «Read Resource Manual»
  410. included with this package, as well as Appendices 1 and 2 here)
  411.  
  412. -    -    -    -    -    -    -    -    -    -    -    -
  413. Introduction
  414. -    -    -    -    -    -    -    -    -    -    -    -
  415. Feeling slightly disoriented? That’s just the anesthetic wearing off.
  416. You now have several megabytes of new memory installed in your head,
  417. preloaded with the important facts on everything of interest in your
  418. source code. To access your new memory, click after the name of any
  419. function, struct, define, etc that you’d like to remember in detail,
  420. and glance at the "AutoLook" window.
  421.  
  422. Welcome to EnterAct. If you’re at light speed, prepare for warp drive.
  423. If you’re learning C/C++/Java, you’ll find that the ability to  look up
  424. anything of potential interest gives you more than total recall:
  425. you now have an on–line personal tutor.
  426.  
  427. If you just want to use EnterAct as a "definition viewer" to help
  428. out some other editor, see the section
  429.     §    EnterAct as a "definition finder"
  430. (to get there, use "Enter Selection" and "Find Again" on the above line).
  431.  
  432. This manual is not as impersonal as it perhaps should be, for
  433. which the author apologizes, however insincerely. My name is Ken
  434. Earle, I’m responsible to you for EnterAct’s performance, and since
  435. several of EnterAct’s editing enhancements will be new to you I
  436. will occasionally intrude a personal opinion or bit of advice. For
  437. the most part, though, you should put on your Adventure hat and
  438. expect to take EnterAct in your own direction. If you’ve
  439. done some programming in C/C++ on the Mac, you’ll find that EnterAct
  440. is very easy to get used to. EnterAct is intended to complement
  441. MPW, Symantec, or CodeWarrior (or Sun's JDK), which you will
  442. need for compiling and testing your code. For creating,
  443. maintaining, learning from, and documenting code—read on.
  444.  
  445.  
  446. (§)    60 second warmup
  447. EnterAct uses a project window to keep track of your files, as does
  448. THINK C for example. However, the main purpose of an EnterAct project
  449. is to allow you to build a dictionary of all terms in your project,
  450. for rapid lookup. There are three panes in an EnterAct project window,
  451. containing your .c, .h, and documentation files from left to right
  452. respectively. The easiest way to add files to your project is to use
  453. the “Add All In Folder...” command. To build a dictionary, select
  454. “Update Dictionary”. Unless there are major errors in your source code,
  455. this will zip along at 2-3 files per second. (If you hit a problem, see
  456. DON’T GIVE UP up above, around line 126 for easy fixes to most
  457. problems.) Double–click on any file name in the project window to
  458. view a file. To look up a term, double-click on it, or click just after
  459. it (or of course type it in) and press <Enter>. Select “AutoLook” to put
  460. EnterAct’s automatic definition retriever on-screen, and it will keep up
  461. with you as you edit and click about. You should find that "AutoLook"
  462. by itself can fill most of your information needs.
  463.  
  464.  
  465. (§)    Onwards
  466. What next? If you read straight ahead to the end of the “Whirlwind
  467. tour” you’ll have a good grasp of the basics. Reading the remainder
  468. of the manual at some point is a good idea. You will find that many
  469. things that were relatively complicated or tedious before, such as
  470. information lookup, integrating documentation with code, file and
  471. window management, picking up where you left off, etc, are now much
  472. simpler, some to the point of being completely automatic. Inevitably,
  473. when tasks become simpler, new possibilities and approaches spring to
  474. mind.
  475.  
  476. You can use EnterAct as a replacement for THINK’s editor (THINK
  477. version 6 and later, the “use external editor” Edit option in
  478. THINK)—see Appendix 4 for the easy how-to. EnterAct also sends
  479. "touch" events to any running CodeWarrior compilation
  480. environment. 
  481.  
  482. After you feel comfortable with EnterAct, please take a look at the
  483. “hAWK User’s Manual” on disk. Many useful programs are supplied for
  484. this powerful little language, they’re easy to run, and hAWK does its
  485. work in the background.
  486.  
  487. And remember, take a break every hour!
  488.  
  489. -    -    -    -    -    -    -    -    -    -    -    -
  490. About EnterAct
  491. -    -    -    -    -    -    -    -    -    -    -    -
  492. §    When to use EnterAct
  493. EnterAct is a standalone, project-oriented, language-aware programmer’s
  494. editor designed to smooth the process of creating C, C++, and Java code.
  495. You should find EnterAct useful for the following tasks:
  496.     •    requirements analysis, specification, and design document creation
  497.         or review
  498.     •    creating, maintaining and reviewing source code
  499.     •    as a "definition finder", helping editors that aren't as aware
  500.     •    linking support documents and source code
  501.     •    debugging sessions that require extensive source code review
  502.     •    keeping a log of your activities
  503.     •    oddjobs such as multi-file search and replace, automatic source code
  504.         generation, cross-referencing, algorithm prototyping, deleting or
  505.         copying a list of files, etc etc (via “Index” commands and hAWK,
  506.         both under the EnterAct menu).
  507.  
  508. You'll need a compiler/debugger for compiling and testing your
  509. code, and a resource editor will round out your code creation
  510. environment.
  511.  
  512. EnterAct can be used in place of THINK’s editor (the “use external
  513. editor” Edit option in THINK version 6/7). For the simple setup
  514. required, see Appendix 4.
  515.  
  516. To use EnterAct as a "definition finder" with other editors:
  517.     •    read enough here to learn how to create a project, build
  518.     a dictionary, and show the "AutoLook" window. Knowing
  519.     how to call up "lookup" windows by pressing the <Enter>
  520.     key is also useful. 
  521.     •    when you're using the other editor, also run an EnterAct
  522.     project with contents roughly corresponding to the code
  523.     you're working on - have the "AutoLook" window open,
  524.     as the frontmost text window in EnterAct. Your project
  525.     dictionary should be reasonably up to date.
  526.     •    to look up a term with EnterAct; Copy it in the other editor,
  527.     and switch to EnterAct. If you don't immediately see the
  528.     definition in the AutoLook window (rare), press
  529.     <Command><Enter>. To look up the class or struct that
  530.     contains a particular member, press <Shift><Command><Enter>.
  531.  
  532. §    An overview
  533. EnterAct provides a variety of capabilities in several different areas
  534. to make creating and reviewing code simpler. As the following summary
  535. suggests, you do have a handful of new concepts to become comfortable
  536. with. But for the most part you’ll find just new ways of looking at
  537. old problems, and it shouldn’t be long before you take it all for
  538. granted.
  539.  
  540.  
  541. >    Information management
  542.     •    each EnterAct project stores, for instant retrieval:
  543.         •    the prototype of every method and function (including static and
  544.             in-line)
  545.         •    and the full definition of every class, struct, union, enum, enum
  546.             constant, #define’d constant or macro, typedef, and variable
  547.  
  548.         provided the definition or declaration occurs at the top level of
  549.         your project source code, or within a class. As a special case, #define’s
  550.         within struct, union, and enum bodies are also recorded. (Hereafter,
  551.         “definition” will be used as shorthand for “definition or prototype”).
  552.     •    Definitions can be stored for any C/C++/Java file you
  553.         specify, including toolbox headers, standard library files, class
  554.         source or headers, and of course your own source files, even if they
  555.         are under development (typically EnterAct can tolerate or compensate
  556.         for almost all first-draft errors and omissions)
  557.     •    the “AutoLook” window automatically displays the definition of any
  558.         name that you select or click after, keeping up with you as you edit
  559.         and mouse around. It also serves as a spelling checker
  560.     •    for more permanent displays of definitions, or to look up a term when
  561.     you’ve forgotten its correct spelling, double-clicking on or clicking
  562.     after the name and pressing the <Enter> key creates a separate window
  563.     holding the definition. This is called "regular” lookup, and the
  564.     resulting window shows either all variant definitions, if your spelling
  565.     was exact, or closest matches, based on runs of matching characters,
  566.     if your spelling was off
  567.     •    for phonetic or “sounds like” lookup, press <Option><Enter> instead
  568.     •    for reverse or “struct for member” lookup, press <Shift><Enter> to
  569.     view all structs, classes, and unions whose definitions mention the
  570.     name
  571.     •    results for regular, phonetic, and reverse lookup are shown in a
  572.     new separate “lookup” window, politely sized and placed. Hold down the
  573.     <Option> key and click in its title bar to select from a popup menu
  574.     listing the definitions that were retrieved for the name being looked up
  575.     •    as a result of the above approach, you can show several definitions
  576.     at once from the same file or different files in separate, self-managed
  577.     windows.
  578.     •    EnterAct's "Browse" window does the expected things (and more),
  579.     and works with first-draft C++ or Java code. And it looks pretty.
  580.  
  581. >    File and window management
  582.     •    an EnterAct project window has three panes, showing source, header,
  583.         and documentation file names in separate alphabetical columns. Any
  584.         file can be opened by double-clicking on its name (or hit <return>)
  585.     •    since Enteract is not a compiler, there is no need to set up code
  586.         segments. As a result, EnterAct’s “Add All In Folder” command can
  587.         add all of the files in a folder to your project with a single click
  588.         (including, optionally, all files in subfolders), automatically placing
  589.         source, header, and documentation files in their appropriate panes
  590.     •    all Mac headers, THINK C headers, or standard C headers can be added
  591.         to your project with single separate menu commands
  592.     •    multi-file selections (a generalization of multi-file searching)
  593.         can be made right in the project window
  594.     •    windows can remember their screen location and size—and, if you so
  595.         choose, won’t pester you about saving changes if all you changed was
  596.         the location or size
  597.     •    when EnterAct opens a file for the first time, it bases the width
  598.         of the window on the first 20 lines of the file
  599.     •    <Option>-zoom drops down the bottom of a window, not affecting the
  600.         width.
  601.     •    text files are saved safely. Project saving is automatic, and this
  602.         is threaded into the background when possible.
  603.  
  604. >    Editing
  605.     •    smart paste of code blocks reduces the need to “Shift” left or right
  606.     •    the “Paste Selection Behind” command combines Copy, switch to the
  607.         window just behind, and Paste over what is selected there. It’s
  608.         undoable (in EnterAct even “Replace All” is undoable), and to help you
  609.         anticipate results the selection in your next-to-front window is
  610.         outlined in a box
  611.     •    “Balance” handles comments and strings, and can balance a whole file
  612.         at once. If there is an error, you will be shown where it is
  613.     •    now and then, a picture is worth a thousand words. For these
  614.         occasions, you can place and display a picture in any text document,
  615.         even a source file (put it inside a comment, and the compiler will
  616.         never know)
  617.  
  618. >    Context restoration
  619.     •    “project context restoration”: when you close an EnterAct project,
  620.         it keeps a list of your project files that were open at the time; and
  621.         when you later reopen the project, your working documents will reopen
  622.         at the same time, placed on the screen where you left them (also called
  623.         the “painless Quit”) 
  624.     •    “activity review”: the “Show Activities” command displays a list
  625.         of the last 10,240 things you have done, in plain English, with full
  626.         contents of all text inserts and deletes. With this display, you can:
  627.         •    review your progress when making complicated changes
  628.         •    accurately bring your “Log” or “Version History” up to date if you
  629.             let this lapse for a bit
  630.         •    selectively undo a single activity
  631.         •    revert files to recover earlier versions
  632.     •    “safe switching”: EnterAct will optionally save your documents when
  633.         you switch out, and refresh them from disk when switching back if
  634.         you changed any with some other application. This restores the
  635.         synchronisation between EnterAct and other applications, and helps
  636.         prevent losing changes to a file.
  637.  
  638. >    Context alteration ("navigation”)
  639.     •    Automatic marking of source files whenever you open or save
  640.         a file, including all function, method, and class definitions.
  641.         (To access a document’s marker menu, hold down the <Option> or
  642.         <Command> key and click in the title bar of its window)
  643.     •    “Go to” accepts a file name followed by line number, or file name
  644.     followed by marker name, or any one of file name, line number, or
  645.     marker name. Useful for:
  646.         •    putting fixed links in your documents with file name followed by
  647.             line number (such as /* See App_Main.c 389 */ )
  648.         •    maintained links, consisting of file name followed by marker name
  649.             (such as /* See «MyApp Design Notes» «2.3 Custom Resources» */
  650.             To generate the text for a link of the form «file name» «marker
  651.             name», hold down the<Shift> and  either <Option> or <Command> keys
  652.             while clicking in the title bar of the window that has the mark; when
  653.             you select the mark from the resulting popup marker menu, the text
  654.             will be copied to your clipboard. Both file and marker name may be
  655.             abbreviated or slightly incorrect, eg
  656.             /* See «Design N» «Custom Rez» */
  657.         •    jumping to locations as reported in the “Show Activities” display
  658.         •    jumping to locations generated by hAWK programs
  659.             ($CompareFiles, $MFS_SuperLister, and many others)
  660.             and also locations generated by several of the "Index" commands,
  661.             such as "Cross-Reference..."
  662.     •    “Go Back” lets you toggle between two locations, in one or two files
  663.     •    jumping to a definition (<Option> double-click) works with toolbox
  664.         headers, first-draft code, and your own notes, almost always going
  665.         straight to the definition with no stumbling over a mention in a
  666.         comment, or a prototype. This allows you to use defined term names in
  667.         source or documentation as true “hyperlinks”.
  668.  
  669. >    The best little language in the world
  670.     •    “hAWK” is a project-oriented version of “AWK”. AWK has long been
  671.         the C programmer’s little language of choice, and hAWK, with its
  672.         simple “three clicks and run” interface, is as easy to invoke as any
  673.         macro language (there's a command line too)
  674.     •    with one click, you can choose to have a program take its input from
  675.         the front text file in EnterAct, or all files selected for multi-file
  676.         operations in your EnterAct project
  677.     •    hAWK is a full programming language, modelled after C but simpler
  678.         in many ways, with many additional built-in capabilities (especially
  679.         for dealing with text)
  680.     •    use supplied hAWK programs to: generate a list of full path names
  681.         for all files in a project, list all occurrences of a word or string
  682.         or regular expression, copy or erase files, translate a C declaration
  683.         into English, list all potential local variables in a C function under
  684.         development, compare files, etc
  685.     •    and you can write your own programs to: check the contents of custom
  686.         resources or file data, prototype algorithms, and in general handle
  687.         any odd job having to do with text files that you can spell out an
  688.         algorithm for (using the fullest implementation of regular expressions
  689.         available anywhere) -- I'm working on "text to html" at the moment....
  690.     •    as of version 3, you can write "magic clipboard" programs in hAWK
  691.         that will monitor EnterAct's clipboard, and, when conditions you
  692.         specify are met, will do anything you like to the clipboard's
  693.         contents. Useful for mowing down repetitive but moderately
  694.         complicated tasks (eg changing old-style C function declarations
  695.         to the new prototype style, changing /**/ comments to //). Once
  696.         your hAWK program is running, all you do is Copy and Paste. Typically
  697.         these programs flash the menu bar to indicate that the clipboard
  698.         has been altered.
  699.  
  700. >    Using EnterAct as THINK’s editor
  701.     •    EnterAct works fine by itself, but if you have version 6 or
  702.     later of THINK C and sufficient memory you can use EnterAct as
  703.     a replacement for THINK’s own editor (this is the “use external
  704.     editor” option described in your THINK manual).
  705.     •    using EnterAct as THINK’s editor eliminates the need to
  706.     “Make” your THINK project when bringing it up to date, since
  707.     THINK C will automatically be made aware whenever you change
  708.     a source file with EnterAct—and all of EnterAct’s best features,
  709.     such as info display and hyperlinking, will be available within
  710.     THINK C. For the details, see Appendix 4.
  711.  
  712. >    Using EnterAct as CodeWarrior's editor
  713.     •    Drop EnterAct into your main CodeWarrior folder. Things aren't
  714.     as automatic with CodeWarrior, so you'll have to start up your
  715.     CodeWarrior and EnterAct projects separately.
  716.     •    EnterAct sends "touch" events to any open CodeWarrior project,
  717.         so CodeWarrior will be able to keep track of which files need
  718.         recompiling.
  719.  
  720. >    Using EnterAct as a "definition viewer" with other editors:
  721.     •    Have EnterAct with an appropriate project running while
  722.     you use the other editor. Your dictionary should be reasonable
  723.     up to date, and the AutoLook window open
  724.     •    Copy a term in the other editor, and switch to EnterAct
  725.     for instant definition display in the "AutoLook" window
  726.     •    If you don't see an instant definition, try
  727.     <Command><Enter> for spell-tolerant lookup of the clip
  728.     to a separate lookup window
  729.     •    To look up the struct or class containing a copied member
  730.     name, press <Shift><Command><Enter>
  731.     (When looking things up with the <Enter> key, <Command> is
  732.     for Clipboard, and <Shift> is for member lookup -- also called
  733.     "reverse" lookup, so remember "<Shift> into reverse"....)
  734.     
  735. >    Miscellaneous
  736.     •    EnterAct’s “Print” command can print illustrated documents, and
  737.         always folds back long lines rather than clipping them off
  738.     •    “Reformat Selection” lets you clean up plain text documentation,
  739.         including long comments. It was used to maintain this document
  740.     •    “Save As” can be used with projects, so you don’t have to start over
  741.         each time
  742.     •    “Index” commands under the EnterAct menu: function call/called by
  743.     lists, cross-referencing, lists of markers or #included files, and
  744.     “Potential Locals”, which helps ease the declaration of local variables
  745.  
  746. §    Looking ahead
  747. It would be best at first to focus on building EnterAct projects and
  748. exploiting the various ways of looking up definitions and navigating
  749. around. For the necessary background, read straight ahead here to the
  750. end of the “Browsing” chapter. The one vital new skill to master is
  751. that of pushing the <Enter> key to view definitions, although the
  752. "AutoLook" window will almost always beat you to it.
  753.  
  754. After the “Browsing” chapter, topics become relatively independent.
  755. “Switching to other applications” is recommended reading, since as
  756. mentioned above EnterAct will save documents when you switch out and
  757. refresh them from disk when you switch back, and you should either
  758. agree with this approach or turn this option off. And before starting
  759. in on the “hAWK User’s Manual” on disk, it will help to be familiar
  760. with EnterAct’s approach to multi-file searching, as explained in the
  761. “Searching” chapter. For some fun, check out "§    Code templates" below.
  762.  
  763. For help with any difficulties that might pop up, see the “If there’s
  764. a problem” chapter towards the end of this manual.
  765.  
  766. -    -    -    -    -    -    -    -    -    -    -    -
  767. Getting started
  768. -    -    -    -    -    -    -    -    -    -    -    -
  769. (§)    Installation
  770.  
  771.  
  772.  
  773.  
  774.  
  775.  
  776.  
  777.  
  778.  
  779.  
  780.  
  781.  
  782.  
  783.  
  784.  
  785.  
  786.  
  787.  
  788.  
  789.  
  790.  
  791.  
  792. You’ll find complete instructions for placing the bits and
  793. pieces that make up EnterAct on disk 1 in the file “Installing
  794. EnterAct 3/tt” (which starts up TeachText if
  795. you double-click it). As a minimum you should place EnterAct itself
  796. in the same folder as your favorite compiler, at the same level.
  797.  
  798. Ideally you should drag all the files and folders in the left column
  799. of the "EnterAct Stuff" folder into the same folder as your compiler:
  800. So wherever you put EnterAct, also put:
  801.     • Drag_on Modules
  802.     • EnterAct Code Templates
  803.     • Minimal App7
  804.     • (EnterAct Scripts)
  805.  
  806.  
  807. If you have multiple sets of system headers for one environment,
  808. place EnterAct etc low enough in the folders that when it looks "down"
  809. from there it will see your preferred <headers> folder.
  810.  
  811. EnterAct will look within its containing folder for system headers when
  812. you pick the "Add Mac Headers", and distinguishes between system and
  813. user files in its Find dialog based on whether the file is within
  814. the same folder that holds EnterAct or is outside it.
  815.  
  816. To use EnterAct as THINK’s editor (version 6/7/8), please see Appendix 4.
  817.  
  818. (§)    What to do first
  819. If you don’t feel comfortable using your Macintosh yet, please take
  820. an hour or so to play with some other program before continuing.
  821.  
  822. The Whirlwind tour will introduce you to the most important things.
  823. After a bit of pushing the <Enter> key and and playing with your new
  824. memory, you’re ready to start using EnterAct seriously—but it wouldn’t
  825. hurt to read the rest of the manual. 
  826.  
  827.  
  828. (§)    Please read these
  829. If you’re a multi–platform developer, please read the section on
  830. “All–or–nothing macro’s” in the “Source code restrictions” chapter.
  831.  
  832. And you should know that EnterAct's default behaviour is to save all
  833. open documents when you switch out, as discussed in “Switching to
  834. other applications”, chapter 20. To avoid this, deselect the
  835. "Safe switching" option at the top of EnterAct's "Options..." dialog.
  836.  
  837.  
  838. (§)    hAWK and Read Resource
  839. After becoming acquainted with EnterAct, add the “hAWK User’s Manual”
  840. and “Read Resource Manual” to an EnterAct project, open them up, and
  841. read along. Learning “Read Resource” takes 5 minutes. Learning to run
  842. a few hAWK programs takes an hour or so,  learning to write them isn’t
  843. that tough—and it’s fun! Adapting your application to call hAWK will
  844. take a day or two. Changing hAWK is harder, but all the source is there.
  845. "hAWK" is a Mac interpreter for "AWK", which resembles C (though
  846. lacking C's more complicated features) with many built-in functions
  847. that let you dash off small programs to do nifty text manipulation.
  848.  
  849. -    -    -    -    -    -    -    -    -    -    -    -
  850. Definitions and conventions
  851. -    -    -    -    -    -    -    -    -    -    -    -
  852. (Note menu commands may appear in quotes here but often are
  853. just capitalized. They are sometimes used as verbs, as in
  854. “when you Balance a comment...”.)
  855.  
  856. Balance: checks all paired delimiters, and detects nested or
  857. improperly–formed comments. If you have an insertion point at the very
  858. beginning of the file, Balance will check the entire file. If there’s
  859. an imbalance, you’ll see where it is.
  860.  
  861. Definition or Entry: for functions and methods, the prototype or
  862. equivalent. For everything else (struct, #define, variable, etc), the
  863. full statement in which the term was mentioned or defined.
  864.  
  865. Dictionary: the collection of terms and definitions for your project.
  866.  
  867. Drag_on Module: a “mini application” packaged as a separate CODE
  868. resource, called as a C function. For instructions and code to call
  869. Drag_on Modules from your application, see the “code to call Drag_ons”
  870. folder on disk 2, and also the example Drag_on caller “Minimal App7”.
  871. While Drag_on Modules require some application to act as a “shell”,
  872. support for all callback functions by the calling application is
  873. optional. Two modules are included: hAWK, a Mac version of AWK (see
  874. “hAWK User’s Manual”) and Read Resource (see “Read Resource Manual”).
  875. If you follow the “Getting started” instructions, both modules will
  876. appear at the bottom of EnterAct’s “EnterAct” menu.
  877.  
  878. Find Definition: given a selected dictionary term, opens the file where
  879. the term is defined and scrolls to the first instance of the term in
  880. the file. The equivalent of <Option>double–click, but in addition works
  881. with full method names, which contain colons.
  882.  
  883. “Go to” link, “Go to” selection: text typically of the form
  884.     file-name marker-name 
  885. where “file-name” is the name of an EnterAct project file and
  886. “marker-name” is the name of a marker in the file, with optional
  887. European-style quotes around either part
  888.     (for example, «MyProj.LOG» «To Do» ).
  889. To open the file and go to the marked position, select the
  890. file-name marker-name text and use the Go to command. Details are in
  891. “‘Go’ commands”, chapter 17.
  892.  
  893. Insertion point: the flashing “|” cursor which marks your place in a
  894. text window when no characters are selected. 
  895.  
  896. Look up a term: to look up a term, select an insertion point just to
  897. the right of it, or double-click on it, and press <Enter>. A lookup
  898. window will appear. The AutoLook window shows definitions automatically
  899. as you type or edit (double-click on the term or click to the right
  900. of it, or type it in).
  901.  
  902. Lookup window: a special kind of text window used to show dictionary
  903. entries. The title begins with “••” or “¶¶”. Often several entries are
  904. “stacked” in one lookup window; to cycle through them, press <Enter>
  905. with a range of characters selected -- or better, hold down the
  906. <Option> key and drag in the window's title bar to pick from a
  907. popup menu.
  908.  
  909. Menu commands are often quoted, always capitalized.
  910.  
  911. Paired delimiters:
  912.     • ()         round brackets, or parentheses
  913.     • []         square brackets
  914.     • {}         braces, or curly braces
  915.     • /* */     comment start and end, together a comment
  916.     • " "         double quotes, around strings (continued across lines with “\”)
  917.     • ' '         single quotes, or ticks.
  918.  
  919. Paste Selection Behind: will Copy the selection in the front window,
  920. switch to the next window, and Paste over what is selected there. The
  921. selection in the next–to–front window will be shown by a two–pixel wide
  922. black border.
  923.  
  924. Project: a three–pane window containing any group of source, header,
  925. plain text, and PICT documents. Selecting Update Dictionary builds a
  926. dictionary for all source and header files. Both the file list and the
  927. dictionary are kept on disk in the corresponding project file.
  928. Double–clicking on a file shown in the project window will both open
  929. the file and send the project window behind all other windows. It can
  930. be brought to the front again with the Windows menu, or
  931. <Command><zero>, if it’s hidden.
  932.  
  933. Range of characters selected: white text on a black background in the
  934. front window, seen for example when you drag over some text. In the
  935. next–to–front window, the selection range is shown outlined in a black
  936. box rather than white on black (the next– to–front window is affected
  937. by Paste Selection Behind, and by some Search commands when the Find
  938. dialog is in front).
  939.  
  940. Recent activity: a full specification of something you’ve done recently
  941. with EnterAct, as presented in the “••Recent Activities” window
  942. generated by the Show Activities command. All significant activities
  943. are recorded, including cut copy paste typing find replace new open
  944. close revert start quit. Recorded details include time, location, and
  945. contents if it was an insert or delete. For details see the “Show
  946. Activities” chapter.
  947.  
  948. Reformat Selection: evens out the line lengths in a range of selected
  949. text, with maximum line length and ragged right versus full
  950. justification as specified in the Options dialog. Intended for use with
  951. comments or plain text, rather than code.
  952.  
  953. Regular lookup: double-click on or click after a term, and press
  954. <Enter>. A lookup window appears, holding all definitions of the term,
  955. or closest matches based on spelling if your spelling was off.
  956. <Option>click in the title bar for a list of definitions.
  957.  
  958. Reverse lookup: select as for regular lookup, but press <Shift><Enter>.
  959. The resulting lookup window holds all struct, union, and class
  960. definitions which mention the word(s) being looked up. <Option>click
  961. in the window's title bar for a list of containing definitions.
  962.  
  963. Sounds-like lookup: select as for regular lookup, but press
  964. <Option><Enter>. Like regular lookup, but not case-sensitive, with
  965. closest matches based on sound rather than spelling. <Option>click in
  966. the resulting lookup window’s title bar for a list of definitions.
  967.  
  968. Specific single keys are placed in <>, eg <Enter>, <Option>, <Return>,
  969. <period>.
  970.  
  971. -    -    -    -    -    -    -    -    -    -    -    -
  972. Whirlwind tour
  973. -    -    -    -    -    -    -    -    -    -    -    -
  974.  
  975. (§)    Hum along
  976. This little tour displays EnterAct’s basic capabilities, to help you
  977. avoid that “lost in space” feeling. However, there is much of potential
  978. interest that is not covered here, so please at least browse through
  979. the rest of the manual afterwards.
  980.  
  981. For an example project we’ll be using “Minimal App7”, the files for
  982. which are included with EnterAct. If you feel adventurous,
  983. substitute your own project for Minimal App below.
  984.  
  985. To exactly follow the tour, you’ll need the files that make up “Minimal
  986. App7”, a minimal application that does nothing but call Drag_on
  987. Modules. The “Minimal App7 ƒ” folder contains the needed
  988. files. If you haven't moved it, it's still in your "EnterAct stuff"
  989. folder.
  990.  
  991.  
  992. (§)    Create a project
  993. We’ll be working with the files that make up “Minimal App7”, and the
  994. first step will be to create a project for it. The project will list
  995. source, header, and documentation files, and also hold a dictionary
  996. of all terms of interest.
  997.  
  998. Double–click on the EnterAct icon to start. You will see a dialog
  999. asking if you want to open an existing project—cancel it. Another
  1000. dialog will appear, asking you to supply a name for a new project. Type
  1001. in a name (such as “MinimApp7.e”), open the “Minimal App7 ƒ” folder,
  1002. and click the Save button. A three–pane project window will appear.
  1003. If you're already up and running (a good bet), pick "New Project"
  1004. from the EnterAct menu and name away.
  1005.  
  1006.  
  1007. (§)    Add some files
  1008. You can add files to your project one at a time with the Add Files
  1009. command—but try the Add All In Folder command instead: it works much
  1010. the same as the Add Files command, but also allows you to select and
  1011. add entire folders at once. However, files contained in subfolders are
  1012. not added automatically -to do that, hold down the <Shift> key and
  1013. pick the same menu item (now called "Add All in Subfolders...").
  1014.  
  1015. For our Minimal App project, select Add All In Folder, open the
  1016. “Minimal App7 ƒ” folder, and double-click on either of the two files
  1017. listed there (for example, “Call_Resource.c”). You will see both
  1018. “Call_Resource.c” and “minimalApp7.c” appear in your project window,
  1019. in the left (source or “.c”) pane.
  1020.  
  1021. There is no need to ever select one of the three window panes when
  1022. adding files. The left pane is for your source files (.c), the middle
  1023. for all header files (.h), and the right pane is for all other text
  1024. files (and PICT’s). EnterAct selects the correct pane for each file
  1025. automatically.
  1026.  
  1027.  For our project we’ll also want the toolbox headers and MW or THINK C
  1028.  headers. To add these to your project, hold down the <Shift> key and
  1029.  select Add Mac Headers. All of the standard toolbox headers, and,
  1030.  because of the <Shift> key, all THINK C headers, will be added to the
  1031.  middle (header, or “.h”) pane of your project. If you don't have the
  1032.  THINK C headers, omit the <Shift> key (or ignore any error message).
  1033. At this stage, your project should look like this:
  1034.  
  1035.  
  1036.  
  1037.  
  1038.  
  1039.  
  1040.  
  1041.  
  1042.  
  1043.  
  1044.  
  1045.  
  1046. ____
  1047.             source pane                    header pane                documentation pane
  1048. ____
  1049.  
  1050. Use Add Front File to add this manual to your project, and you'll see
  1051. it appear in the rightmost (documentation) pane.
  1052.  
  1053. For illustration purposes the project window has been kept small, but
  1054. feel free to make it as large as you like. The project window will go
  1055. to the back when you double-click on a file name to open a file, and
  1056. it can be brought to the front from the Windows menu if it’s hidden.
  1057.  
  1058.  
  1059. (§)    Build a dictionary
  1060. (".c" and ".h" are used as shorthand for source and header below)
  1061. Your dictionary will contain all terms in your .c and .h files that
  1062. are defined or mentioned outside of a function, struct, or union body.
  1063. To build, it, select Update Dictionary from the Project menu, and sit
  1064. back for a few seconds—this shouldn’t take long, typically under 1/2
  1065. second per file on a Mac II. If a major problem or bug does interrupt the
  1066. dictionary build, you’ll see a message telling you what’s up. You can
  1067. either fix it and reselect Update Dictionary, or, with the
  1068. offending file selected in the project window, select Remove File
  1069. followed by Update Dictionary to go on with this tour immediately.
  1070. (See DON'T GIVE UP near line 110 above for fixes to common problems.)
  1071.  
  1072. If you are pursuing your own project instead of Minimal App7, you may
  1073. run out of memory when building your dictionary. If this happens,
  1074. either increase the amount of memory allocated to EnterAct by one Meg
  1075. and try again, or see “EnterAct Memory Needs” on disk 1 for a detailed
  1076. guide to estimating memory needs. Two megabytes can handle a small
  1077. project, but a real whopper may need seven or more.
  1078.  
  1079. (§)    Viewing definitions and prototypes
  1080. If you’re following along with the Minimal App example, open
  1081. “minimalApp7.c” by double-clicking on its name in the left pane of your
  1082. project window. To arrive at the right position for our example, select
  1083. Find from the Search menu, type in waitnextevent(  and then type
  1084. <Return> or click the OK button until you see the following:
  1085.  
  1086.  
  1087.  
  1088.  
  1089.  
  1090.  
  1091.  
  1092.  
  1093.  
  1094.  
  1095.  
  1096. Now is a good time to activate the AutoLook window: first free up some
  1097. room on your screen (a couple of inches at the bottom will do) and
  1098. then select AutoLook from the “EnterAct” menu. It explains itself. For
  1099. a quick look at a definition, either click just after a term or
  1100. double-click on it: the definition will appear instantly in the
  1101. AutoLook window.
  1102.  
  1103. As an AutoLook example, return to the “minimalApp7.c” window and
  1104. double-click on gEvtDetails, on the same line as WaitNextEvent(:
  1105.  
  1106.  
  1107.  
  1108.  
  1109.  
  1110.  
  1111.  
  1112.  
  1113.  
  1114.  
  1115.  
  1116.  
  1117.  
  1118.  
  1119.  
  1120.  
  1121.  
  1122.  
  1123.  
  1124.  
  1125.  
  1126. You will see a definition of gEvtDetails appear immediately in the
  1127. AutoLook window. And, you also see a complete definition of
  1128. EventDetails. 
  1129.  
  1130. As you can see, the AutoLook window resolves variable, struct, and
  1131. typedef tangles to show you all the relevant definitions. It also
  1132. resolves #define’d “aliases” such as “#define H Handle”. For functions,
  1133. you’ll see a prototype, with function name and parameters preselected
  1134. so you can quickly paste a “template” for the function call into your
  1135. code (by switching to the AutoLook window and selecting the command
  1136. Paste Selection Behind). Basically, if the name is defined outside of
  1137. a function body, the AutoLook window will show you the essentials you
  1138. need to  use it. The only requirements are that a file containing a
  1139. definition (or prototype) for the name should be in your project, and
  1140. your dictonary should be up to date for that file.
  1141.  
  1142. As of version 3, EnterAct's AutoLook window will also display
  1143. definitions of local variables, and provide more useful lookup for
  1144. struct and class member names when you double-click on them or
  1145. click after them. For this to work, your file should be a source
  1146. (left pane) or header file, though not necessarily added to your project,
  1147. and you should have your dictonary reasonably up-to-date
  1148.  
  1149. By itself, the AutoLook window can supply most of the details you need
  1150. to program or review nonstop. However, the display in this window is
  1151. transient, keeping up with you as you click or double-click about, or
  1152. type for that matter. To produce a more permanent display of a
  1153. definition or prototype, more work is required on your part: you have
  1154. to press the <Enter> key. To see it work, double-click on EventDetails
  1155. in the AutoLook window, and then press the <Enter> key:
  1156.  
  1157.  
  1158.  
  1159.  
  1160.  
  1161.  
  1162.  
  1163.  
  1164.  
  1165.  
  1166.  
  1167.  
  1168.  
  1169.  
  1170.  
  1171.  
  1172.  
  1173.  
  1174.  
  1175.  
  1176.  
  1177.  
  1178.  
  1179.  
  1180.  
  1181.  
  1182.  
  1183.  
  1184.  
  1185.  
  1186. Your screen may not look exactly like that, but you should see the
  1187. definition of EventDetails appear in a separate window, called a
  1188. “lookup” window.
  1189.  
  1190. A press of the <Enter> key produces a separate window containing the
  1191. information you’re after, definition or prototype.  As you’ll see
  1192. shortly, these separate “lookup” windows can take care of themselves.
  1193. And the “press <Enter>” style of lookup also works when your spelling
  1194. of a term is off, but still “distinctively close”.
  1195.  
  1196. In general, you can look up any function, method, struct class union
  1197. or enum tag, enum constant, typedef, or variable (including low–memory
  1198. and statics) that is defined or mentioned anywhere in your .c or .h
  1199. project files outside of a function, struct, or union body—and any
  1200. #define’d constant or macro that is defined outside of a function body.
  1201. In other words, just about everything of interest except local
  1202. variables or any other “thing” which is meant to be used only within
  1203. a single specific function. Note the AutoLook window does show local
  1204. variables and data members.
  1205.  
  1206. As you’ve seen, the fastest and easiest way to look up a definition
  1207. for a term is to double-click on it with the AutoLook window on-screen.
  1208. You can also click just after the term, or type it, and the AutoLook
  1209. window will keep up. It will also often show class member and
  1210. inline method definitions, after a slight delay.
  1211.  
  1212. However, the AutoLook window has three shortcomings:
  1213.     •    the display lasts only until you look up some other term
  1214.     •    your spelling of the term must be correct
  1215.     •    the display in the AutoLook window doesn’t update as you click about
  1216.         or edit in the AutoLook window itself.
  1217.  
  1218. To overcome these shortcomings, the “press <Enter>” style of lookup
  1219. produces a separate window holding one or more definitions of the term
  1220. being looked up. To look up a term in this way:
  1221.     •    double-click on it, or click just to the right of it, or type it in
  1222.     •    and press the <Enter> key.
  1223.  
  1224. A dictionary entry for the term will appear in a new small text window,
  1225. called a “lookup” window. Lookup windows are mostly like text windows,
  1226. the key differences being that they cannot be directly saved (Copy and
  1227. Paste to a real text window to do that), and they usually can show you
  1228. other dictionary entries. Only one is shown at a time. If your spelling
  1229. is off, the window will show best guesses rather than exact matches.
  1230. (To view other entries, <Option>click in the title bar.)
  1231.  
  1232.  
  1233. (§)    Lookup window frames
  1234. In the small display box along the bottom of the lookup window you will
  1235. see: the name of the file from which the entry was taken; the kind of
  1236. term it is (a one–letter abbreviation, for example “v” for variable,
  1237. “(” for a function, “s” for a struct); and two numbers—the current
  1238. entry you are viewing, followed by the total number of entries
  1239. currently stored in the lookup window. 
  1240.  
  1241. The title of the lookup window will be the term you wanted looked up,
  1242. preceded by two bullets, eg “••EventDetails”. The two bullets are a
  1243. sign that the window is a (temporary) lookup window, not a regular
  1244. document window.
  1245.  
  1246.  
  1247.  
  1248.  
  1249.  
  1250.  
  1251.  
  1252.  
  1253.  
  1254.  
  1255. (§)    Viewing other entries in a lookup window
  1256. A lookup window may hold additional definitions if:
  1257.     •    there are variant definitions of the same term, such as defining
  1258.         and declaring instances of a global variable, or prototype and defining
  1259.         instance of a function
  1260.     •    the same term is used in different ways, such as a struct and a
  1261.         typedef with the same name
  1262.     •    your spelling of the term was incorrect: in this case, closest
  1263.         matches will be shown, and the number shown is under your control.
  1264.  
  1265. Numbers in the display box of the lookup window indicate which entry
  1266. you’re viewing, followed by the number of entries available: if the
  1267. numbers read “1/1”, then only one is present; whereas if the second
  1268. number is greater than one (from “1/2” up to “1/60”) then more entries
  1269. are “stacked up” in the window.
  1270.  
  1271. To view a different entry, hold down the <Option> key and
  1272. click-and-drag in the window’s title bar to select from a popup menu.
  1273. To produce a sample, type KeyDetails in any text window and press
  1274. <Enter> to produce a regular lookup window; this term doesn’t match
  1275. anything in the project, so closest matches are shown. From the
  1276. designation “1/4” in the display box, you can tell that four entries
  1277. are contained in the lookup window. To access them, hold down the
  1278. <Option> key, click in the title bar of the “••KeyDetails” lookup
  1279. window, and select from the resulting popup menu:
  1280.  
  1281.  
  1282.  
  1283.  
  1284.  
  1285.  
  1286.  
  1287.  
  1288.  
  1289.  
  1290.  
  1291.  
  1292.  
  1293.  
  1294.  
  1295.  
  1296.  
  1297. You can use <Command> instead of <Option> to view popups if you prefer.
  1298. (Truncated full path names are also shown in the popup menu,
  1299. to help you pick the exact definition you want.)
  1300.  
  1301. Each entry in the popup begins with a one-character “hint” describing
  1302. the definition type, eg “t” for typedef, “v” for variable, “(” for
  1303. function. For a complete list, see “Hints with lookup” in the “Lookup”
  1304. chapter.
  1305.  
  1306. You can also cycle forwards through the entries in a popup window by
  1307. repeatedly pressing the <Enter> key. Press <Option><Enter> to cycle
  1308. backwards. Normally <Option>-clicking in the title bar is handier because
  1309. it gives you an overview of all the entries.
  1310.  
  1311.  
  1312. (§)    The <Enter> key
  1313. In any text window including lookup windows, pressing the <Enter> key
  1314. with an insertion point means “look it up”. The I–beam should be just
  1315. to the right of the term you want looked up. Pressing the <Enter> key
  1316. when characters are selected also activates regular lookup in a
  1317. non-lookup window, and in a lookup window the result of pressing
  1318. <Enter> is either regular lookup or cycling to the next match. In a
  1319. lookup window, if the selection agrees with the name of the term being
  1320. displayed or if your selection is so large that lookup cannot be done,
  1321. then <Enter> will cycle you to the next entry; conversely, if your
  1322. selection is not the name of the definition being shown and your
  1323. selection could be looked up (one word, or two words separated by
  1324. colons) then <Enter> will look up your selection.
  1325.  
  1326. Note that pressing the <Enter> key for separate lookup is meant
  1327. for use with names that are in your dictionary, and in particular
  1328. local variables are not included. To look up the struct or class
  1329. that contains a particular member, press <Shift><Enter> as
  1330. described below.
  1331.  
  1332. Whenever you display a new definition in a lookup window, a selection
  1333. in the window is made for you. Among other things, this selection
  1334. guarantees that if you press <Enter> or <Option><Enter> you will cycle
  1335. back and forth through the definitions, rather than looking something
  1336. up.
  1337.  
  1338. Basically, you don't have to remember anything here since it all comes
  1339. down to intention: if you intend to look up a name, selecting it and
  1340. pressing <Enter> will do just that. If you intend to cycle to the next
  1341. match, pressing <Enter> will do that instead. In the rare case that
  1342. you change the default selection in the window and then wish to cycle,
  1343. either pick from the popup menu or do a Select All before pressing
  1344. <Enter>.
  1345.  
  1346.  
  1347. (§)    Looking up something in a lookup window
  1348. Click to get an insertion point just to the right of the name you want
  1349. looked up, and press <Enter>. With any name except the name of the
  1350. definition currently being shown in the lookup window, you can also
  1351. double-click on the name and press <Enter>.
  1352.  
  1353.  
  1354. (§)    Keeping the lookup around
  1355. You can adjust the maximum number of lookup windows you wish to have
  1356. on–screen at one time, with the Options command: when this limit is
  1357. reached and you press <Enter> to see another lookup, one of the lookup
  1358. windows that is currently on–screen will quietly go away to make room
  1359. for the new one. To prevent this happening to a lookup window that
  1360. you’d like to keep around, select Keep Lookup Around from the windows
  1361. menu while the lookup window is in front. It will then stay on–screen
  1362. until you close it, or until you close the project. When you “keep
  1363. around” a lookup window, the two bullets “••” at the start of the
  1364. window title will change to “¶¶” to help you distinguish the keepers
  1365. from the ones that might go away later.
  1366.  
  1367.  
  1368.  
  1369.  
  1370.  
  1371.  
  1372.  
  1373.  
  1374.  
  1375.  
  1376.  
  1377. (§)    If your spelling is off
  1378. If you press <Enter> for lookup and your spelling did not match any
  1379. term in your dictionary exactly, then you’ll see whatever entries come
  1380. closest, with suppression of variants on the same name in order to
  1381. maximize the variety shown. The entries will be presented in order from
  1382. best match to worst as you press <Enter>. EnterAct is very nearly as
  1383. good at judging what’s close as you are, even though it doesn’t
  1384. “understand” the terms being looked up. This perhaps surprising ability
  1385. results from the natural tendency to give distinctly different names
  1386. to terms with distinctly different meanings. You’ll find more about
  1387. this in the “Lookup” chapter, but EnterAct’s lookup power is sufficient
  1388. that one guideline is all you need: when you’re not sure of the correct
  1389. spelling, type your best guess, remembering that C is case–sensitive.
  1390. EnterAct will almost always retrieve what you want on the first try,
  1391. among the first three entries in the lookup window.
  1392.  
  1393. For an example with Minimal App, open up a new window, type
  1394. “KeyDetails” as a guess for “EventDetails”, and press the <Enter> key:
  1395.  
  1396.  
  1397.  
  1398.  
  1399.  
  1400.  
  1401.  
  1402.  
  1403.  
  1404.  
  1405. Now press the <Enter> key twice more (or use the popup):
  1406.  
  1407.  
  1408.  
  1409.  
  1410.  
  1411.  
  1412.  
  1413.  
  1414.  
  1415.  
  1416.  
  1417.  
  1418.  
  1419.  
  1420.  
  1421.  
  1422.  
  1423.  
  1424.  
  1425.  
  1426.  
  1427.  
  1428.  
  1429.  
  1430.  
  1431.  
  1432.  
  1433. (§)    Adjusting the number of lookup windows and entries shown
  1434. EnterAct comes preset with a maximum of four lookup windows on–screen
  1435. at one time, and a maximum of four entries per lookup window. You can
  1436. change these limits at any time by selecting the Options command under
  1437. the Edit menu. For complex problems, you may want more lookup windows.
  1438. If your recollection of the spelling of a term has gone out the window,
  1439. you may want to temporarily increase the number of alternate entries
  1440. returned per lookup window. You can vary the number of lookup windows
  1441. from 1 to 10, and the number of entries per window from 1 to 20.
  1442.  
  1443.  
  1444.  
  1445.  
  1446.  
  1447.  
  1448.  
  1449.  
  1450.  
  1451.  
  1452.  
  1453.  
  1454.  
  1455.  
  1456.  
  1457.  
  1458.  
  1459.  
  1460.  
  1461.  
  1462.  
  1463. (§)    Working with lookup windows
  1464. You’ll probably find that the AutoLook window by itself can handle more
  1465. than half of your information retrieval needs. And often you’ll want
  1466. to have more permanent separate lookup windows showing data structures
  1467. that you’re working with for more than a moment, and transient lookup
  1468. windows to supplement the AutoLook display. Separate lookup windows
  1469. are generated by double-clicking on or clicking after a name and
  1470. pressing the <Enter> key, and made permanent by selecting Keep Lookup
  1471. Around (the key equivalent <Command><K> is a good one to memorize).
  1472.  
  1473. To help you manage lookup windows EnterAct places, sizes, scrolls, and
  1474. makes selections in them for you, and also closes old lookup windows
  1475. to make room for new ones. But the lookup windows have to go somewhere
  1476. on your screen(s), and you’ll find the lookup process goes more
  1477. smoothly if you leave some screen area free for the lookup windows to
  1478. occupy. How much room you leave for lookup windows is best judged by
  1479. experience, and will vary according to the needs of the moment. Some
  1480. things to keep in mind:
  1481.     •    lookup windows ignore the project window when looking for a place
  1482.         to appear
  1483.     •    lookup windows prefer to occupy a small place rather than cover one
  1484.         of your working windows
  1485.     •    if some window has to be covered by a lookup window, the lookup
  1486.         window will try to avoid your front two windows
  1487.     •    lookup windows will try to appear right next to your front window,
  1488.         preferably below or above it.
  1489.  
  1490. (§)    Reverse lookup (<Shift><Enter>)
  1491. On occasion you may find yourself viewing a member name and wondering
  1492. what struct, union, or typedef contains it. Quite often, the AutoLook window
  1493. will immediately display the definition you want. If not, double-click
  1494. on or click after the member name and press <Shift><Enter> to invoke
  1495. EnterAct's "reverse lookup".
  1496.  
  1497. Here’s the result of double-clicking on ParamBlockHeader and pressing
  1498. <Shift><Enter>:
  1499.  
  1500.  
  1501.  
  1502.  
  1503.  
  1504.  
  1505.  
  1506.  
  1507.  
  1508.  
  1509.  
  1510.  
  1511.  
  1512.  
  1513.  
  1514.  
  1515.  
  1516.  
  1517.  
  1518.  
  1519. (Note pressing just <Enter> would have produced the definition
  1520. of ParamBlockHeader, not a list of structs or classes that
  1521. contain it)
  1522.  
  1523. As with all lookup windows, you can access the other definitions
  1524. stacked up in it by holding down the <Option> key and clicking in the
  1525. title bar to choose from a popup menu. 
  1526.  
  1527. Reverse lookup is not case-sensitive. Although it is called “struct
  1528. for member”  lookup elsewhere, it is actually slightly more, since it
  1529. attempts to match your selection with something in a struct, union,
  1530. or typedef without regard for whether it is a member name. Reverse
  1531. lookup accepts arbitrary strings of text up to 255 characters (for this
  1532. you’ll have to select the text to be looked up and then press
  1533. <Shift><Enter>) and will match it against anything in a definition,
  1534. even inside a comment. Aside from being case-insensitive, reverse
  1535. lookup requires exact spelling—but your selection can be just part of
  1536. a word, or several words with punctuation included.
  1537.  
  1538. The AutoLook window will usually show struct-for-member
  1539. lookup for a term. If you're inside a function in a source file then
  1540. AutoLook will be on average more accurate at providing the correct
  1541. definition. In any case, only the first containing struct or class will be
  1542. shown. This lets you see prototypes for inline method definitions that are
  1543. entirely contained in a class definition, and "fDataMembers", as
  1544. well as regular struct definitions for some member.
  1545.  
  1546.  
  1547. (§)     “Sounds like” (phonetic) lookup
  1548. The situation: “I’m desperate, show me a definition even if it’s wrong,
  1549. all I can tell you is the name sounded something like this:”. The
  1550. answer: type your guess and press <Option><Enter>. Your guess will be
  1551. boiled down to a string of standard consonants, then compared with
  1552. boiled-down versions of all your dictionary terms, and you’ll be shown
  1553. the best matches. <Option><Enter> is not case-sensitive (it's only
  1554. barely vowel-sensitive), and should be kept in mind as an
  1555. emergency backup, for those rare occasions when regular lookup gives
  1556. up on you.
  1557.  
  1558. (§)    Seeing where a term is defined
  1559. To jump to the definition of a term, select the entire term, and choose
  1560. Find Definition. This will open the file where the term is defined,
  1561. and will usually show you the defining instance of the term.
  1562. <Option>double–clicking on a term does the same thing with single-word
  1563. terms, but doesn’t work with full method names, which consist of two
  1564. words separated by colons. For those, you will need to use Find
  1565. Definition. For more on this, see the “Browsing” chapter.
  1566.  
  1567. As a Minimal App example, open a new window if you haven’t done so,
  1568. type gacc , and <Option> double-click on it:
  1569.  
  1570.  
  1571.  
  1572.  
  1573.  
  1574.  
  1575.  
  1576.  
  1577.  
  1578.  
  1579.  
  1580. You’re viewing the definition of the static variable gacc , which is
  1581. used for communicating with Drag_on Modules. You will also be able to
  1582. jump to the definitions of static functions, #define’s, struct, union,
  1583. enum, and class tags, enum constants, typedef’s, methods—in other
  1584. words, anything defined at the top level in your source files.
  1585.  
  1586. If you can’t jump to a definition because your spelling is wrong, just
  1587. look up the correct spelling first by clicking after the name and
  1588. pressing the <Enter> key. Then, you can <Option> double-click on the
  1589. correctly-spelled name right in the lookup window.
  1590.  
  1591. For the special case of multiple definitions of a term (eg several static
  1592. variables with the same name), you need to tell EnterAct which one you
  1593. want, and the way to do that is to do the <Option>double-click in a
  1594. lookup window that is displaying the exact definition you want. So
  1595. the sequence is:
  1596.     •    look the name up (select it, press <Enter>)
  1597.     •    use the lookup window's popup menu to find the exact definition
  1598.         you want (<Option>click in the window's title bar, and look at the
  1599.         truncated full path names shown beside each instance)
  1600.     •    after picking the one you want from the popup menu, double-click
  1601.         on the term and off you go.
  1602.  
  1603. (§)    Balance
  1604. Balance checks all of the paired delimiters in C (with the picky
  1605. exception of angle brackets <>). If you select an insertion point at
  1606. the top of a file (with <Option><up arrow>, or Go to Top), Balance will
  1607. balance your entire file. If any error in balance is detected, you’ll
  1608. be shown the mismatched or unmatched delimiter. When balancing a file,
  1609. if you hear a beep and the insertion point remains at the top of the
  1610. file, that means your whole file balanced.
  1611.  
  1612. As a shortcut, you can just double-click on a delimiter.
  1613.  
  1614. Balance also detects nested comments, and more importantly any single
  1615. failure to properly start or end a comment, something even most
  1616. compilers don’t do. Since EnterAct’s dictionary–builder checks comments
  1617. fully, simply by building the dictionary you will guarantee that no
  1618. improper comment in any of the included source files will ever generate
  1619. a wild pointer or an uninitialized variable.
  1620.  
  1621. If your source code deliberately contains nested comment starts, select
  1622. the Options command and uncheck the “Detect nested comment starts” box.
  1623.  
  1624. (§)    Searching
  1625.  
  1626.  
  1627.  
  1628.  
  1629.  
  1630.  
  1631.  
  1632.  
  1633.  
  1634.  
  1635.  
  1636.  
  1637. The Find dialog in EnterAct is modeless, which means that when the Find
  1638. dialog is in front any search command you pick will apply to the window
  1639. just behind it. An important exception is Replace All, which works only
  1640. when a text window is in front. 
  1641.  
  1642. The "Find" button in the dialog is the exact equivalent of the
  1643. "Find Again" menu command. Both can be used with the project
  1644. window itself by the way, to find file names in long lists.
  1645.  
  1646. A popup menu at the top of the Find dialog remembers the 20 most recent
  1647. strings of characters that you have searched for.
  1648.  
  1649. The little buttons in the lower–right of the Find dialog allow to to
  1650. set up a “coarse” multi–file search of your project files. As you click
  1651. them, you’ll see bullets appear beside files to be searched in your
  1652. project window. 
  1653.  
  1654. If you click the "Batch" check box, your multi-file search will be
  1655. done all at once, and the results presented in a text window
  1656. (file name, line number, and the full line where found). To go to
  1657. a particular found instance, click on the line and use "Go to...".
  1658.  
  1659. To “fine–tune” your multi–file selection, hold down the <Option> key
  1660. and click on or drag over the file names right in the project window.
  1661. Try it out now by clicking and dragging in your project window with
  1662. the <Option> key down and you’ll see that it acts as a toggle,
  1663. selecting files if they were not selected and vice versa. Your
  1664. multi-file selection can also be used with the Remove •'d Files
  1665. command, and as input to a hAWK program (which makes setting up a
  1666. program run a trivial thing).
  1667.  
  1668.  
  1669.  
  1670.  
  1671.  
  1672.  
  1673.  
  1674.  
  1675.  
  1676.  
  1677.  
  1678.  
  1679.  
  1680.  
  1681.  
  1682.  
  1683. (§)    Adding marks to a source file
  1684. Markers can be used for a variety of purposes, but in practice most
  1685. people are quite satisfied if they can mark all of the function
  1686. definitions in a source file. EnterAct’s Automark command has a
  1687. considerable range of options for marking a variety of names in your
  1688. source files, but the default options selected in the Automark dialog
  1689. are to clear all existing markers and then mark all function
  1690. definitions. You’ll probably find that this is all you ever want to
  1691. mark in a source file.
  1692.  
  1693.  
  1694.  
  1695.  
  1696.  
  1697.  
  1698.  
  1699.  
  1700.  
  1701.  
  1702.  
  1703.  
  1704.  
  1705.  
  1706. To clear all existing marks from a source file, and automatically mark
  1707. all function definitions in the file:
  1708.     •    bring the file in question to the front
  1709.     •    select the Automark command (under the Search menu), and hit
  1710.         <Return> or click the “Mark ’em” button
  1711.     •    use Save if you wish to preserve the marks.
  1712.  
  1713. Note that the file in question does not have to be in your current
  1714. project, nor do you need to have a project open at the time. And
  1715. marking and saving a document does not change the (finder) modification
  1716. date if the contents of the document are unchanged, so no spurious
  1717. updates will be done by either EnterAct or THINK C.
  1718.  
  1719. To access the popup menu listing marks for a file, hold down the
  1720. <Option> or <Command> key and click-and-drag in the title bar of the
  1721. file’s window. Just select a mark and off you go.
  1722.  
  1723. EnterAct’s markers are compatible with THINK C and MPW, indeed the
  1724. suspicion is that there is only one kind of marker in the universe.
  1725.  
  1726. Now would be a good time to try out the Automark command, preferably
  1727. on one of your own source files that has never had any marks before
  1728. (but feel free to try it on one of the two Minimal App source files).
  1729. The key-equivalent for Automark, <Command><2>, is worth memorizing.
  1730. Marking a file usually takes less than half a second. If you mark the
  1731. functions in your source files, AutoLook will be able to look up local
  1732. variables and also provide the right struct or class definition
  1733. corresponding to a member more often.
  1734.  
  1735. Markers can also be added “manually’” to a document, most commonly to
  1736. mark section or chapter headings in your documentation. For an example,
  1737. see the online version of this manual, or the “hAWK User’s Manual”
  1738. supplied on disk 2. For the details on markers, please see the “Markers
  1739. and Automark” section of the “Search” chapter.
  1740.  
  1741. (§)    Going to markers in other files
  1742. As an aid to linking source files with supporting documentation,
  1743. EnterAct gives you a way to jump to a marker in any project file. This
  1744. is done by selecting text in any window that consists of a project file
  1745. name followed by a marker name, and then issuing the Go to command.
  1746.  
  1747. EnterAct can generate the necessary file name and marker name for the
  1748. link, as follows:
  1749.     •    in the window for the document in whch the marker is defined, access
  1750.         the marker menu and pick the mark, but in addition to holding down the
  1751.         <Option> or <Command> key hold down the <Shift> key as well
  1752.     •    the necessary text will be placed on the clipboard, ready for
  1753.         pasting. The file name and marker name will each be surrounded by «»
  1754.         quotes, which are optional but help the text to stand out.
  1755.     •    to generate the text for all markers in one or more files, you
  1756.         can use the "Index Marker Names..." command (chapter 22).
  1757.  
  1758. A typical “Go to” link looks like
  1759. ____
  1760.     /* See «My File Notes» «Variations on FSSpec» */
  1761. ____
  1762. and if the file “My File Notes” has been added to your current project
  1763. then you can jump to the marker named “Variations on FSSpec” by
  1764. selecting all of the file name and marker name including the
  1765. surrounding «» quotes, and then using the Go to command.
  1766.  
  1767. The advantage of this kind of link is that since the marker position
  1768. is maintained as you edit, so is your link. With this
  1769. «file name»«marker name» style of link, both file and marker name can be
  1770. abbreviated, and the link is immune to minor variations in spelling.
  1771.  
  1772. Many variations on “Go to” are available, such as going to a file-name
  1773. line-number, or just a file name, marker name, or line number. For
  1774. details, see the “‘Go’ commands” chapter.
  1775.  
  1776.  
  1777. (§)    Keeping track of things
  1778. When you close a project, it remembers which project text files you
  1779. have open. Later, when you reopen the project, those text files are
  1780. reopened as well. This makes it a little easier to pick up where you
  1781. left off. You could call this “context restoration”, though some like
  1782. to call it the “painless Quit”. It’s all automatic—just close the
  1783. project before you close your working files, or if you’re quitting,
  1784. don’t bother to close your working files first.
  1785.  
  1786. The concept of “undo” takes a step forward with EnterAct’s Show
  1787. Activities command, which displays the last 10,240 things you have done
  1788. with EnterAct. Descriptions are in plain English, and full contents
  1789. of edits are shown. A typical entry looks like this:
  1790. ____
  1791.  
  1792. ¶45
  1793. Tue, Mar 9, 1993 7:45:11 pm TYPING «Untitled-1» 1 1 (obs)
  1794. =>inserted 15 characters:
  1795. «AdjustTheCursor»
  1796. ¬
  1797.  
  1798. ____
  1799. —where “«Untitled-1» 1 1 (obs)” means the action started in the
  1800. “Untitled-1” window at line 1, character 1 on the line (ie the start
  1801. of the file), and the typing is now “obsolete”, ie it was never saved
  1802. to disk before closing the window. The “file name - line number” part
  1803. of the activity record is compatible with EnterAct’s Go to command.
  1804. And the full contents of all inserts and deletes are shown, up to a
  1805. very large limit. By using "Go to" and the contents of the activity
  1806. record you will be able to locate and selectively undo any of your
  1807. recent activities, provided that you haven’t destroyed the context of
  1808. the edit with a huge delete or by erasing the corresponding file. To
  1809. help you locate the edit position, Show  Activities provides the option
  1810. of correcting the original positions of edits to reflect the effects
  1811. of other edits, which is normally what you’ll want when reviewing or
  1812. selectively undoing your recent activities.
  1813.  
  1814. Since there are new concepts here, the “Show Activities” chapter goes
  1815. into considerable detail on such topics as “obsolete edits” and
  1816. “updated activity positions”. Once you’ve read through it, you’ll
  1817. realize you knew most of it already—you just didn’t talk about it much
  1818.  
  1819. EnterAct saves your activities to a disk log as you work. So “undo”
  1820. capabilities are not lost just because you quit and restart.
  1821.  
  1822. There is a way to undo files (one at a time) back to specific
  1823. activities. This involves the use of a hAWK program, and you’ll find
  1824. the details in the “Show Activities” chapter.
  1825.  
  1826. Though you haven’t done much yet, it wouldn’t be a bad idea to call
  1827. up the Show Activities dialog, pick any old options, click the OK
  1828. button, and see what happens. Not something you’ll use every day, but
  1829. your last ten thousand activities are still there if you need to review
  1830. or undo them.
  1831.  
  1832.  
  1833. (§)    Classes and methods
  1834. When you build yourself a project that contains classes, try out the
  1835. Browse command to see a graphic view of your classes. Double–click on
  1836. a class name to view the class definition, click–and–hold briefly on
  1837. a class name to select from a list of methods, and then view the method
  1838. definition. If you’re new to C++ or Java, you’ll find no better
  1839. way to learn than by exploiting EnterAct’s project–building, lookup,
  1840. and browsing power—in fact, you might want to build a project for THINK
  1841. C’s ArtClass demo or somesuch right now.
  1842. Incidentally, here’s a shortcut to adding all of the source and header
  1843. files in a folder that contains nothing but other folders:
  1844.     •first add a dummy text file (call it “_junk” or somesuch) at the top
  1845.     level of the folder containing the source and header folders;
  1846.     •then hold down the <Shift> or <Option> key while selecting the
  1847.     Add All In Folder command; double–click on your “_junk” file and all
  1848.     files in all subfolders will be added to your project.
  1849.  
  1850.  
  1851.  
  1852.  
  1853.  
  1854.  
  1855.  
  1856.  
  1857.  
  1858.  
  1859.  
  1860.  
  1861.  
  1862.  
  1863.  
  1864.  
  1865.  
  1866.  
  1867.  
  1868.  
  1869.  
  1870.  
  1871.  
  1872.  
  1873.  
  1874.  
  1875.  
  1876.  
  1877.  
  1878.  
  1879.  
  1880.  
  1881.  
  1882.  
  1883.  
  1884.  
  1885.  
  1886. (§)    Little things worth knowing
  1887. If you hold down the <Option> key while clicking in the zoom box of
  1888. a window, only the length will be zoomed.
  1889.  
  1890. When you double–click on a file in the project window to open the file,
  1891. the project window will retreat behind all other windows. You can bring
  1892. it to the front with <Command><zero>. Even on small screens this allows
  1893. you to have a large project window and use it conveniently as a “mini
  1894. Finder”.
  1895.  
  1896. Paste preserves relative indentation, at least in the commonest
  1897. situations where you would want your indentation to be retained( see
  1898. the “Paste preserves indentation” section in the “Editing” chapter).
  1899.  
  1900. Windows remember their last saved location, unless you select otherwise
  1901. from the Options dialog. 
  1902.  
  1903. EnterAct can take special care of your text documents, ensuring
  1904. that disk files are updated when you leave EnterAct, and windows
  1905. are updated when you return to EnterAct (see “Switching to other
  1906. applications”).
  1907.  
  1908. Reformat Selection is handy for making comments pretty again after
  1909. you’ve chopped them up (it’s undoable, and some options are available
  1910. in the Options dialog). 
  1911.  
  1912. There are some other things worth trying out, but you’ll find them
  1913. easily as you browse through the rest of this manual. 
  1914.  
  1915.  
  1916. (§)    Source code restrictions (don't panic)
  1917. There are three sorts of code constructions that are nominally correct,
  1918. but throw off EnterAct’s dictionary–builder. Please read the next
  1919. chapter "Source code restrictons" if the very notion bothers you.
  1920. Or just go ahead and use EnterAct, but remember that if you do
  1921. run into a problem while building your dictionary there are simple
  1922. workarounds for all problems in the "Source code restrictons" chapter.
  1923.  
  1924.  
  1925. (§)    Onwards
  1926. If you’ve tried things out for yourself while taking this tour, I
  1927. expect you know enough about EnterAct to begin using it full–time for
  1928. code creation and review—aside from knowing when to poke the <Enter>
  1929. and <Option> keys, there isn’t much to the basics. Eventually, alas,
  1930. you should probably read the rest of the manual. Personally, I enjoy
  1931. reading manuals.
  1932.  
  1933. To acquaint yourself with hAWK and Read Resource, add the on–disk “hAWK
  1934. User’s Manual” and “Read Resource Manual” to an EnterAct project and
  1935. follow the instructions therein. Learning Read Resource is a 5 minute
  1936. job. hAWK is rather more complicated, but it’s a powerful, widely–used
  1937. little language and learning it should prove well worth the effort.
  1938. Running hAWK programs is easy, at least, and many useful programs are
  1939. included.
  1940.  
  1941.  
  1942. -    -    -    -    -    -    -    -    -    -    -    -
  1943. Source code restrictions (ayeee! I knew it!!) - don't panic
  1944. -    -    -    -    -    -    -    -    -    -    -    -
  1945. §    Why not just compilable code?
  1946. EnterAct is able to identify terms in your code and correctly deduce
  1947. the type and definition of each term without doing extensive
  1948. preprocessing or semantic analysis. The benefits are lightning speed,
  1949. considerable tolerance of first–draft errors, and full information
  1950. retrieval, definition finding, browsing, and automatic marker placement
  1951. available right from the beginning of the code creation process. This
  1952. is all made possible with EnterAct’s Heuristic Adaptive Reentrant
  1953. Parser, which is based on a description of the way people actually
  1954. write code and the importance they attach to various constructs,
  1955. rather than on the textbook prescription. The drawback is that EnterAct
  1956. cannot deal with absolutely everything that is possible in C/C++/Java, and
  1957. some minor restrictions must be satisfied in order for the
  1958. dictionary–builder to deal properly with your code.
  1959.  
  1960. In practice, only the “illegal aliases” will present a significant
  1961. problem if present, in that the only workaround is to remove them
  1962. (have you ever seen one? me neither...).
  1963. Obviously-unnecessary parentheses will result in extra or missing
  1964. dictionary entries for some terms. Troubles with aliases and
  1965. parentheses are extremely rare, since they obfuscate the source code
  1966. for beginner and expert alike. To overcome problems with nested comment
  1967. starts or “all-or-nothing macro’s”, you just need to make EnterAct
  1968. aware that they are present, as explained below.
  1969.  
  1970.  
  1971. §    Aliases
  1972. Defined equivalents for certain keywords and punctuation should be
  1973. avoided. A defined equivalent or alias takes the form
  1974. ____
  1975.     #define    Record     struct
  1976. ____
  1977. for example. EnterAct won’t know that “Record” is supposed to mean
  1978. “struct”, and the dictionary–builder won’t work well at all.
  1979.  
  1980. Keywords that should not be aliased:
  1981. ____
  1982.     asm        enum        pascal        Pascal        struct        typedef    
  1983.     union        void        class
  1984. ____
  1985.  
  1986. Punctuation that should not be aliased:
  1987. ____
  1988.     ;    :    ,    \    "    '    {}    ()    []    /    *    =
  1989. ____
  1990.     
  1991. You will never see aliases for any of these in published code, or in
  1992. any code intended to be read by more than one person, for the simple
  1993. reason that such a creature as
  1994. ____
  1995.     Record fileData BEGIN int x SEMI END SEMI
  1996. ____
  1997. would be rather difficult for anyone but the author to read.
  1998. Other aliases, such as
  1999. ____
  2000.     #define    EQ    ==
  2001. ____
  2002. are perfectly OK, by the way.
  2003.  
  2004. §    Obviously unnecessary parentheses
  2005. These are just as rare as the aliases above. This restriction applies
  2006. only outside of function bodies and refers only to parentheses that
  2007. would result in a variable declaration resembling a function
  2008. declaration. An example would be
  2009. ____
  2010.     Peter    (Harvey);
  2011. ____
  2012. Right now you know as much as EnterAct does when it runs into this sort
  2013. of thing—is it a variable declaration or a function declaration? You
  2014. may have deduced that the above declaration is almost certainly for
  2015. a function “Peter” returning an (implicit) int, since you would never
  2016. type those parentheses in a simple variable declaration,
  2017. ____
  2018.     int    (x);
  2019. ____
  2020. —these are an example of what is meant by “obviously unnecessary
  2021. parentheses”, namely parentheses that make the code harder to read,
  2022. not easier. If you avoid these excessive parentheses when declaring
  2023. variables outside of a function, that’s all that’s needed. Once again,
  2024. you won’t see them in any published code, and even beginners feel that
  2025. such parentheses make life harder, not easier.
  2026.  
  2027.  
  2028. §    Nested comment starts
  2029. This refers to two consecutive comment starts with no intervening
  2030. comment end, eg
  2031. ____
  2032.     /*#define    DEBUG    /* some comment here */
  2033. ____
  2034. where the intent is to define or undefine DEBUG by removing or
  2035. replacing the first comment start. If your code employs this (lazy)
  2036. sort of construct, then instruct EnterAct that this is not an error
  2037. by selecting Options… from the Edit menu and removing the check mark
  2038. from the box titled “Detect nested comment starts”. There is an
  2039. illustration of this in the “Options” chapter, by the way. As a
  2040. side-effect, EnterAct will not be able to warn you if a comment end
  2041. has accidentally been omitted.
  2042.  
  2043. If you value the notion that EnterAct can fully trap any single failure
  2044. to properly start or end a comment (something that many compilers,
  2045. including THINK C, don’t do), then leave the check mark in the  “Detect
  2046. nested comment starts” box, and remove the nested comment starts from
  2047. your code. Simplest, use "//" style comments instead.
  2048.  
  2049. §    Preprocessor tangles
  2050. Although these do pop up, they're easy to fix up. 
  2051.  
  2052. Conditional #defines which duplicate important punctuation can
  2053. cause trouble, such as
  2054. ____
  2055.     #ifdef GO_LONG
  2056.     long GetArrayIndex(void) {
  2057.     #else
  2058.     short GetArrayIndex(void) {
  2059.     #endif
  2060. ____
  2061. —EnterAct will complain about the '{' being there twice, and
  2062. the simple fix is to put the curly brace (which isn't conditional
  2063. anyway) after the conditional part:
  2064. ____
  2065.     #ifdef GO_LONG
  2066.     long GetArrayIndex(void)
  2067.     #else
  2068.     short GetArrayIndex(void)
  2069.     #endif
  2070.     {
  2071. ____
  2072.  
  2073. EnterAct's parser can sometimes spazz out because it's trying to
  2074. handle C and C++ and first-draft code and all possible values of
  2075. a #define all at once. For example,
  2076. ____
  2077.     typedef struct A
  2078.     #ifdef __cplusplus
  2079.     : public B
  2080.     #endif
  2081.     {
  2082. ____
  2083. used to generate a complaint, and there may still be similar constructs
  2084. out there that cause a problem. The fix is to provide the full C and
  2085. C++ introductions separately, as in
  2086. ____
  2087.     #ifdef __cplusplus
  2088.     struct A : public B
  2089.     #else
  2090.     typedef struct A
  2091.     {
  2092. ____
  2093.  
  2094. And one more tangle: if you put something that's deliberately
  2095. uncompilable in your code, avoid all punctuation except commas
  2096. and semicolons (some few others might work). For example,
  2097. ____
  2098.     #ifdef A_Compiler
  2099.     #ifdef B_Compiler
  2100.     error - won't you please make up your mind?!
  2101.     ...
  2102. ____
  2103. would trip EnterAct, whereas
  2104. ____
  2105.     #ifdef A_Compiler
  2106.     #ifdef B_Compiler
  2107.     error, please make up your mind
  2108. ____
  2109. while lacking punch, would work fine from EnterAct's view.
  2110.  
  2111. §    All–or–nothing macro’s
  2112. This final restriction is one that you may run into, but the workaround
  2113. is easy.
  2114.  
  2115. An “all–or–nothing” macro is a macro that looks something like
  2116. ____
  2117.     #ifdef        BLUETREECOMPILER
  2118.     #define P(x)     x
  2119.     #else    /* some other compiler */
  2120.     #define P(x)
  2121.     #endif
  2122. ____
  2123. —so P(x) either does nothing at all to its argument or it “eats” the
  2124. argument, but either way the macro itself disappears from the code.
  2125. If such a macro is the very first thing in a statement then EnterAct
  2126. will deal with it correctly, for example "P(typedef  int  INT16;)"
  2127. would result in INT16 being recorded as a typedef’d equivalent of
  2128. “int”. 
  2129.  
  2130. However, if the all–or–nothing macro is not the very first thing in
  2131. the statement, as in
  2132. ____
  2133.     int myFunc P((int x, long y));
  2134. ____
  2135. then EnterAct will mistakenly record “P” and not “myFunc” as the
  2136. function name, and in general it will misrecord any similar statement
  2137. where an–or–nothing–macro isn’t the first thing in the statement.
  2138.  
  2139. In case you’re wondering, the intention of
  2140. ____
  2141.     int myFunc P((int x, long y));
  2142. is to produce either
  2143.     int myFunc (int x, long y);
  2144. or
  2145.     int myFunc ();
  2146. ____
  2147. —in other words either a proper modern prototype or an old–fashioned
  2148. declaration, and this sort of thing is useful when writing code that
  2149. will be compiled using different compilers.
  2150.  
  2151. What to do? Call up the Macro's to skip dialog from the EnterAct menu,
  2152. and enter the name of the macro there.
  2153.  
  2154. (PLEASE NOTE you may not realize you have an all-or-nothing macro until
  2155. after you have built your dictionary. If this is the case, you should
  2156. completely rebuild your dictionary to ensure that all definitions are
  2157. correct. To completely rebuild your dictionary:
  2158.     •    hold down all three of the <Shift>, <Option>, and <Command> keys
  2159.         while using the mouse to select Update Dictionary from the EnterAct
  2160.         menu.
  2161.  
  2162. )
  2163.  
  2164.  
  2165.  
  2166.  
  2167.  
  2168.  
  2169.  
  2170.  
  2171.  
  2172.  
  2173.  
  2174.  
  2175.  
  2176.  
  2177.  
  2178.  
  2179.  
  2180.  
  2181.  
  2182.  
  2183.  
  2184.  
  2185. (This button reads “New projects” if no project is open at the time.)
  2186.  
  2187. -    -    -    -    -    -    -    -    -    -    -    -
  2188. Projects
  2189. -    -    -    -    -    -    -    -    -    -    -    -
  2190. §    Introduction
  2191. Any collection of TEXT or PICT files from up to 6 disks can be added
  2192. to an EnterAct project. The project window displays three lists of
  2193. files in your project, and behind the scenes your project contains a
  2194. dictionary of C/C++/Java term definitions, prototypes, and general notes.
  2195. To create and make use of a project:
  2196.     •    use New Project to create an entirely new project, or use Save As
  2197.         with a project window in front to build on an existing project
  2198.     •    if you have nonstandard file extensions (beyond the usual
  2199.         .c, .h, .cp etc) use the "File Extensions..." dialog to make your
  2200.         project aware of them
  2201.     •    add files to your project with Add Files (one at a time) or Add All
  2202.         In Folder (all files in the folder at once)
  2203.     •    bring your dictionary up to date with Update Dictionary
  2204.     •    thereafter, bring your dictionary up to date whenever you want your
  2205.         dictionary to reflect new or altered definitions.
  2206.     •    to switch to a different project that you've had open recently,
  2207.         <Option> or <Command> click in your current project window's
  2208.         title bar to pick from a popup list (please see "Switching to
  2209.         other projects" below -- <Option>clicking will close all your
  2210.         text windows, whereas <Command>clicking will not)
  2211.     •    things work best if you include definitions for all the
  2212.         names in your source code, especially toolbox terms but also
  2213.         PowerPlant or TCL, and ANSI headers.
  2214.  
  2215. NOTE if a folder's name is in parentheses, the files in it will not
  2216. be added to your project. To exclude a folder such as "Old Source",
  2217. change its name to "(Old Source)".
  2218.  
  2219. The three lists of files in the project window can be used to open
  2220. files, by double-clicking on the file names listed there. You can set
  2221. up a multi-file selection by holding down the <Option> key and clicking
  2222. on or dragging over file names, or select all files of a certain type
  2223. by using the buttons in the Find dialog. Bullets (•) will appear beside
  2224. selected files. This list of files can be used with multi-file
  2225. searching or passed as input to a hAWK program or one of the
  2226. “Index” commands under the EnterAct menu. You can also remove
  2227. the selected files from the project with Remove •'d Files.
  2228.  
  2229. To exclude a file from being built into your dictionary, hold down the
  2230. <Command> key and click on its name (more on this later).
  2231.  
  2232. Other things you can do with the lists of project files:
  2233.     •    Find all or part of a file name (useful with enormous lists, have
  2234.         the project window in front and select the appropriate list before
  2235.         using Find or Find Again)
  2236.     •    Copy a selected file name
  2237.     •    use the up and down arrows to move up and down the file lists, and
  2238.         the left and right arrows to change panes
  2239.     •    type your way to a particular file in a pane, by typing the first part
  2240.         or any distinctive part of the name (priority given in that order)
  2241.     •    open a file by selecting it and issuing the Go To command
  2242.  
  2243. The project window goes to the back whenever you open a file from it,
  2244. and is listed under the Windows menu as the first file. Any project
  2245. files that you have open when you close a project are remembered, and
  2246. reopened as you left them when you reopen the project.
  2247.  
  2248. The dictionary is required by regular lookup (click just after a term
  2249. name and press the <Enter> key), and by the AutoLook window which
  2250. displays definitions and prototypes automatically as you edit or mouse
  2251. around. More on this later, of course.
  2252.  
  2253. Only one project can be open at a time. You don’t need to have a
  2254. project open to use EnterAct as an editor.
  2255.  
  2256.  
  2257. §    Project files
  2258. An EnterAct project can track any set of TEXT or PICT files. The source
  2259. and header files don’t have to add up to a compilable
  2260. application—anywhere from one file to part or all of the source and
  2261. documentation for several applications can be an EnterAct project. The
  2262. only practical limit is available memory, since your entire dictionary
  2263. is kept in memory: allow EnterAct 4 Meg if you can, otherwise you
  2264. may have to delete some of the larger unneeded header files from
  2265. your project.
  2266.  
  2267. An EnterAct project can contain files from up to 6 disks. If your
  2268. project files are split across several disks, you should have all the
  2269. disks on–line (mounted) before updating your dictionary or doing things
  2270. with a multi–file selection. EnterAct tracks your disks by name, and
  2271. many other applications do the same, so please ensure that all your
  2272. disks have different names. If you ever find it necessary to move a
  2273. considerable number of files from one folder or disk to another, the
  2274. simplest way to deal with the change in any EnterAct project that
  2275. refers to those files is to throw the project away and create an new
  2276. one. Or, you can use Remove •'d Files (<Option>drag over the file names
  2277. first in the project window so that bullets (•) appear to the left of
  2278. the names) followed by Add Files and then Update Dictionary afterwards
  2279. to update your project. And a third way, slightly more complicated:
  2280.     •    before moving the files, select all files for multi-file ops
  2281.     (call up the Find dialog and click "All")
  2282.     •    run the hAWK program "$EchoFullPathNames", and use
  2283.     Save As to save the resulting list of full path names
  2284.     • move the files
  2285.     • edit the disk or folder names in your list of full path names
  2286.     to reflect the new locations
  2287.     • create a new EnterAct project, hold down the <Shift> key,
  2288.     and select Add Files from List… - double-click on the file
  2289.     you created that contains the full path names.
  2290.  
  2291. (A fourth way to relocate files, activating the "Relocate files
  2292. automatically" option in the Options dialog, works only if all
  2293. your source and header files have unique names within the
  2294. context of their disks, and works only if you change the folder
  2295. where they reside - it doesn't work if you change disks. Use of
  2296. this option is NOT recommended, unless you're quite sure that
  2297. your files have unique names on their disks.)
  2298.  
  2299. EnterAct can handle the following changes to file and folders
  2300. without requiring you to make a new project:
  2301.     • renaming a folder
  2302.     • moving a folder around within one disk
  2303.     • moving a file to a different folder, provided the file
  2304.     name is unique on the disk, if you activate the "Relocate
  2305.     files automatically" option (see just above, not recommended
  2306.     for casual use)
  2307.  
  2308. As mentioned, EnterAct cannot track files if you move them
  2309. to a different disk, unless the two disks involved have the
  2310. same name. 
  2311.  
  2312. Tip: if you often restore you project files from another disk,
  2313. try using a smart copy utility such as CopyDoubler(tm) or equivalent:
  2314. this will preserve all folders involved, and EnterAct won't lose
  2315. track of any files due to two or more files having the same name.
  2316.  
  2317. §    Creating a project
  2318. Select New Project from the EnterAct menu at any time. When you start
  2319. EnterAct by double–clicking on its icon, you’ll see the New Project
  2320. dialog if you cancel the Open Project dialog that appears first during
  2321. the startup. Since the the project will always be saved for you
  2322. automatically, there’s no such thing as an “Untitled” project: you’ll
  2323. have to give it a home on your disk before doing anything with it.
  2324.  
  2325.  
  2326.  
  2327.  
  2328.  
  2329.  
  2330.  
  2331.  
  2332.  
  2333.  
  2334.  
  2335.  
  2336.  
  2337. You can also use Save As to create a copy of an existing project. This
  2338. is a quicker approach if you want a basic set of files to be added to
  2339. a fresh project. To create a “starter” project, once you have a list
  2340. of files in mind:
  2341.     •    create a project that contains just the basic files, and give it
  2342.         a name that reflects its status as a “starter”
  2343.     •    bring the dictionary up to date, so this only has to be done once
  2344.         for the basic files
  2345.     •    set the font, size, and screen placement of the project window.
  2346.  
  2347. Thereafter, to use a “starter” project as the basis of a new project:
  2348.     •    open the starter project
  2349.     •    immediately use Save As, and give it an appropriate name
  2350.     •    proceed as with a new project, adding files and building the
  2351.         dictionary.
  2352.  
  2353. Candidates for inclusion in a “starter” project include toolbox headers
  2354. (omitting the ones you don’t need reduces memory needs) and the on-disk
  2355. manuals supplied with EnterAct. If you’re an object-oriented sort, then
  2356. many of the files in your class library of choice will qualify
  2357. as well.
  2358.  
  2359. §    Selecting your <system> folder
  2360. When you create a new project, a second dialog will appear asking you to
  2361. select the folder to designate as the <system> folder: this is the
  2362. folder where the "Add Mac Headers" command will search for your
  2363. Mac headers ("Quickdraw.h and friends), and it is also the folder used
  2364. to distinguish between All ".h" and All <.h> (or .c) in the Find dialog
  2365. when you are selecting files to search.
  2366.  
  2367. If you cancel the "Select <system> Folder" dialog when creating
  2368. a project, the folder that contains EnterAct itself will be used
  2369. by default. So the best place to put EnterAct on your disk is next
  2370. to the compiler you use most.
  2371.  
  2372. You can change the designated <system> folder for a project at
  2373. any time by using the "Select <system> Folder...." command under
  2374. the EnterAct menu.
  2375.  
  2376. §    Three panes—.c, .h, plain text
  2377. Any files you add to your project whose names end in .c, .C, .cp,
  2378. .CP, .cpp, or .CPP (source files) will be placed in the left pane.
  2379. Header files (ending in .h or .H) will go in the middle pane, and any
  2380. other TEXT files that you add will end up in the right pane. PICT’s
  2381. will also be placed in the right pane. If you have special file
  2382. extensions after a period, eg “.Proto”, that you would like to have
  2383. treated as source or header files, see the “Custom file extensions”
  2384. section a few pages on.
  2385.  
  2386. The dictionary-builder does not look at files in the right pane, which
  2387. is reserved for documentation. However, it will extract definitions
  2388. and prototypes from all files in the left and middle panes, so all
  2389. files added to these panes should be in C/C++/Java, or at least intend to
  2390. be C/C++/Java when they grow up.
  2391.  
  2392. Since a file’s extension entirely determines the pane it will be added
  2393. to, you can force the file to be added to a particular pane by altering
  2394. its name to give it the appropriate extension. For example, if you have
  2395. a source file “OldMain.c” that you want placed in the right
  2396. (documentation) pane, alter its extension to something that is not
  2397. registered as an extension for the left or middle panes. With no custom
  2398. extensions, a name such as “OldMain.co” or “OldMain.ç” or “OldMain”
  2399. would force the file into the rightmost pane.
  2400.  
  2401. In each pane, the files are sorted alphabetically by name. Since
  2402. EnterAct is not a compiler, there’s no need to set up code segments.
  2403.  
  2404. If you add more than one file with the same name, truncated full path
  2405. names will be shown to the right of the names so that you can tell
  2406. which one is which.
  2407.  
  2408. §    Adding Java files
  2409. Java files should go in the left pane of your project. To put your Java
  2410. files in the right place, select "File Extensions..." from the "EnterAct"
  2411. menu and type in "java" as an extension for the left pane. If you do
  2412. this with no project open, this will affect all new projects.
  2413.  
  2414. Otherwise, everything for Java files is the same as for C++ files.
  2415. For best results, grab the source for the standard java libraries
  2416. somewhere (eg CW9) and add it to your project.
  2417.  
  2418. §    Add Files—the one-at-a-time way
  2419. The Add Files command will let you repeatedly add files (one at a time)
  2420. to your project, until you cancel the dialog. The appropriate pane for
  2421. each file will be chosen for you. The type of the file you add can be
  2422. TEXT or PICT.
  2423.  
  2424. §    Adding files from a list
  2425. The Add Files from List… command appears in place of
  2426. the Add Files command when you hold down the <Shift> or <Option> key.
  2427. A standard Open dialog will appear, in which you should select a text
  2428. file that contains a list of full path names of files to be added to your
  2429. project, one name per line. Within EnterAct, a list of full path names
  2430. can be generated by selecting the desired files in your project for
  2431. multi-file operations (hold down the <Option> key and click on the files
  2432. in your project window), and then running the hAWK program
  2433. $EchoFullPathNames. See the “Search” chapter for multi-file
  2434. selections, and Appendix 2 for hAWK.
  2435.  
  2436. Recommended, for important projects take a minute to produce
  2437. a list of all files in your project:
  2438.     •    with the project open, call up Find and click the "All" button
  2439.         to place bullets beside all files (just make sure all disks for
  2440.         the files are mounted)
  2441.     • select "hAWK", pick the $EchoFullPathNames program from the
  2442.         top popup menu, and click "Run"
  2443.     •    Save the resulting document as "MyProj Files" or equivalent.
  2444.  
  2445. Later, if you need to recreate the project, you can do so quickly
  2446. with the Add Files from List… command.
  2447.  
  2448.  
  2449. §    Add All In Folder—the fast way
  2450. To add all files in a folder to your project:
  2451.     •    select Add All In Folder
  2452.     •    select a folder that contains files to be added
  2453.     •    click on the button with the folder's name at bottom
  2454.     •    do another folder, or Cancel
  2455.  
  2456. When you click the bottom button, all TEXT files in
  2457. the folder will be added to your project. Files in subfolders will not
  2458. be added. This command will also repeat until you click the Cancel
  2459. button. As with Add Files, there’s no need to select a project pane
  2460. beforehand.
  2461.  
  2462.  
  2463.  
  2464.  
  2465.  
  2466.  
  2467.  
  2468.  
  2469.  
  2470.  
  2471.  
  2472.  
  2473.  
  2474.  
  2475.  
  2476.  
  2477.  
  2478.  
  2479.  
  2480.  
  2481.  
  2482.  
  2483.  
  2484.  
  2485.  
  2486.  
  2487.  
  2488.  
  2489.  
  2490.  
  2491. (Clicking on the "CEDARL_Source" button would add all files in that
  2492. folder to the project, and also all files in subfolders if the <Shift>
  2493. key was down while picking the "Add Files" menu item.)
  2494.  
  2495. To add all files in all subfolders to your project as well, hold down
  2496. the <Shift> or <Option> key while picking  Add All In Folder (the key
  2497. command won’t work with the <Option> key, just the <Shift> key). Then
  2498. select a folder and click on the bottom button with its name.
  2499. .Note that <Command><period> will interrupt this all-inclusive
  2500. version of Add All In Folder, in case you start in the wrong place.
  2501.  
  2502. You can also select and add individual files with the Add All
  2503. command, but note this will have exactly the same effect
  2504. as selecting the folder that contains the file, adding all
  2505. files in the folder (and optionally subfolders).
  2506.  
  2507. §    Add Mac Headers
  2508. The Add Mac Headers command will search the folder that contains
  2509. EnterAct and all sub–folders for the file “Quickdraw.h”. Wherever it
  2510. is found, all files in that folder will be added. If not found, you will
  2511. see a message from EnterAct mentioning that “Quickdraw.h” wasn’t found
  2512. anywhere. You can add these headers yourself with the Add All
  2513. In Folder command.
  2514.  
  2515. If you hold down the <Shift> or <Option> key while selecting this
  2516. command, then in addition Add THINK Headers will also be done (see just
  2517. below).
  2518.  
  2519.  
  2520. §    Add THINK Headers
  2521. This command will add all files in the folder containing “THINK.h” to
  2522. your project. These include “asm.h”, “pascal.h”, “SANE.h” etc.
  2523. If you're using CodeWarrior or MPW, this command doesn't do much.
  2524.  
  2525.  
  2526. §    Add Standard C Headers
  2527. This command will add all files in the folder containing “stdio.h” to
  2528. your project.
  2529.  
  2530.  
  2531. §    The active pane
  2532. When you click in one of the three file lists it becomes the active
  2533. pane, as indicated by highlighting of the file name you click on, and
  2534. activation of the scroll bars for that pane. You can also switch
  2535. between panes by using the left and right arrow keys.
  2536.  
  2537. Some project-related commands such as Update Dictionary and Find In
  2538. Next File are independent of the active pane, while others act within
  2539. a particular pane. Here’s a list of commands and features which apply
  2540. to the active pane:
  2541.     •    the active pane is relevant only when the project window is in
  2542.         front, in which case one of the file names in the active pane will be
  2543.         highlighted, and the scroll bars will be active
  2544.     •    to scroll the currently-selected file in the active pane into view,
  2545.         press <Enter>
  2546.     •    as you drag about in the active pane the currently-selected file
  2547.         will change to keep up with your mouse, with full autoscrolling
  2548.     •    to move up and down the list of files in the active pane, use the
  2549.         up and down arrows. <Option><up arrow> selects the first file in the
  2550.         pane, and <Option><down arrow> selects the last file
  2551.     •    to change panes, click in the pane you want or use the <left arrow>
  2552.         and <right arrow> keys
  2553.     •    type part of a file name to advance to a particular file in the
  2554.         active pane, eg type "mou" to advance to either "Mouse.h" or
  2555.         "MAIN_Mouse.h" -- a match on the first part of the name is tried
  2556.         first, and if that fails then a match anywhere within the name counts
  2557.     •    Copy will copy the currently-selected file name in the active pane
  2558.     •    double-clicking on a file name opens the file, and the
  2559.         currently-selected file in the active pane can be opened with the Go
  2560.         to command
  2561.     •    the active pane is searchable with the Find and Find Again commands
  2562.         when the project window is in front, or just behind the Find dialog.
  2563.         Note that when the Find dialog is immediately in front of the project
  2564.         window the “Find” button will search the list of file names in the
  2565.         active pane, whereas the “Find In Next File” button will search through
  2566.         the contents of those files marked with bullets (•). Searching through
  2567.         the active pane for part of a file name or a file extension is handy
  2568.         when you have a great many files in a pane
  2569.     •    Remove File removes the currently-selected file in the active pane
  2570.         from the project, deleting both the file name and the associated
  2571.         dictionary entries.
  2572.  
  2573. §    Remove File
  2574. To remove one file from a project, bring the project window to the
  2575. front, select the file by clicking on it, and then select Remove File.
  2576. If you have built a dictionary for the project, the dictionary will
  2577. be automatically updated for you.
  2578.  
  2579.  
  2580. §    Remove •'d Files
  2581. The “•” refers to files in the project window that have been marked
  2582. for multi–file operations (a bullet • appears to the left of the file
  2583. name). Before issuing this command, first mark the files that you wish
  2584. to remove with bullets (<Option>drag over the files in the project
  2585. window). You can also mark all files of a particular type by using the
  2586. buttons in the Find dialog.
  2587.  
  2588. Any dictionary entries associated with the file will also be deleted.
  2589. See the next chapter for a description of your project dictionary.
  2590.  
  2591. By the way, this is the only command in EnterAct that will pay
  2592. attention to bullets beside PICT file names. All other commands which
  2593. deal will your list of bulleted files (such as Find In Next File, or
  2594. passing the list as input to a hAWK program) will quietly ignore the
  2595. PICT files, since all other multi-file commands deal only with text
  2596. files.
  2597.  
  2598.  
  2599. §    Custom file extensions
  2600. The File Extensions command under the EnterAct menu allows you
  2601. to specify additional file extensions beyond the standard .c, .C, .h,
  2602. .H etc. Type in your own extensions (up to 6 extensions, each up to
  2603. 5 characters), and pick which pane the file should be added to. For
  2604. example to have “.Proto” files added to the middle pane, type in
  2605. “Proto” (don't type the period) in one of the extension fields and
  2606. click the corresponding “Mid pane” button. Extensions are
  2607. case-sensitive, so “PROTO” is not the same as “Proto”. If you have
  2608. multiple versions of the same extension, you should enter them
  2609. separately.
  2610.  
  2611. If a project is open when you pick File Extensions the extensions you
  2612. enter will apply to that project only, as indicated by the “This
  2613. project” button. If no project is open at the time, the extensions will
  2614. be used for any new project you create (the bottom-left button will
  2615. read “New projects” in this case).
  2616.  
  2617. Please note any file that is added to the left or middle panes will
  2618. be parsed, and terms contained will be built into your dictionary, as
  2619. explained in the next chapter on dictionaries. This means the files
  2620. must be in C/C++/Java (or at least “C--”), otherwise the dictionary builder
  2621. will complain.
  2622.  
  2623. One use for this that you might like to explore later is creating your
  2624. own “.Note” files. The “.Note” extension will remind you of their
  2625. contents, namely hyperlinked notes on any subject that can be called
  2626. up with a click and press of the <Enter> key. This is described at
  2627. length in the “Lookup” chapter, which you’ll get to eventually if you
  2628. just keep reading along.
  2629.  
  2630. Here’s what the File Extensions dialog looks like:
  2631.  
  2632.  
  2633.  
  2634.  
  2635.  
  2636.  
  2637.  
  2638.  
  2639.  
  2640.  
  2641.  
  2642.  
  2643.  
  2644.  
  2645.  
  2646.  
  2647.  
  2648.  
  2649.  
  2650.  
  2651.  
  2652.  
  2653. §    Distinguishing ".h" from <.h>
  2654. The ".h" and <.h> buttons in the Find dialog let you set up a
  2655. multi–file search for just one kind of header (ie system or your own),
  2656. and since bullets • are shown beside selected files selecting one or
  2657. the other kind will give you an on–screen way of telling which are
  2658. which. Similarly, the ".c" and <.c> buttons allow you to select
  2659. source files in either your project folder or your system folder
  2660. for multi-file operations such as searching. The "system" folder
  2661. is the one that contains EnterAct.
  2662.  
  2663. Note for this to work properly your system headers should be in the
  2664. same folder as EnterAct itself, and your own headers should be in a
  2665. folder outside the one that holds EnterAct.
  2666.  
  2667. Technically, this command bullets files in the left or middle pane
  2668. based soley on their disk location. In particular, any files with
  2669. custom file extensions such as “PROTO” or “Notes” will end up with
  2670. bullets if they they fall in the category selected (<.h> and <.c> for
  2671. EnterAct’s folder, ".h" and ".c" for elsewhere).
  2672.  
  2673. §    Copy and search in the project window
  2674. When you have a file name selected in the project window, you can Copy
  2675. it and then Paste it into a text window. This helps sometimes with
  2676. documentation. 
  2677.  
  2678. With the project window in front, pressing any key will scroll the
  2679. current project pane to the first file name that begins with the single
  2680. character you typed. This is something like a file open dialog, but
  2681. responds to just one character at a time.
  2682.  
  2683. And, if you have an enormous project, the Find dialog will let you
  2684. search for part or all of a file name in a particular pane. Select the
  2685. pane in the project window that you wish to search, call up the Find
  2686. dialog, and then continue as though you were searching for something
  2687. in a text document.
  2688.  
  2689.  
  2690. §    Project memory needs
  2691. EnterAct will be keeping your entire project dictionary in memory, for
  2692. rapid access, and this does place a practical limit on the size of a
  2693. project. Roughly, the memory needed will amount to 500K for basic
  2694. operations plus 16% of the size of all source (left-pane) files plus
  2695. 120% of the size of all header (middle-pane) files, with “size” meaning
  2696. the size of a file’s data fork in bytes, rather than the disk space
  2697. used. Note that toolbox and other header files can take a large memory
  2698. bite, so if memory becomes tight your greatest savings can be realised
  2699. by removing header files that you don’t really need built into your
  2700. dictionary.
  2701.  
  2702. As a rule of thumb, give a small project about 2 Meg to work with,
  2703. and allow about 4 Meg for a larger one (say 1 Meg of source code with most
  2704. toolbox headers).
  2705.  
  2706. For more details, especially on toolbox headers and their memory needs,
  2707. please see the document “EnterAct memory needs”.
  2708.  
  2709.  
  2710. §    Multi-file selection
  2711. The general notion is to select one or more of the project files listed
  2712. in your project window, and then issue a command that acts on all
  2713. selected files. The classic use is for multi-file searching.
  2714.  
  2715. To create a multi-file selection for your current project:
  2716.     •    (Coarse tuning) in the Find dialog, click on the various buttons
  2717.         that select all files of a particular type
  2718.     •    (Fine tuning) hold down the <Option> key and click on or drag over
  2719.         file names in the project window. This acts as a “toggle”, selecting
  2720.         files if they were not selected and vice versa. The cursor will change
  2721.         to an “eye” when it’s over the project window with the <Option> key
  2722.         down.
  2723.  
  2724. Each file included in your multi-file selection will have a bullet (•)
  2725. to the left of its name in the project window.
  2726.  
  2727. Your multi-file selection can be used in the following ways:
  2728.     •    to carry out a multi-file search; enter the text to be found in the
  2729.         Find dialog, and click the “Find In Next File” button there, or use
  2730.         the equivalent command under the Search menu. For more on this, see
  2731.         the “Search” chapter.
  2732.     •    to remove files from your project; use the Remove •'d Files command
  2733.         described earlier in this chapter
  2734.     •    as input to a hAWK program; for example, to generate a list of full
  2735.         path names for all text files in your multi-file selection:
  2736.         •    select the hAWK command under the EnterAct menu
  2737.         •    use the “Program:" popup menu to select “$EchoFullPathNames”
  2738.         •    click the “Run” button, and wait a bit... the list of full
  2739.             path names will be shown to you in a fresh window.
  2740.     •    as input for one of the “Index" commands, as described in
  2741.         the “‘Index’ commands” chapter.
  2742.  
  2743. For more on hAWK see the “hAWK User’s Manual”.
  2744.  
  2745.  
  2746.  
  2747.  
  2748.  
  2749.  
  2750.  
  2751.  
  2752.  
  2753.  
  2754.  
  2755.  
  2756.  
  2757.  
  2758.  
  2759.  
  2760.  
  2761.  
  2762.  
  2763.  
  2764.  
  2765.  
  2766.  
  2767.  
  2768.  
  2769.  
  2770.  
  2771.  
  2772. (Coarse-tune your multi-file selection with buttons in the Find dialog,
  2773. fine-tune it by holding down the <Option> key and dragging over files
  2774. in the project window)
  2775.  
  2776.  
  2777. §    Project context restoration
  2778. When you close a project, or quit with a project open, the project will
  2779. keep a list of all project documents that are open at the time. That’s
  2780. your “context”. The next time you open the project, all of those
  2781. project documents will also be reopened, and placed and scrolled much
  2782. as you left them, and the Browser window will also be brought back if
  2783. you left it open. This is all automatic, so in the rare event that you
  2784. don’t want your context restored, do a Close All before closing the
  2785. project or quitting.
  2786.  
  2787. Some details: your windows will be put back exactly where you left
  2788. them; file errors are suppressed during context restoration, so if a
  2789. document seems to be missing try double–clicking on it in the project
  2790. window; text documents will be restored with your insertion point or
  2791. selection range scrolled into view, to avoid confusion; however, if
  2792. a document is already open, only its window order will be restored;
  2793. and if a document has been edited (anywhere) while the project was
  2794. closed, it won’t be scrolled. Lookup windows and  documents that
  2795. haven’t been added to your project (including “Untitled” windows) are
  2796. not restored. However, AutoLook will be restored.
  2797.  
  2798. If you’re about to switch from one project to another, and want the
  2799. project being closed to remember and restore the open documents, close
  2800. the project before closing any of the documents that you want
  2801. remembered—then open the other project.
  2802.  
  2803. §    Switching to other projects
  2804. <Option> or <Command> click in the title bar of a project window to
  2805. view a popup list of other projects that you have had open.
  2806. When you pick one  from the list, your current project will close and
  2807. the one you picked will open. If you use the <Option> key, you will be
  2808. asked to save any documents that need saving, and all text windows
  2809. will be closed. If you use the <Command> key, all your text windows
  2810. will be left open. Using the <Option> key to close all windows
  2811. between switches is the better approach if all of the files you
  2812. are dealing with are in your projects, since it keeps your screen
  2813. from becoming buried under a sea of windows.
  2814.  
  2815. §    Tips
  2816. When you double–click on a file name in the project window to open a
  2817. file, the project window will at the same time move to the back behind
  2818. all other windows. If the project window becomes hidden, you can bring
  2819. it to the front again by selecting it from the Windows menu or using
  2820. the menu key equivalent <Command><zero> which is always for the project
  2821. window. Since the project window goes all the way front or back with
  2822. a key–stroke or double–click, you can if you wish make the project
  2823. window relatively large and treat it as a sort of backdrop mini–Finder
  2824.  
  2825. If you begin the names of your own header files with a common character
  2826. or group of characters, they will end up grouped together in the middle
  2827. pane of your project window, and similarly for the other panes.
  2828. Remember you don't have to type the prefix to select a file
  2829. in the active pane, you just need to type some distinctive part of
  2830. the name.
  2831.  
  2832. To save time when creating new projects, create one or more “generic”
  2833. projects which include header files that are often needed—and exclude
  2834. headers than aren’t often needed. Select Update Dictionary before
  2835. putting your generic project away. When you want to create a new
  2836. project, open the appropriate generic one and use Save As to give it
  2837. a new name. This way you won’t have to weed out unneeded headers to
  2838. minimize memory needs, and your dictionary will already be up to date
  2839. for the basic headers.
  2840.  
  2841. -    -    -    -    -    -    -    -    -    -    -    -
  2842. Dictionaries
  2843. -    -    -    -    -    -    -    -    -    -    -    -
  2844. §    Introduction
  2845. Once built, a project’s dictionary will contain entries for virtually
  2846. every C/C++/Java term in every source (left pane) or header (middle pane)
  2847. project file that is not restricted in scope to the body of a function.
  2848. For functions and methods the dictionary entry will
  2849. be the prototype or equivalent, and for all other terms the entry will
  2850. consist of the entire statement in your source code in which the term
  2851. was mentioned or defined. Regular use of Update Dictionary will keep
  2852. your dictionary current as you develop your source code.
  2853.  
  2854. As explained in the next chapter, the main point of having a dictionary
  2855. is to give you instant displays of those definitions and prototypes.
  2856. The AutoLook window shows them automatically as you edit, and more
  2857. detailed and permanent displays can be generated by double-clicking
  2858. on a name and pressing the <Enter> key. You can also jump to the
  2859. definition of any dictionary entry, as explained in the “Seeing where
  2860. a term is defined” chapter. The project dictionary forms the basis for
  2861. the display in the Browser window. And there’s a hAWK built-in function
  2862. that lets you determine the type of a C term within the context of your
  2863. current project (see the hAWK program “$Whazzat”, which
  2864. translates C declarations into English).
  2865.  
  2866. The AutoLook window can also display definitions for local variables.
  2867. For this to work, in addition to having a dictionary you should be
  2868. working inside a function in a source file.
  2869.  
  2870.  
  2871. §    What’s in a dictionary
  2872. After you’ve built your dictionary with the Update Dictionary command
  2873. (see the next section), it will contain entries for everything of
  2874. interest in your current project’s source (left pane) and header
  2875. (middle pane) files that you would want to use in more than one 
  2876. function. Specifically there will be an entry for every:
  2877.     •    function—all types including static, in–line, method
  2878.     •    struct, union, enum, class
  2879.     •    enum constant
  2880.     •    #define—constant and macro
  2881.     •    typedef
  2882.     •    variable—all types including static, low–memory
  2883.  
  2884. —provided only that the term is defined or mentioned outside of a
  2885. function.
  2886.  
  2887. Note that members of classes, structs and unions are included, as
  2888. are prototypes or definitions of methods within class definitions.
  2889. Local variables are not included in your dictionary, but the AutoLook
  2890. window can look at your function to find the variable's defining
  2891. type name (which should be a keyword or something in your
  2892. dictionary).
  2893.  
  2894. Dictionary entries for functions and methods will contain the prototype
  2895. or equivalent. For all other kinds of terms, the dictionary entry will
  2896. consist of the complete C statement in which the term occurs in your
  2897. source code.
  2898.  
  2899. All variants of a particular term will be included as separate entries
  2900. in the dictionary. For example, if your source code contains the
  2901. definition of a function and also a prototype for the function, then
  2902. two entries for the function will be made in the dictionary. 
  2903.  
  2904. When EnterAct runs into conditional inclusion such as
  2905.  “#ifdef SomeThing ...  #else ...#endif”, it picks up definitions
  2906.  in the first part and ignores the "else" or "elif" sections. The
  2907.  parser also ignores anything inside the standard
  2908.  “#if 0 ... #endif” construction.
  2909.  
  2910. §    Building your dictionary
  2911. To exclude a file from being built into your dictionary, hold down
  2912. the <Command> key and click on the file's name in the project
  2913. window. The cursor will change to an 'X' while you do this, and
  2914. a dash '-' will appear to the left of the file name to show that it
  2915. is excluded.
  2916.  
  2917. If you are adding files from a list (via <Shift>Add Files...), you can
  2918. exclude a file from being built into the dictionary by placing an
  2919. exclamation mark at the beginning of its path name, eg to exclude
  2920. the file
  2921. ____
  2922.     HardDisk:Folder:src:George.cp
  2923. ____
  2924. add a '!' so it reads
  2925. ____
  2926.     !HardDisk:Folder:src:George.cp
  2927. ____
  2928.  
  2929. After you’ve added all your files to your project, select Update
  2930. Dictionary from the EnterAct menu. If the dictionary–builder stumbles
  2931. over a statement that’s too mangled to parse, you’ll see a message
  2932. explaining in general what the problem is. You’ll also be shown the
  2933. file in question, with the cursor placed at the position where the
  2934. error was detected. Generally, most problems reported will be
  2935. well–localised and fairly easy to fix—typical problems are lack of
  2936. balance for critical delimiters, and missing or very badly spelled
  2937. keywords. If you don’t see what the problem is, consult the “Dictionary
  2938. build problems” section of the “If there’s a problem” chapter.
  2939.  
  2940. EnterAct’s dictionary–builder will properly interpret a great many
  2941. first–draft errors, including missing semi–colons, lack of balance in
  2942. some delimiters (these vary according to context), slightly misspelled
  2943. keywords, and some others. Your source code should mostly make
  2944. sense, but it doesn't have to be perfect.
  2945.  
  2946. In a contrary sort of way, using EnterAct will almost certainly
  2947. reduce your first–draft errors. This is simply because you now have
  2948. instant access to all spellings and types of struct members, all
  2949. function and method calls, etc, so a major source of errors
  2950. is now gone.
  2951.  
  2952. §    Keeping it up to date
  2953. EnterAct does not update your dictionary automatically. Generally, you
  2954. should select Update Dictionary whenever you change or add something
  2955. that you’d like to have in the dictionary. Changes that take place
  2956. entirely within the body of a function will not affect what’s in your
  2957. dictionary. Any changes outside of a function body, including adding
  2958. a new function, adding or changing an enum constant or struct or class
  2959. member etc will be changes that you’d normally like to have reflected
  2960. in your dictionary.
  2961.  
  2962. Update Dictionary checks each file's modification time against the
  2963. time it was last updated by Enteract, so there is no need to "make"
  2964. an EnterAct project as a separate step.
  2965.  
  2966. Update For Front File Only will rebuild only that part of your
  2967. dictionary that is determined by the front text window. Unlike the
  2968. other two update commands, this is a “manual override”, and rebuilds
  2969. the dictionary for the front file whether or not it needs rebuilding.
  2970. Normally you won’t need to use this command, because a full update with
  2971. Update Dictionary for all changed files is almost always very quick.
  2972.  
  2973. There are two special cases in which you’ll probably want to rebuild
  2974. your entire dictionary:
  2975.     •     enabling the “Detect nested comment start” option (see “Option”
  2976.          chapter), after having done a dictionary update with this option
  2977.          disabled
  2978.     •    adding one or more new “macro’s to skip” (see the section on
  2979.         “All-or-nothing macro’s” in the “Source code restrictions chapter)
  2980.  
  2981. To completely rebuild your dictionary, hold down all three of the
  2982. <Shift>, <Option>, and <Command> keys while using the mouse to select
  2983. Update Dictionary (note the key equivalent doesn’t work with this
  2984. variation).
  2985.  
  2986. A small point, but worth noting: if you make a significant change to
  2987. a header file that’s #included in a great many source files, don’t be
  2988. reluctant to bring your dictionary up to date. EnterAct’s dictionary
  2989. builder only needs to scan changed files once, no matter how they are
  2990. #included. The dictionary update will take just a few seconds at most
  2991. (the tedious part, saving the new dictionary to disk, is done
  2992. transparently while you continue to work). For example, on a
  2993. relatively slow machine with a 68040 running at 25 Mhz, a typical
  2994. incremental update will take 5-10 seconds.
  2995.  
  2996.  
  2997. §    How long will it take?
  2998. Typically an update zips along at two to three files per second on a slow
  2999. 68040 machine once it gets going. There is a bit of overhead at the end
  3000. of an update while the browser is rebuilt, roughly three seconds.
  3001. Project dictionary saving is done transparently in the
  3002. background unless you close the project or Quit or issue some other
  3003. command that requires a fully-saved project. You can go back to editing,
  3004. looking things up, searching etc right after the last file is parsed.
  3005.  
  3006. On a Quadra 840 or faster, update speed is simply astonishing.
  3007.  
  3008. As mentioned above, all changed files including "h" files are scanned
  3009. only once during an update.
  3010.  
  3011. Your regular dictionary update will probably involve no more than
  3012. four files, and for this your total time "lost" will typically be under
  3013. under six seconds. On a Quadra 840, blink and you miss it.
  3014.  
  3015. If you need to interrupt the dictionary update, press
  3016. <Command><period>. This also interrupts multi–file searches, and
  3017. printing, and hAWK programs, by the way. You can finish the job off
  3018. properly later by reselecting your original dictionary update command.
  3019.  
  3020.  
  3021. §    Show Dictionary
  3022. (This command is not especially useful, since in practice most
  3023. dictionaries are very big, and you'll run out of memory.)
  3024.  
  3025. This command produces a “raw” dump of all the text in your dictionary,
  3026. consisting of all the definitions or declarations that the
  3027. dictionary–builder extracted from your code. At the top will be a
  3028. comment listing the number of definitions of each type. The entries
  3029. in the dictionary dump will be grouped together by file after a comment
  3030. giving the file name, and within each file will appear in the same
  3031. order as they occurred in the original file. You can use Save As if
  3032. you wish to save your raw dictionary.
  3033.  
  3034.  
  3035.  
  3036.  
  3037.  
  3038.  
  3039.  
  3040.  
  3041.  
  3042.  
  3043.  
  3044.  
  3045.  
  3046.  
  3047.  
  3048.  
  3049.  
  3050.  
  3051.  
  3052.  
  3053.  
  3054.  
  3055.  
  3056.  
  3057.  
  3058.  
  3059.  
  3060. -    -    -    -    -    -    -    -    -    -    -    -
  3061. Lookup
  3062. -    -    -    -    -    -    -    -    -    -    -    -
  3063. You can expect that better than 90% of your routine information needs
  3064. will be satisfied by the AutoLook window. For remaining needs, regular
  3065. lookup (press <Enter>) pulls up definitions of terms to separate
  3066. windows, and also works when your spelling is off but “distinctively
  3067. close”. And reverse lookup (<Shift><Enter>) shows definitions of
  3068. structs, unions, and typedefs that contain a particular member, again
  3069. in a separate window.
  3070.  
  3071. Please note that definitions of local variables appear only in the
  3072. AutoLook window, and if you want them in a separate window
  3073. you'll have to do the Copy New Paste thing.
  3074.  
  3075. Lookup and many other features (such as jumping to a definition) are
  3076. fully functional with first-draft code. All lookup windows, including
  3077. AutoLook, are fully editable, but can't be saved.
  3078.  
  3079. EnterAct's lookup features can be used to help out less "language
  3080. aware" editors. If you feel more comfortable working that way,
  3081. see the last section in this chapter (but read just below about
  3082. <Enter> for lookup, <Shift><Enter> for member lookup, and the
  3083. all-important AutoLook window first, please).
  3084.  
  3085. §    AutoLook
  3086. The AutoLook command calls up an automatic lookup window which
  3087. updates by itself to show dictionary entries as you type, edit, or
  3088. click around with the mouse. It will instantly retrieve and display a
  3089. definition for the words that lie just before your insertion point, or
  3090. within your current selection (which can be part of a larger
  3091. word). And it’s just as editable as a regular text window (Cut Copy
  3092. Replace etc), though you can’t save changes to it.
  3093.  
  3094. AutoLook is context-aware: it can determine if a name is a local
  3095. variable, and when dealing with members or methods it tries its
  3096. best to look in the appropriate inheritance chain. If you're in a
  3097. plain document rather than a source file, AutoLook still works,
  3098. but with less accuracy.
  3099.  
  3100. AutoLook can be used to look up a simple name, such as
  3101. "noErr": just click after the name and its definition will appear
  3102. instantly in the AutoLook window (for this one, you'd need to
  3103. add Mac Headers, or at least Types.h, to your project).
  3104.  
  3105. And AutoLook can be used to resolve a complicated "reference
  3106. chain". Taking a C example such as
  3107. ____
  3108.     mySFRPtr->sfFile.parID
  3109. ____
  3110. if you clicked after "parID" you would see in AutoLook that it
  3111. is a long member in an FSSpec; and if you clicked after "sfFile",
  3112. AutoLook would show that it is the FSSpec member in a
  3113. StandardFileReply struct. And if you clicked after "mySFRPtr"
  3114. in the function where I took this example, you would see that
  3115. it is a local variable of type "StandardFileReply    *", together
  3116. with the definition of a StandardFileReply. Actually, AutoLook
  3117. is much easier to use than to describe--try it! Just click after
  3118. any name of interest, anywhere.
  3119.  
  3120. Summary:
  3121.     • AutoLook shows definitions instantly for terms to the left
  3122. of your insertion point, or within your selection
  3123.     • If you're working inside a function in a source file, then the
  3124. AutoLook window will also display definitions for local variables.
  3125.     • If you're working within a method, lookup shown for members
  3126. and methods will be more accurate than if you're in a plain
  3127. document
  3128.     • Your spelling must be exact for most terms - if you don't see what
  3129. you expected, press the <Enter> key to look up a top-level term,
  3130. or <Shift><Enter> to look up a struct or class member (see below)
  3131.     • AutoLook shows supporting definitions for a name when
  3132. appropriate (eg if a name is a variable of type FSSpec, you'll
  3133. also be shown the definition of an FSSpec).
  3134.  
  3135. For another example, if there are entries in your current dictionary for
  3136. “Window”, “WindowData”, and “WindowDataPtr”, then all three entries
  3137. will appear in succesion in the AutoLook window as you type
  3138. “WindowDataPtr”. Selecting “Ptr” will call up the definition of “Ptr”,
  3139. whereas selecting (or clicking after) “contained within the
  3140. WindowDataPtr” will call up the definition of “WindowDataPtr”.
  3141. In both of these latter cases, the full definition of the "WindowData"
  3142. struct will appear in the AutoLook window.
  3143.  
  3144. If the definition of the word involves obvious typedefs,
  3145. #defines, or structs or unions, definitions for them will be appended to the
  3146. AutoLook display—for example, if you double-click on a global variable
  3147. gEvtDetails you won’t see just
  3148.     "EventDetails        gEvtDetails ;"
  3149. you’ll also see what an EventDetails thing is defined to be.
  3150.  
  3151.  
  3152.  
  3153.  
  3154.  
  3155.  
  3156.  
  3157.  
  3158.  
  3159.  
  3160.  
  3161.  
  3162.  
  3163.  
  3164.  
  3165.  
  3166.  
  3167.  
  3168.  
  3169.  
  3170.  
  3171. (as of v3.5, we skip the "middlemen", for example the typedef of
  3172. "EventDetails" above, if it adds nothing to comprehension)
  3173.  
  3174. As mentioned, the AutoLook window produces fast accurate lookup for
  3175. data members, when you're working in a method. Click after or
  3176. double-click on the data member's name, as usual, and the
  3177. declaration for the data member will appear in the AutoLook
  3178. window, followed by any supporting definitions -- eg "Thing
  3179. *dataMember;" would be followed by the definition of "Thing".
  3180. The AutoLook window will tell you which class
  3181. definition the declaration was found in, either the class that owns
  3182. the method you're working in, or any of the classes it inherits
  3183. from. This "data member" lookup for AutoLook is case-sensitive,
  3184. and the beginning of the name you're looking up must match the
  3185. beginning of the data member's name exactly, to speed things up
  3186. and cut down on spurious matches. If you're not working in a method
  3187. or your spelling is slightly off, AutoLook will still often take a stab
  3188. at showing you a definition, but it may just be guessing.
  3189.  
  3190. EnterAct's parser doesn't resolve overloaded method names, so you
  3191. may see more definitions than you want when you look up such a
  3192. name. A crack team of parser experts is hard at work on this, and
  3193. we expect to fully resolve overloaded names by early 2017.
  3194.  
  3195. §    Regular lookup (press <Enter>)
  3196. The AutoLook window changes as you work, doesn't always show all
  3197. variants, and works only with correct spelling. To produce a more
  3198. permanent display of a definition, or a display listing all variant
  3199. definitions of a name, or to pull up a definition for a name when
  3200. you’ve forgotten the correct spelling, press the <Enter> key. You can
  3201. either double-click on the name or type it in or click just to the
  3202. right of it, then press <Enter>.  As a special case, note that local
  3203. variables are not in your dictonary and so definitions for them will
  3204. show only in the AutoLook window. This may change in a future version.
  3205. Hey, the top of the function isn't that far away. To toggle between
  3206. your working position and the top of a function, use the "Go Back"
  3207. command, or mark both locations using the Locations menu.
  3208. To produce a more permanent display of a local definition,
  3209. you'll have to manually copy it to another window.
  3210.  
  3211. Lookup windows also provide a context for jumping to one of
  3212. several definitions for a term, as described in chapter 11,
  3213. "Seeing where a term is defined." In brief, to jump to a specific
  3214. definition for a term:
  3215.     • press <Enter> to look the term up to a separate lookup window
  3216.     • pick the one you want; either <Option>click in the lookup
  3217.         window's title bar, or keep pressing <Enter>
  3218.     • <Option>double-click on the term you want (for a two-part name
  3219.         such as "Class::method", do the double-click on one name and then
  3220.         drag to the other name before releasing the mouse).
  3221.  
  3222. Back to pushing the <Enter> key: definitions that match or come
  3223. closest to the term you’re looking up will be displayed in a new
  3224. “lookup” window. It looks like a regular text window, but the title
  3225. of the window will be the term you’re looking up, preceded by
  3226. two bullets (••). Text in the window can be edited (Cut Copy
  3227. Replace etc), but changes are temporary.
  3228.  
  3229. In the display box along the bottom of the window you will see the name
  3230. of the file from which the definition was taken, followed by a number
  3231. such as “1/4” indicating that the definition is the first of four
  3232. available in the window. This number can range from “1/1” to “1/60”.
  3233. In all lookup windows, to view other definitions:
  3234.  
  3235.     •    hold down the <Option> key (or the <Command> key)
  3236.     •    click-and-drag in the lookup window’s title bar
  3237.     •    select from the resulting popup menu describing the definitions.
  3238.  
  3239. Or, press the <Enter> key to view the next available definition,
  3240. <Option><Enter> to view the previous one.
  3241.  
  3242.  
  3243.  
  3244.  
  3245.  
  3246.  
  3247.  
  3248.  
  3249.  
  3250.  
  3251.  
  3252.  
  3253.  
  3254.  
  3255.  
  3256.  
  3257.  
  3258. (The display box is now on the left side)
  3259.  
  3260. (Double-clicking on “KeyDetails” and pressing the <Enter> key produced
  3261. the “••KeyDetails” lookup window. The cursor is caught in the act of
  3262. an <Option>click in the title bar of the lookup window.)
  3263.  
  3264. When your spelling is exact, the lookup window will contain all variant
  3265. definitions of the term. For example, there will often be a defining
  3266. instance and prototype for a function, and quite often a struct and
  3267. a typedef with the same name will exist.
  3268.  
  3269. Unlike AutoLook, regular lookup works even if your spelling is off.
  3270. There are no arcane rules to memorize concerning what to type if you
  3271. can’t remember the exact spelling of a term: just type your best guess.
  3272. Do use the correct case though, because regular lookup is
  3273. case-sensitive, the same as C itself. OK, regular lookup will compensate
  3274. instantly for a single case error, but otherwise it will start looking
  3275. for best matches through your whole dictionary, and this takes a
  3276. second or two.
  3277.  
  3278. If your spelling was off, the lookup window will hold definitions for
  3279. terms that best match what you typed, in order according to how well
  3280. they match. In this case, you control how many matches are available
  3281. in the lookup window (see “Number of entries per lookup” later in this
  3282. chapter, it's a field in the Options dialog).
  3283.  
  3284. When your spelling is incorrect, EnterAct first checks for common
  3285. errors such as full spelling when an abbreviation is needed, use of
  3286. a common synonym, permutations, and single case errors. Up to this
  3287. point, regular lookup is instant. If no match is yet found, EnterAct
  3288. then checks all entries in your dictionary and locates the ones that
  3289. best match what you typed, based on runs of matching characters. This
  3290. phase may take several seconds, but is still much faster and easier
  3291. than searching through files yourself. Very much faster.
  3292.  
  3293. As each definition appears in a lookup window, a selection is made for
  3294. you. For functions, the function name and parameter list are selected,
  3295. and for all other terms the name of the term itself is selected.
  3296.  
  3297. Here’s a general example illustrating typical use of regular lookup:
  3298.     •    you type the name of a function in one of your working windows, but
  3299.         the AutoLook window doesn’t change: this means your spelling was off
  3300.     •    press the <Enter> key, and a lookup window appears, holding several
  3301.         definitions that come closest to your spelling
  3302.     •    the first one shown isn’t the one you wanted: press <Enter>
  3303.         repeatedly to advance through the definitions. Normally the one you
  3304.         want will be among the first three. Or, hold down the <Option>
  3305.         or <Command> key and click-and-drag in the title bar to pick
  3306.         from a popup menu of alternates
  3307.     •    viewing the function you want, use Paste Selection Behind to copy
  3308.         the function name and parameters which have been selected for you,
  3309.         return to your working window, and paste the function name (now
  3310.         correctly spelled) and parameter list over your guess—all in one step.
  3311.  
  3312. §    <Enter> for lookup, advancing, scrolling
  3313. Pressing the <Enter> key in a normal text window means “look this up”,
  3314. but in a lookup window it can also mean “advance to the next
  3315. definition”. The different behavior corresponds to your intent. Here
  3316. are the rules for <Enter> in a lookup window:
  3317.     •    to look up a name shown in a lookup window definition, double-click
  3318.         on it or click after it or type it in and press <Enter>. This is the
  3319.         same as in a regular text window.
  3320.     •    to cycle to the next definition; if you haven’t altered the default
  3321.         selection made for you in the lookup window, press <Enter>. If you have
  3322.         altered the selection, use Select All before pressing <Enter>. If your
  3323.         selection is so large that it couldn’t represent a word to be looked
  3324.         up, or if it agrees with the name of the definition already being shown
  3325.         in the lookup window, EnterAct will cycle you to the next definition.
  3326.  
  3327. The same rules apply to <Option><Enter>, which takes you back to the
  3328. preceding definition in a lookup window, but also does “sounds like”
  3329. lookup as described as few sections ahead.
  3330.  
  3331. By the way, using the <Enter> key to just scroll the top-left of your
  3332. selection into view or to toggle between showing the top and bottom
  3333. portion of a large selection still works, the same as in ordinary
  3334. editors. Once again, it comes down to your intent: try the <Enter> key
  3335. out to do lookup, advancing through definitions, and scrolling your
  3336. selection and you should quickly find that you can treat it as a “Do
  3337. What I Mean” button. On the rare occasion when it doesn't do what
  3338. you mean, whack it twice quickly. That'll teach it.
  3339.  
  3340. §    Looking up the clip (press <Command><Enter>)
  3341. To look up the last word on the clipboard, hold down the <Command> key
  3342. while pressing <Enter>. EnterAct’s private clipboard is updated when
  3343. you switch in and out. So to look up a term encountered while using
  3344. some other editor:
  3345.     •    Copy just the term
  3346.     •    switch to EnterAct (an appropriate project with built dictionary
  3347.         should be open)
  3348.     •    hit <Command><Enter>
  3349.  
  3350. A lookup window will appear after you press the <Enter> key, showing
  3351. the dictionary entry that best matches what you typed, or those that
  3352. come closest if your spelling erred, just as if you typed the word in
  3353. a text window and pressed <Enter>.
  3354.     
  3355.     OR just leave your AutoLook window in front -- when you return
  3356.         to EnterAct, the AutoLook window will automatically display
  3357.         whatever info it can for the last word on the clipboard. This
  3358.         lets you use EnterAct as a high-speed lookup helper when
  3359.         you're working mainly with some other editor. Just arrange
  3360.         your windows so that you can see the AutoLook window when
  3361.         you're in the other editor, then having a definition in view is
  3362.         as easy as Copy, click on the AutoLook window, click on your
  3363.         other editor's window. 
  3364.  
  3365.  
  3366. §    Reverse lookup (press <Shift><Enter>)
  3367. To retrieve all struct, typedef, and union definitions that contain
  3368. a word or phrase, select the word or phrase, or click after just a
  3369. single word, and press <Shift><Enter>. Reverse lookup is not
  3370. case-sensitive, but otherwise your spelling must be exact. It’s very
  3371. fast, though not instant.
  3372.  
  3373. Results are shown in a lookup window, and you can view the different
  3374. definitions either by pressing <Enter> to advance to the next
  3375. definition, <Option><Enter> to view the previous one, or by
  3376. <Option>clicking in the lookup window’s title bar.
  3377.  
  3378. Here’s the lookup window that results from typing ParamBlockHeader and
  3379. pressing <Shift><Enter>, with the dictionary containing most toolbox
  3380. headers:
  3381.  
  3382.  
  3383.  
  3384.  
  3385.  
  3386.  
  3387.  
  3388.  
  3389.  
  3390.  
  3391.  
  3392.  
  3393.  
  3394.  
  3395.  
  3396.  
  3397.  
  3398.  
  3399.  
  3400. (<Option>click in the title bar for the popup listing definitions in
  3401. any lookup window. “PARAMBLOCKHEADERS” would work just
  3402. as well as “ParamBlockHeader”, and “paramblockh”
  3403. would have produced similar results, perhaps with a few more
  3404. definitions shown.)
  3405.  
  3406. Reverse lookup works with a single word or a phrase up to 255
  3407. characters, and just looks for a match in struct, union and typedef
  3408. definitions regardless of where the text occurs. The most common use
  3409. is to look up a member name, but you can also use it to look up a
  3410. distinctive word or phrase in a comment that you recall seeing, perhaps
  3411. in one of your own “popup notes”, as described in “Looking up your
  3412. notes” later in this chapter.
  3413.  
  3414. As of version 3 of EnterAct, the text you're looking up must begin
  3415. with the start of a word for reverse lookup, but need not end with
  3416. a complete word.
  3417.  
  3418. §    “Sounds like” lookup (press <Option><Enter>)
  3419. When you can’t remember what case conventions were used for a name,
  3420. or your recollection of the spelling is very very vague, type in your
  3421. best guess and try <Option><Enter> instead of just plain <Enter>. This
  3422. activates “sounds like” or “phonetic” rather than regular lookup. Upper
  3423. and lower case are treated as the same, vowels are used to determine
  3424. what the surrounding consonants sound like, and consonants are
  3425. converted to standard phonetic equivalents in your guess. This “boiled
  3426. down” version of your guess is then compared with similarly boiled-down
  3427. versions of all names in your dictionary, and you will be shown the
  3428. definitions of the ones that come closest in the resulting lookup
  3429. window.
  3430.  
  3431. The different definitions available can be viewed in the same way as
  3432. with regular lookup windows: use <Enter> and <Option><Enter> to cycle
  3433. forwards and back, or <Option>click in the title bar and choose from
  3434. the popup menu.
  3435.  
  3436. Sounds-like lookup should be kept in mind as an “emergency backup”,
  3437. worth trying if regular lookup doesn’t bring up the definition you want
  3438.  
  3439. As an example, suppose you’re after the definition of ParamBlockHeader,
  3440. but misremember it as PARAMHEAD. Regular plain-<Enter> lookup would
  3441. fail in this case, since it is case-sensitive. Pressing <Option><Enter>
  3442. would work, but might also call up spurious matches (who knows what,
  3443. perhaps kPrimeHidden) since it largely ignores vowels. On the other
  3444. hand, if you misremember CopyFile as KoppeePheill then sounds-like
  3445. lookup will work, and I imagine you won’t be complaining about the few
  3446. extra spurious matches that it throws up.
  3447.  
  3448.  
  3449. §    Viewing other entries in lookup windows
  3450. <Enter> and <Option><Enter> take you forwards and backwards through
  3451. the different definitions available in any lookup window, as described
  3452. in the section “<Enter> for lookup, advancing, scrolling” a couple of
  3453. pages back.
  3454.  
  3455. For a quick overview of all entries in the lookup window, hold down
  3456. the <Option> or <Command> key and click (and drag) in the lookup
  3457. window’s title bar. A popup menu will appear, listing the first line
  3458. from each entry (or at least a good part of it), and you can go to the
  3459. entry by selecting it from the menu.
  3460.  
  3461. The first letter in each menu item indicates the type of the entry ('v’
  3462. for variable, ‘(’ for function, ‘#’ for define etc). For details, see
  3463. “Hints with lookup” below.
  3464.  
  3465. (<Option>click-and-drag in the title bar)
  3466.  
  3467.  
  3468.  
  3469.  
  3470.  
  3471.  
  3472.  
  3473. §    For faster lookup
  3474. If lookup on average takes longer than you’re willing to wait when your
  3475. spelling is off, the simplest cure is to trim unneeded files from your
  3476. project, thus reducing the size of your dictionary. See “Project memory
  3477. needs” in the “Projects” chapter for a guide to trimming files, and
  3478. also the document “EnterAct memory needs”. Regular lookup for exact
  3479. spelling is always instant, and reverse lookup nearly so.
  3480.  
  3481.  
  3482. §    Hints with lookup
  3483. When you type in a name and press <Enter>, you know what “kind of
  3484. thing” you want, but EnterAct doesn’t. Supplying EnterAct with a quick
  3485. hint will help speed up the lookup if your spelling doesn’t match an
  3486. entry, and it will in all cases limit the entries that are retrieved
  3487. to the type that you specify with the hint.
  3488.  
  3489. A hint for lookup consists of one character added after the name you
  3490. wish looked up. Normally you’ll need to first type a space and then
  3491. the one–character hint, to separate it from the name. However, the hint
  3492. for a function “(” and the hint for a #define “#” can’t be part of any
  3493. name, so the space is optional for these two.
  3494.  
  3495. Here are the hints you can supply, with examples: in all cases you
  3496. should select an insertion point just to the right of the hint just
  3497. before pressing <Enter> so that EnterAct can pick up the hint
  3498. correctly, or select the word and the hint. For all except the function
  3499. and #define hints, a bit of space (blanks or tabs) between the name
  3500. and the hint is necessary.
  3501.  
  3502. ____
  3503. Type                            Hint     Example
  3504. ----                         ----     -------
  3505. function, method      (          SomeFunc(
  3506. struct, class            s          MyStruct s
  3507. variable                   v          globalVar7 v
  3508. #define                   #          BIGNUM#
  3509. union                       u           IntOrFloat u
  3510. enum                        e          ErrorCodes e
  3511. enum constant         c           eNoMemory c
  3512. typedef                        t          MyStruct t
  3513. ____
  3514.  
  3515. In the display box of a lookup window you will see one of the above
  3516. hints for each entry, between the file name and the current entry
  3517. number. This is just to remind you that EnterAct keeps track of what
  3518. kind of thing each term is, and that it will understand the above hints
  3519. if you supply them.
  3520.  
  3521. When should you supply a hint? Almost never. Perhaps when you have a
  3522. struct, a typedef, and a variable that have very similar names, you
  3523. don’t remember the exact spelling, and you want just one of them
  3524. without the nuisance of the others. Since flipping through lookup
  3525. entries is as fast as pressing the <Enter> key once the lookup appears,
  3526. the only common reason to supply a hint is to speed up the lookup
  3527. process itself. But in this case you should first try trimming
  3528. unnecessary files from your project, as this will also speed things
  3529. up by reducing the size of your dictionary.
  3530.  
  3531. §    Number of lookup windows
  3532. With too many lookup windows on–screen at once, your screen will be
  3533. too cluttered. If too few are available, that will hamper you when you
  3534. have a complicated problem to wrestle with. The upshot is that the
  3535. maximum number of lookup windows on–screen at once must be under your
  3536. control, so you can vary this number as the situation demands. You can
  3537. change this number at any time by typing a new number in the “Number
  3538. of lookup windows” box in the Options dialog. The default number is
  3539. 4, but you can vary it from 1 to 10.
  3540.  
  3541.  
  3542.  
  3543.  
  3544.  
  3545.  
  3546.  
  3547.  
  3548.  
  3549.  
  3550.  
  3551.  
  3552.  
  3553.  
  3554.  
  3555.  
  3556.  
  3557.  
  3558.  
  3559.  
  3560.  
  3561. The “Number of lookup windows” includes any that you mark for keeping
  3562. around, and determines when a lookup window that is not marked for
  3563. keeping around will quietly go away on its own. When you press <Enter>
  3564. to see a new lookup and the lookup window limit has already been
  3565. reached, one of the old lookup windows that was not marked for keeping
  3566. around will quietly go away, and the new one will replace it. There’s
  3567. no predicting which one, so if you want a lookup window to stay up
  3568. until you explicitly close it, select Keep Lookup Around while it is
  3569. the front window ( see “Keeping lookups around” below for details).
  3570.  
  3571.  
  3572. §    Number of entries per lookup
  3573. When your spelling doesn‘t match any term in your dictionary exactly,
  3574. the number of entries that are retrieved in the lookup window is under
  3575. your control. To change this number, select Options and type a new
  3576. number in the “Number of entries per lookup window” box. The default
  3577. of 4 suits most cases, but you may prefer 3 or 5. The maximum of 20
  3578. entries is useful only when your recollection of the correct spelling
  3579. has gone right out the window.
  3580.  
  3581. §    Keeping lookups around
  3582. The command for this is under the Windows menu. When you select Keep
  3583. Lookup Around with a lookup window in front, the lookup will be marked
  3584. for keeping around, which is to say it won’t close unless you close
  3585. it yourself. Other lookups not marked for keeping around may quietly
  3586. close when you ask for a new lookup after having hit the limit on the
  3587. number of lookup windows on–screen at one time.
  3588.  
  3589. When you select Keep Lookup Around for a lookup window, the beginning
  3590. of the window title will change from •• to ¶¶ to show you that it is
  3591. marked for keeping. A ¶ is a Paragraph mark, which starts with P, and
  3592. that stands for Permanent.
  3593.  
  3594.  
  3595.  
  3596.  
  3597.  
  3598.  
  3599.  
  3600. A lookup window marked for keeping will close only if you select Close
  3601. or Close All, or close the project, or leave EnterAct. In other words,
  3602. it’s as permanent as a regular text window.
  3603.  
  3604.  
  3605. Since the AutoLook window changes so often, if you want to preserve
  3606. an entry you should look it up in the usual way, by double-clicking
  3607. on or clicking just to the right of the word (or partial word) and
  3608. pressing the <Enter> key. You can do the lookup right in the AutoLook
  3609. window if you wish.
  3610.  
  3611. After you’ve used the AutoLook window for a bit, it serves as a
  3612. spelling checker for top-level C terms. If you don’t detect a slight
  3613. flicker in the AutoLook window out of the corner of your eye when you
  3614. type the name of a term that should be in your dictionary, take a
  3615. glance at the AutoLook window—if the definition or prototype isn’t
  3616. there, you have a spelling error.
  3617.  
  3618.  
  3619. §    Looking up your notes
  3620. Here’s how to build your own hard–won notes and observations about
  3621. programming the Macintosh into your dictionary, for quick retrieval
  3622. by name. You might call them “popup” notes, but as you’ll see, they’re
  3623. just a variation on looking up C terms and the notes appear in the
  3624. AutoLook window or a regular lookup window.
  3625.  
  3626. Note files consist of fake C constructs, the sole content of each
  3627. construct being a comment which contains the specific note. Suppose,
  3628. for example, one of your notes concerns the modification date
  3629. (“modDate”) for a file. To be able to retrieve the note, you first need
  3630. to think of a memorable name for it, such as “modDateNote”. Then, in
  3631. your note file, you would set up the dictionary entry like this:
  3632. ____
  3633. struct modDateNote
  3634.     {
  3635.     /*
  3636.     Paste the note in here, within a comment
  3637.     that makes up the entire "struct" body.
  3638.     */
  3639.     };
  3640. ____
  3641. The note goes inside a comment, which makes up the body of a struct.
  3642. Placing the note inside a comment is necessary, to prevent the
  3643. dictionary builder from trying to interpret your text as C code. There
  3644. are other constructs you can use, such as
  3645. ____
  3646.     #define modDateNote /*
  3647.      Paste the note in here, within a comment
  3648.      that makes up the entire "define" body.
  3649.     */
  3650. or
  3651.     int modDateNote /* your note here
  3652.         in a comment */;
  3653. ____
  3654. but a struct is definitely the best, since reverse lookup can then be
  3655. used to retrieve a note based on some distinctive word or phrase that
  3656. it contains.
  3657.  
  3658. Since notes are always placed inside C comments, you should avoid C
  3659. comment starts and ends (/* and */) within the note itself.
  3660.  
  3661. It remains only to persuade EnterAct to build such a file into your
  3662. dictionary. EnterAct will do so for files that are in the left or
  3663. middle pane of your project, and by default if a file name ends in “.c”
  3664. or “.h” etc it is added to the left or middle pane respectively. However,
  3665. a slightly nicer approach is to give your note files an ending that
  3666. describes what they are. A reasonable choice would be “Notes”, and then
  3667. your note files would have names like “File.Notes”, “Memory.Notes”,
  3668. “Interface.Notes”. To instruct EnterAct that files with names ending
  3669. in “Notes” should go in the left or middle pane, select the File
  3670. Extensions command and type in the file extension (eg “Notes”) that
  3671. you choose for your note files—see the “Custom file extensions” section
  3672. in the “Projects” chapter for an example. Which pane these files go
  3673. in (left or middle) is up to you. Using a custom extension rather than
  3674. the default “.c” or “.h” for your note files will also help prevent
  3675. confusion if other people examine your work.
  3676.  
  3677. Now add the note files to your project, select Update Dictionary, and
  3678. you can retrieve any note to the AutoLook window by typing its name
  3679. in any text window, and pressing <Enter> will place the note in a
  3680. separate new lookup window. If the name of the note consists of the
  3681. exact topic followed by “Note” then it will be easy to remember. And
  3682. if you place a comment in your source code containing the name of the
  3683. note, such as     /* see modDateNote */ 
  3684.  
  3685. then all you have to do is double-click on the note name (and press
  3686. <Enter> if you want a more permanent view than the one shown in the
  3687. AutoLook window).
  3688.  
  3689. A note can be of any length, and if you edit it heavily you can
  3690. probably clean up the appearance afterwards with Reformat Selection.
  3691.  
  3692. For an example of a note file, see the file “hAWK_notes.h” on disk 2.
  3693. As a specific example,
  3694. ____
  3695.     if ((**availRgn).rgnSize > 10) /* see RegionNote */
  3696.         {
  3697.         yPos = 5;
  3698.         y = *(((int *)(*availRgn)) + yPos);
  3699.         while (y != 32767)
  3700.             {
  3701.             xPos = yPos + 1;
  3702.             ...etc
  3703. ____
  3704. might look like Greek to me if I come back to review it, but by
  3705. clicking to the right of RegionNote  in the comment and pressing
  3706. <Enter> I can view my hard–won note on regions that explains in detail
  3707. what’s going on:
  3708.  
  3709.  
  3710.  
  3711.  
  3712.  
  3713.  
  3714.  
  3715.  
  3716.  
  3717.  
  3718.  
  3719.  
  3720.  
  3721.  
  3722.  
  3723.  
  3724.  
  3725.  
  3726. Often it’s simpler to just place a “go to” link in your code
  3727. (consisting of a file name followed by a marker name, as detailed in
  3728. the “‘Go’ commands” chapter). “Go to” links have two advantages over
  3729. popup notes: any text in any document, including support documents,
  3730. can be marked for use a link, and the text at the link can include
  3731. illustrations. But “popup” notes as described above have two advantages
  3732. over “go to” links: they appear in politely placed and sized windows,
  3733. as do all lookup windows, and you can view several notes from the same
  3734. file in separate windows. A mix of “Go to” links to access existing
  3735. or complex documents, and popup notes to retrieve details on specific
  3736. programming tasks might be best.
  3737.  
  3738. §    EnterAct as a "definition finder" for other editors
  3739. To use EnterAct as a "definition finder" with other editors:
  3740.     •    read enough here to learn how to create a project, build
  3741.     a dictionary, and show the "AutoLook" window. Knowing
  3742.     how to call up "lookup" windows by pressing the <Enter>
  3743.     key is also useful.  That's all above here.
  3744.     •    when you're using the other editor, also run an EnterAct
  3745.     project with contents roughly corresponding to the code
  3746.     you're working on - have the "AutoLook" window open,
  3747.     as the frontmost text window in EnterAct. Your project
  3748.     dictionary should be reasonably up to date.
  3749.     •    to look up a term with EnterAct; Copy it in the other editor,
  3750.     and switch to EnterAct. If you don't immediately see the
  3751.     definition in the AutoLook window (rare), press
  3752.     <Command><Enter>. To look up the class or struct that
  3753.     contains a particular member, press <Shift><Command><Enter>.
  3754.  
  3755. §    Looking it up with THINK Reference or Toolbox Assistant
  3756. You'll see "Find in THINK Reference" and "Find in Toolbox Assistant"
  3757. under EnterAct's Search menu: to get them working, create a folder
  3758. named "Tools" or "(Tools)" next to EnterAct at the same level, and
  3759. drop aliases of THINK Reference and QuickView into it. When you
  3760. want to look something up, either select a term or click just after
  3761. it and issue the appropriate menu command (the command key
  3762. equivalents <Command><-> and <Command><4> are worth memorizing).
  3763.  
  3764.  
  3765. -    -    -    -    -    -    -    -    -    -    -    -
  3766. Seeing where a term is defined
  3767. -    -    -    -    -    -    -    -    -    -    -    -
  3768. §    <Option>double–click
  3769. To see the file in which any dictionary term is defined, hold down the
  3770. <Option> key while double–clicking on the term. EnterAct will enter
  3771. the term in the Find dialog (the equivalent of Enter Selection), open
  3772. the file where the term is defined, and scroll to the first instance
  3773. of the term in the file.
  3774.  
  3775. Except for functions, methods, structs, classes, unions, and enums,
  3776. for which you’ll almost always be scrolled to the exact defining
  3777. instance, with no tripping over a mention in a comment or variable
  3778. declaration or prototype.
  3779.  
  3780. (Note you can look up the definition of a full method name, in the
  3781. format "class_name::method_name", by <Option>double-clicking
  3782. on the class name, dragging over to the method name to select it
  3783. as well, and then releasing the mouse. Or if you prefer you can
  3784. look it up by selecting both names and then using the Find
  3785. Definition command.)
  3786.  
  3787. Here's an example of looking up a class definition:
  3788.  
  3789.  
  3790.  
  3791.  
  3792.  
  3793.  
  3794.  
  3795.  
  3796.  
  3797.  
  3798.  
  3799.  
  3800.  
  3801.  
  3802.  
  3803.  
  3804.  
  3805.  
  3806.  
  3807.  
  3808.  
  3809.  
  3810.  
  3811.  
  3812.  
  3813.  
  3814.  
  3815.  
  3816. If you are viewing just a method name, without the class name:
  3817.     •    bring up your AutoLook window (you'll find it's useful all the
  3818.         time)
  3819.     •    click after or double-click on the method name in your source
  3820.         window
  3821.     •    AutoLook will show a complete list of prototypes for the method
  3822.         name
  3823.     •    select the one you want, class name and method name inclusive,
  3824.         in the AutoLook window and use Find Definition
  3825.     •    or <Option>double-click on the class name, drag to the method
  3826.         name, and release the mouse
  3827.  
  3828. For example, to view the definition of "DoSpecificCommand" in
  3829. the class "TFaxPage", when viewing just
  3830. "someObject->DoSpecificCommand(1,2)", you would click just
  3831. after "DoSpecificCommand" to see the following in the
  3832. AutoLook window:
  3833. ____
  3834.     OSErr TFaxDocument :: DoSpecificCommand
  3835.         (short     stdCommandNumber,
  3836.         long    misc)
  3837.         
  3838.     OSErr TFaxEdit :: DoSpecificCommand
  3839.         (short     stdCommandNumber,
  3840.         long    misc)
  3841.         
  3842.     OSErr TFaxPage :: DoSpecificCommand
  3843.         (short     stdCommandNumber,
  3844.         long     misc)
  3845. ____
  3846. --then select "TFaxPage :: DoSpecificCommand", and use the
  3847. Find Definition command to jump to the definition. Or <Option>
  3848. double-click on one of the words, drag to the other, and release
  3849. the mouse.
  3850.  
  3851. If your spelling of the method name is off, and nothing shows in the
  3852. AutoLook window, click just after your guess at the name and press
  3853. <Enter>. If your guess was close enough, the resulting lookup window
  3854. will hold entries for all methods with the correct name. Hold down
  3855. the <Option> key and click in the title bar of the lookup window to
  3856. view a list of the methods -- if you see the right one, select it,
  3857. and your desired one will appear in the body of the lookup window,
  3858. where you can <Option>double-click or use Find Definition.
  3859.  
  3860. §    Find Definition
  3861. Find Definition is useful with parts of a word (such as just the
  3862. WindowData  part of WindowDataPtr )—just select the exact term you want
  3863. to view the defining instance of, without regard for what comes before
  3864. or after it.
  3865.  
  3866. Find Definition ignores trailing spaces or tabs, and also accepts hint
  3867. characters in much the way that lookup does—see just below.
  3868.  
  3869.  
  3870. §    If there are multiple definitions
  3871. If you have several methods with the same name, use the
  3872. AutoLook window to pick the right one as described just above.
  3873.  
  3874. In the general case, you can jump to a particular definition of a
  3875. term as follows:
  3876.     •    select the term or click after it, and press <Enter> to look it up
  3877.     •    in the resulting lookup window, hold down the <Option> key and
  3878.         click in the window's title bar to view a popup menu listing all the
  3879.         definitions and abbreviated full path names for their locations
  3880.     •    pick the one you want, then <Option>double-click on the term
  3881.         as shown in the lookup window.
  3882.  
  3883. If the term is a static function or variable and you happen to be
  3884. viewing the file where it is defined, then <Option>double-clicking
  3885. on the name anywhere in that file will take you to the definition
  3886. in that same file.
  3887.  
  3888. Note if you want a list of all definitions of a term, the simplest
  3889. way is still to do a batch Find, then trim the results.
  3890.  
  3891. §    Other ways of finding definitions
  3892. The AutoLook window will display definitions instantly when you select
  3893. or click after a term, greatly reducing the need to “find” definitions.
  3894. It will also show most class method definitions, and definitions for
  3895. data members (these details are subject to last-minute improvements,
  3896. and by the way it may take a couple of seconds even on a fast machine
  3897. for a data member's class definition to show up in the AutoLook window
  3898. --if you're after the owning class for a member, take a break for a
  3899. few seconds to see if anything shows up in the AutoLook window,
  3900. since it won't go looking if you keep working).
  3901. And of course you can retrieve the definition of a term to a separate
  3902. lookup window by clicking after the term and pressing the <Enter> key.
  3903.  
  3904. “Go to” links, as explained in the “‘Go’ command” chapter, can be used
  3905. to jump to any marked location in any file. This includes function and
  3906. method definitions  if you are using Automark to mark your source files
  3907. in the default way.
  3908.  
  3909. The "Cross-Reference" index command (chapter 22) can generate a
  3910. cross-reference of C terms in your source code that is compatible
  3911. with EnterAct’s "Go to" command. These “file-name line-number”
  3912. references can go out of date if you edit your files, but are handy
  3913. for files that don’t change often.
  3914.  
  3915. -    -    -    -    -    -    -    -    -    -    -    -
  3916. Browsing
  3917. -    -    -    -    -    -    -    -    -    -    -    -
  3918. §    The Browse command
  3919. The window produced by this command shows a “family tree” of the
  3920. classes in your project, as of your last dictionary update, and also
  3921. allows you to quickly view any class or method definition. It will
  3922. close when you close your project, and will update automatically when
  3923. you update your project dictionary.
  3924.  
  3925. The solid black horizontal and vertical lines connect each child to
  3926. the first of its parents. If a class inherits from multiple parents,
  3927. light colored lines connect the middle of each parent to the left or
  3928. right end of each child. For example, given
  3929. ____
  3930.     class A : B, C, D {...
  3931. ____
  3932. you would find in the browser window a set of solid horizontal and
  3933. vertical lines connecting A to B, and light colored lines would connect
  3934. the middles of C and D to the left or right end of A.
  3935.  
  3936. If a class contains other classes or structs as members, they will
  3937. be listed beneath the class name, separated from it by a white line.
  3938.  
  3939. To view the definition of a class, double–click on the class name. This
  3940. works much like <Option>double-click or Find Definition in a text
  3941. window. This works with both a "main" class name and any of its
  3942. member class or struct names.
  3943.  
  3944. To view a method definition, click and hold on the owning class name:
  3945. after a brief pause (your double–click time, actually) a popup menu
  3946. will appear listing all of the class’s methods. You should then select
  3947. the method you want and release the mouse button, as if you hadn’t
  3948. guessed. This also works with member class names (as of this
  3949. writing, it's untested with member struct names.)
  3950.  
  3951. To view a popup of all methods in a class AND all methods that
  3952. it inherits, hold down the <Command> key and click and hold on
  3953. the class name. This list can be quite long, and may take several
  3954. seconds to generate--please be patient the first few times you
  3955. try it. Inherited private methods are not shown, and virtual methods
  3956. are indicated with a "v" before the name.
  3957.  
  3958. If your family tree of classes involves a great deal of multiple
  3959. inheritance, the many light colored lines may become too tangled to
  3960. decipher, and even obscure class names. To display just the colored
  3961. inheritance lines for one class, click once on the class name (all
  3962. colored lines not connecting to the class will disappear). To add
  3963. lines for other classes, click on the class names with the <Shift>
  3964. key held down. Similarly, you can suppress the colored lines for one
  3965. class by <Shift>clicking on it. To show all colored lines again, click
  3966. once on the white background between classes. Double-clicking to
  3967. show a class definition does not suppress any colored lines, and neither
  3968. does the click-and-hold to view a method popup.
  3969.  
  3970. Instead of trying to follow the colored lines, you can view the parents
  3971. of a main class by holding down the <Option> key and
  3972. clicking on its name to view a popup of mom and pop etc. Note that
  3973. releasing the mouse over one of the parents will take you to its
  3974. definition, a feature I included mainly because a popup is supposed
  3975. to do something.
  3976.  
  3977. Classes without proper parents (orphans, if you like) will always
  3978. appear in the left–most column of your browser window. A quick look
  3979. down the left column will reveal whether you have any unintentional
  3980. orphans, perhaps due to misspelling the parent class name in the class
  3981. definition. 
  3982.  
  3983.  
  3984.  
  3985.  
  3986.  
  3987.  
  3988.  
  3989.  
  3990.  
  3991.  
  3992.  
  3993.  
  3994.  
  3995.  
  3996.  
  3997.  
  3998.  
  3999.  
  4000.  
  4001.  
  4002. (Note EnterAct works fine with CodeWarrior etc classes, for which
  4003. there may be many base classes in the leftmost column.)
  4004.  
  4005. §    Finding classes in the Browser window
  4006. To bring a particular class into view, type the first part or some
  4007. distinctive part of its name. The name will flash once.
  4008.  
  4009. §    Method and class popups
  4010. (This is a summary of popups, as described above)
  4011.     • to view the methods associated with a class, click and hold
  4012.     on the class name.
  4013.     • to view all inherited methods as well, hold down the <Command>
  4014.     key while you click and hold on the class name. If the list is
  4015.     gigantic, it may take several seconds to generate the popup, so
  4016.     please be patient the first few times you try this.
  4017.     • to view a list of the immediate parents of a class, hold down
  4018.     the <Option> key while you click and hold on the class name.
  4019.  
  4020. §    Browsing classes without the browser
  4021. Nothing new to seeing class definitions—click to the right of the class
  4022. name and press <Enter>, or just look in the AutoLook window.
  4023. You will typically find the class name of an object as the first name
  4024. in the statement where it is defined, as in
  4025. ____
  4026.     TClassName        *objectName;
  4027. ____
  4028. You can also, of course, look up a class by typing the name and
  4029. pressing <Enter>, and in all cases your spelling just needs to be
  4030. reasonably close, not exact. In either case, the definition will appear
  4031. in the AutoLook window if you have it open.
  4032.  
  4033. To view the definition of a class when looking at one of the class
  4034. methods, see the section below.
  4035.  
  4036.  
  4037. §    Browsing methods without the browser
  4038. (The approach below is for use when your spelling of a method
  4039. name is incorrect. If your spelling is correct, you will see
  4040. the appropriate prototype in the AutoLook window when you
  4041. click after or double-click on the method name. To go to the
  4042. definition, select the full "class_name::method_name" in the
  4043. AutoLook window, then use the Find Definition command, or
  4044. <Option>double-click, dragging to select both names before
  4045. releasing the mouse.)
  4046.  
  4047. Method browsing is a bit trickier, since if you have something like
  4048. ____
  4049.     "currentObject->Draw();"
  4050. ____
  4051. and there are several different classes with Draw() methods, then
  4052. EnterAct does not know specifically which Draw() method you want. If
  4053. there is only one method in your project with a given name, then the
  4054. lookup window will contain just one entry, but if there are several
  4055. then the lookup window will contain all of them (up to a maximum of
  4056. 60). For example, if you were to press <Enter> with an insertion point
  4057. to the right of Draw above, then the lookup window might contain
  4058. entries for void Circle::Draw(), void Square:: Draw(), void
  4059. Oval::Draw() and so on. When there are several entries like this, you
  4060. can cycle through them by pressing the <Enter> key, and back up by
  4061. pressing <Option><Enter>. There are some illustrations of this just
  4062. ahead.
  4063.  
  4064. This raises the question of how to find where a method is defined. The
  4065. general approach is described in the chapter “Seeing where a term is
  4066. defined”, but the approach for a method has one extra step:
  4067.     •    click after the method name, and a list of all methods with that
  4068.         name will appear in the AutoLook window;
  4069.         or, press <Enter> and cycle through the lookup window until
  4070.         you find the method you want, based on the name of the owning class
  4071.     •    then select the entire name, consisting of the owning class name,
  4072.         the two colons, and the method name, in general
  4073.         className::methodName
  4074.     •    and then select Find Definition.
  4075.     •    (or <Option>double-click, ya ya you know already)
  4076.  
  4077. There is one exception to this: if there is only one method in your
  4078. project with the name in question, then a standard <Option>
  4079. double–click on just the method name will jump you to the file where
  4080. that method is defined. However, if there are several methods with the
  4081. same name  in different classes, there’s no predicting which definition
  4082. you will see if you just <Option> double–click on the method name—best
  4083. to look up the method first, and use Find Definition on the full name
  4084. of the exact one you want.
  4085.  
  4086. By the way, when viewing the full “className:: methodName” of a method,
  4087. you can look up the definition of the owning class of the method by
  4088. clicking at the right end of the class name, before the colons, and
  4089. pressing <Enter>. If the instance of the method name you’re viewing
  4090. doesn’t have the class name attached, look up the method name as
  4091. decribed just above to see the full method name including the owning
  4092. class, and then do your lookup for the class in the lookup window shown
  4093. for the method.
  4094.  
  4095. If you want to see where a method is defined, but can’t remember the
  4096. exact spelling of the name, type your best guess and press <Enter>.
  4097. The true name you wanted will probably be among the first few entries
  4098. in the lookup window, and then you can proceed with an <Option>
  4099. double–click or Find Definition right in the lookup window to get to
  4100. the file you want to see.
  4101.  
  4102. If you want lookup for a method when you’re not sure of the spelling,
  4103. and want to restrict the lookup to just methods, type a bit of the
  4104. class name and two colons just before the method name—even C::method
  4105. will do (even if the class name doesn’t contain a “C”—it’s the two
  4106. colons which signal that a method is wanted).
  4107.  
  4108. EnterAct is not a fancy bells–and–whistles browser, but it does allow
  4109. you to look everything up quickly. And, it has two advantages over any
  4110. other browser: your code doesn’t have to be perfectly compilable, just
  4111. reasonably close; and your spelling when you want lookup for anything
  4112. (including methods and classes) doesn’t have to be perfect, just close
  4113. enough to be distinctive. Try that on your SmallTalk!
  4114.  
  4115.  
  4116. A method-browsing example:
  4117. (The approach below is for use only if your spelling of
  4118. the method name is incorrect: if your spelling is correct, click
  4119. after the method name, then use Find Definition on the full
  4120. class name::method name right in the AutoLook window.)
  4121.  
  4122.  
  4123.  
  4124.  
  4125.  
  4126.  
  4127.  
  4128.  
  4129.  
  4130.  
  4131. Press <Enter> with cursor to the right of "DoCommand” to see...
  4132.  
  4133.  
  4134.  
  4135.  
  4136.  
  4137.  
  4138.  
  4139. press <Enter> again to see the second entry...
  4140.  
  4141.  
  4142.  
  4143.  
  4144.  
  4145.  
  4146.  
  4147. To view the definition of "CArtClassApp::DoCommand", select it...
  4148.  
  4149.  
  4150.  
  4151.  
  4152.  
  4153.  
  4154.  
  4155. and then select Find Definition, or <Option>double-click:
  4156.  
  4157.  
  4158.  
  4159.  
  4160.  
  4161.  
  4162.  
  4163.  
  4164.  
  4165.  
  4166.  
  4167. -    -    -    -    -    -    -    -    -    -    -    -
  4168. Documents and windows
  4169. -    -    -    -    -    -    -    -    -    -    -    -
  4170. §    New, Open, Close
  4171. New under the File menu means a new text window. To create a project,
  4172. select New Project from the EnterAct menu. A new lookup window appears
  4173. automatically whenever you look something up. New PICT windows can’t
  4174. be had, no matter what you try.
  4175.  
  4176. Open under the file menu allows you to open any TEXT or PICT document.
  4177. To open a project, select Open Project from the EnterAct menu. 
  4178.  
  4179. Close will close the front window, whatever it is, and the key
  4180. equivalent <Command><W> is often handy. Close Project will close the
  4181. project window whether it is in front or not. Only one project can be
  4182. open at a time, so if you select Open Project while a project is open
  4183. you will be asked to confirm putting away the current project. The same
  4184. applies if you select New Project.
  4185.  
  4186. To close all text windows, select Close All from the Windows menu. This
  4187. will not close your project or the Find dialog.
  4188.  
  4189. EnterAct provides some support for unix and DOS files. Specifically,
  4190. you can open, change, and save them.
  4191.  
  4192.  
  4193. §    Save, Save As, Revert
  4194. Save applies only to proper text documents (not lookup windows) and
  4195. to PICT’s. Saving a PICT will alter only the window location that
  4196. EnterAct saves with any file. To save the contents of a lookup window,
  4197. Copy what you want and Paste it into a regular text window. Projects
  4198. are saved automatically, when you update the dictionary, add files,
  4199. or close the project. 
  4200.  
  4201. Save As can be used with text and PICT documents, and with a project
  4202. as well. In particular, you can set up a project to use as
  4203. “stationery”, with the font and window location preset, and commonly
  4204. needed files already added—for details see the “Projects” chapter,
  4205. section “Creating a project”.
  4206.  
  4207. Revert applies to text and PICT documents only (with PICT’s only the
  4208. position on your screen is reverted).
  4209.  
  4210. §    Close and Save Documents
  4211. These two new commands are under the Windows menu, supplementing
  4212. the old Close All and Save All. The Close Documents and Save
  4213. Documents commands affect only windows which already have a
  4214. corresponding file on disk: in particular, “untitled” windows are left
  4215. alone. By contrast, Close All also closes lookup windows and asks you
  4216. to save any “untitled” windows—and Save All also asks you about
  4217. saving “untitled” windows.
  4218.  
  4219. §    Autorevert
  4220. When you select Autorevert for an open document, EnterAct will check
  4221. the disk file for the document every 10 seconds, and refresh the
  4222. document’s window if the contents of the file have changed. This
  4223. continues until you select Autorevert for the document again (it’s a
  4224. toggle) or until you close the window. To remind you that the
  4225. document’s window is being autoreverted, a “disk-to-window” icon will
  4226. be shown in the window’s display box.
  4227.  
  4228.  
  4229.  
  4230.  
  4231.  
  4232. Typically EnterAct will not detect that a file has been changed until
  4233. it is closed by the program that is changing it.
  4234.  
  4235. While implemented in a general way, Autorevert is primarily meant for
  4236. use with hAWK programs that print ongoing progress messages to disk.
  4237. Several of the supplied hAWK programs print messages to the file
  4238. “$tempProgress”, and by monitoring this file via Autorevert you can
  4239. watch how programs are progressing as they run. For more on this use
  4240. of Autorevert see Appendix 2.
  4241.  
  4242. Every decent app needs one nutty gizmo. Hence Autorevert.
  4243.  
  4244. §    Modify Read Only
  4245. EnterAct watches out for Projector 'ckid' resources, and won't let you
  4246. change a file if it has been checked out of SourceServer as
  4247. "read only". When a document can't be changed for this reason, a small
  4248. pencil with a slash through it will be shown in the display box of
  4249. its window.
  4250.  
  4251. When you need to edit a file that has been checked out as "read only",
  4252. select "Modify Read Only" from the File menu. This makes the file
  4253. fully editable, and alters the 'ckid' resource slightly so that
  4254. SourceServer will know the file has been changed when you check
  4255. it back in. "Editable" meaning you can change the text in the window
  4256. and save the changes, just as with a regular document.
  4257.  
  4258. No icon is displayed for "modifiable read only" files, mainly because
  4259. your author can't figure out what the heck that means. Whatever
  4260. else it does, it severely compromises version control.
  4261.  
  4262.  
  4263. §    Saving window locations
  4264. Saving window locations is nice, provided you aren’t pestered all the
  4265. time to save your changed location when you close a window. In
  4266. EnterAct, saving window locations takes the place of neatly tiling and
  4267. stacking windows. By default, EnterAct will save window locations
  4268. whenever you save a text or PICT document. If you would rather not have
  4269. window locations saved, call up the Options dialog and uncheck the
  4270. “Save document window locations” item. Any saved locations will also
  4271. be ignored when a document is opened if you uncheck this item.
  4272.  
  4273.  
  4274. §    ... without being pestered
  4275. Beneath the “Save document window locations” item in the Options dialog
  4276. there’s another check box, “...but don’t pester me about saving
  4277. locations”. Both of these options are on by default. The “don’t pester”
  4278. part means that you will not be asked if you wish to save a text window
  4279. when you close it if all you’ve done is change the window’s location
  4280. on the screen. 
  4281.  
  4282. The location of the project window is always saved (this is automatic)
  4283. regardless of your options.
  4284.  
  4285.  
  4286.  
  4287.  
  4288.  
  4289.  
  4290.  
  4291.  
  4292.  
  4293.  
  4294.  
  4295.  
  4296.  
  4297.  
  4298.  
  4299.  
  4300.  
  4301.  
  4302.  
  4303.  
  4304.  
  4305. §    Newly opened windows can be long or short
  4306. If the “Save document window locations” item in the Options dialog has
  4307. a check mark, and if a document you open has a window location saved
  4308. with it, then EnterAct will restore your document to its saved
  4309. location. Otherwise, EnterAct won’t have a remembered location for the
  4310. window, or will ignore it (this is especially true of a new text
  4311. window). You can roughly control the length of these windows with the
  4312. radio button options “Windows open short / long by default” in the
  4313. Options dialog. Long windows will reach all the way to the bottom of
  4314. your main screen when they open. Short windows will indeed be
  4315. relatively short on a large screen, but will fill most of a small
  4316. screen.
  4317.  
  4318. The default is short windows. Note that you can grow just the length
  4319. of any text window down to the bottom of the screen by holding down
  4320. the <Option> key while clicking in the zoom box.
  4321.  
  4322. The default width of a new window is fixed at a moderate size, about
  4323. 74 characters in Monaco 9 (this is also a near–maximum nice width for
  4324. printing). For existing documents, the width will be based on the first
  4325. 20 lines of the text, within reasonable limits.
  4326.  
  4327. Note that if a document is being opened during restoration of a
  4328. project’s context its location will be where you last left it, not
  4329. necessarily the same as where you last saved it.
  4330.  
  4331.  
  4332. §    <Option>–Zoom zooms just the length
  4333. If you hold down the <Option> key while clicking in the zoom box of
  4334. a window, only the length will be affected. If you’re zooming out (the
  4335. first zoom is usually an “out”), the bottom of the window will drop
  4336. down to the bottom of your screen, rather in the way a menu drops down.
  4337. Zooming in is not affected by the <Option> key. 
  4338.  
  4339. The window you're zooming will stop short of covering your AutoLook
  4340. window if it's in the way.
  4341.  
  4342.  
  4343. §    Number of windows at one time
  4344. Restrictions on the maximum number of windows on–screen at one time
  4345. are as follows:
  4346.  
  4347. ____
  4348. regular text, PICT    memory-limited
  4349. lookup                        10 or fewer (see below)
  4350. project, Browser, AutoLook, Find - one of each at a time.
  4351. ____
  4352.  
  4353. Note you can print any number of EnterAct  text files by selecting them
  4354. in the Finder and then selecting the Finder’s print command, since the
  4355. files will be opened, printed, and closed one at a time.
  4356.  
  4357. While the hard upper limit on lookup windows is 10, you can set the
  4358. maximum number on–screen to any number between 1 and 10 using the
  4359. Options dialog. The default number is 4.
  4360.  
  4361.  
  4362. §    The Windows menu
  4363. Consisting of: Close All, Close Documents, Save All, Save Documents,
  4364. Keep Lookup Around, and a list of your open windows, with the project
  4365. first and others in order from front to back on your screen.
  4366.  
  4367. Close All affects text, lookup, and PICT windows. If it needs saving,
  4368. you’ll be asked. Lookup windows will be quietly closed, since they
  4369. cannot be saved. The combination of Close All with remembered window
  4370. locations lets you arrange groups of documents to work with at one
  4371. time, and switch between groups with a minimum of nuisance.
  4372.  
  4373. Save All will save any text or PICT documents that need it (note lookup
  4374. windows aren’t saveable). If a text window hasn’t been saved yet,
  4375. you’ll see the standard Save As dialog. If you use MultiFinder or
  4376. System 7, and you decide to switch off the “Safe switching under
  4377. MultiFinder” option in the Options dialog, I would strongly recommend
  4378. that you use Save All or preferably Close All before switching to
  4379. another application.
  4380.  
  4381. Close Documents and Save Documents do the same as the Close and
  4382. Save All versions, but affect only documents, ie windows that
  4383. correspond to an existing disk file.
  4384.  
  4385. Keep Lookup Around applies only to lookup windows. The maximum number
  4386. of lookup windows on–screen is fixed (although you can change this
  4387. number at any time in the Options dialog), and when this limit is
  4388. reached the next lookup window that you call up will quietly close one
  4389. of the old lookup windows to make room. To avoid having a particular
  4390. lookup window disappear later on you, select Keep Lookup Around when
  4391. the lookup window is in front. The two bullets •• at the beginning of
  4392. the lookup window’s title will change to ¶¶, showing that it won’t go
  4393. away until you yourself close it. Note especially that Close All will
  4394. close all lookup windows, whether or not they are marked for keeping.
  4395.  
  4396. To bring a window to the front, select it by name from the lower part
  4397. of the Windows menu. If a project is open, it can always be brought
  4398. to the front with the menu key–equivalent <Command><zero>, which is
  4399. worth memorising. No other windows (except dialogs) have key
  4400. equivalents—if your memory is that good then in my humble opinion you
  4401. don’t need EnterAct in the first place. 
  4402.  
  4403.  
  4404. §    The display box
  4405. All text windows including lookup windows have a small “display box”
  4406. along the bottom in the horizontal scroll bar area. For a regular text
  4407. file this displays the name of the file; in a lookup window it shows
  4408. the name of the file from which the entry was taken, followed by the
  4409. (abbreviated) type of entry, the number of the current entry shown,
  4410. and the total number of entries available in the lookup window.
  4411.  
  4412. When you drag the mouse to select text in a text window, the display
  4413. box will change to show the line number that the mouse is currently
  4414. on, followed by the number of characters selected. If more  than one
  4415. line is selected, the display box will show the number of lines
  4416. selected rather than the current line number. To determine how many
  4417. lines there are in a file, use <Option><down arrow> or Go Bottom and
  4418. click on the last line of the file. To determine the number of
  4419. characters in a file, click at one end of the file and then
  4420. <Shift>click at the other end of the file.
  4421.  
  4422.  
  4423.  
  4424.  
  4425.  
  4426.  
  4427.  
  4428.  
  4429.  
  4430.  
  4431.  
  4432. (the display box is now on the left, otherwise unchanged)
  4433.  
  4434. §    Printing
  4435. To print a text file, bring its window to the front and select Print.
  4436. A Page Setup beforehand will be needed if you wish to print in a
  4437. nonstandard way, such as sideways or with an unusual paper size. To
  4438. stop a printout, press <Command><period>.
  4439.  
  4440. Printing of PICT’s or other kinds of files is not supported, just text.
  4441. However, any illustrations in a text document (see next section) will
  4442. print properly, with automatic nudging to avoid clipping a picture off
  4443. at the bottom of a page.
  4444.  
  4445.  EnterAct does not clip long lines of text, but folds the “hangover”
  4446.  back to the left margin on a new line. The line-break is not always
  4447.  as good as you yourself would do it, but at least you will never lose
  4448.  any characters off the right edge when printing. 
  4449.  
  4450. §    Illustrating your text
  4451. As you can see from this manual, there is a way to put PICT's in a
  4452. text document. You can place dialog and screen snapshots,
  4453. structure mockups, flowcharts, state machines, in short, any old
  4454. PICT, into your spec, design, and test documents, even into your
  4455. code files (EnterAct’s style of illustration goes unnoticed by
  4456. compilers, provided you place the picture inside a comment).
  4457. However, the process of placing an illustration is not at present a
  4458. simple one, nor is the order of pictures in a document easily changed,
  4459. so it would be best to reserve illustrations in your documents for
  4460. those occasions when an immediate view of a picture truly is worth a
  4461. thousand words.
  4462.  
  4463. Illustrations come in two parts: PICT resources, placed in the resource
  4464. fork of your document using ResEdit or equivalent; and “picture
  4465. markers” in the text of your document, each consisting of a <Return>
  4466. followed immediately by an <Option><space>.
  4467.  
  4468. If you have more than one illustration in a document, the PICT’s should
  4469. be given ID numbers in the same sequence as they are to appear in your
  4470. document. The numbers should be between 128 and 32,767, and if you
  4471. anticipate coming back later to insert new pictures between old ones
  4472. you should space the numbers out a bit, using for example the sequence
  4473. 2,000, 2,100, 2,200.... All PICT’s should be made purgeable, as
  4474. EnterAct does not insist on keeping the PICT’s in memory. In ResEdit,
  4475. you can mark the PICT as purgeable at the same time as you set the ID
  4476. number, using “Get Info...” with the PICT selected.
  4477.  
  4478. For each PICT you wish displayed, you’ll need a <Return>  
  4479. <Option><space> pair at the position where you wish the illustration
  4480. to appear. The simplest approach is to first use ResEdit to install
  4481. your PICT’s in the document, then open the document using EnterAct and
  4482. insert an <Option><space> at the beginning of the line where you want
  4483. the first picture to appear. As you type the <Option><space>, the
  4484. picture will begin to appear—you should then type enough <Return>’s
  4485. to open up blank lines for the picture to occupy, so that it doesn’t
  4486. overlap any following text (however, you may certainly overlap picture
  4487. and text if you want). If you need to see the picture fully redrawn
  4488. while doing this, click in the up or down arrow of the vertical scroll
  4489. bar. Repeat for any following pictures.
  4490.  
  4491. To sum up, the PICT’s in the resource fork of your document should have
  4492. ID numbers that are in the same order as you want them displayed; for
  4493. each picture there should be a <Return> <Option><space> followed by
  4494. enough blank lines to make room for the picture.
  4495.  
  4496. To insert a PICT between two existing PICT’s, give it an ID number
  4497. between the numbers for the flanking PICT’s when you paste it in with
  4498. ResEdit, and put the “picture marker” of course between the flanking
  4499. markers.
  4500.  
  4501. If your pictures end up displayed in the wrong order, you can be sure
  4502. that their ID numbers are not in the correct order. A missing picture
  4503. means that either the PICT or the <Return> <Option><space> for it is
  4504. missing. A picture can be moved around between two flanking pictures
  4505. just by cutting and pasting the picture marker, but to change the order
  4506. of pictures you will have to change the PICT ID numbers to the sequence
  4507. you want. Excess PICT’s won’t be displayed until you enter a picture
  4508. marker, and excess markers don’t hurt, but may be triggered
  4509. unexpectedly if you add a PICT at the end of your file.
  4510.  
  4511. A file with two PICT illustrations that have been pasted in
  4512. using ResEdit:
  4513.  
  4514.  
  4515.  
  4516.  
  4517.  
  4518.  
  4519.  
  4520.  
  4521.  
  4522.  
  4523.  
  4524.  
  4525.  
  4526.  
  4527.  
  4528. The "Activities" PICT in "EnterAct Log": the small black rectangle is
  4529. the <Option><space> that marks the picture insert position (shown
  4530. selected). Several <Return>'s follow, to open up enough room for the
  4531. picture.
  4532.  
  4533.  
  4534.  
  4535.  
  4536.  
  4537.  
  4538.  
  4539.  
  4540.  
  4541.  
  4542.  
  4543.  
  4544.  
  4545.  
  4546.  
  4547.  
  4548.  
  4549. For a whopping big example, examine this document and its resources.
  4550.  
  4551. -    -    -    -    -    -    -    -    -    -    -    -
  4552. Editing
  4553. -    -    -    -    -    -    -    -    -    -    -    -
  4554. §    Introduction
  4555. EnterAct provides all the standard text editing commands, which should
  4556. be familiar from elsewhere (THINK C, for example), and so the emphasis
  4557. in this chapter will be on EnterAct’s editing enhancements. Briefly,
  4558. they are:
  4559.     •    everything that changes a document is undoable one way or another,
  4560.         except Revert. In addition to the usual Undo/Redo under the Edit menu,
  4561.         you can also undo any one of your most-recent thousand activities, and
  4562.          limited file reversion is also available (see the “Show Activities”
  4563.         chapter)
  4564.     •    "code templates": type a template name, press <command><return>,
  4565.         and it expands into the full "template", which can be any old chunk
  4566.         of text. And <command><return> advances you through the template
  4567.     •    Paste Selection Behind combines Copy, switch to the next window,
  4568.         and Paste in one command
  4569.     •    the indentation of your code will commonly be preserved when you
  4570.         Paste or Paste Selection Behind
  4571.     •    the selection in the next–to–front window is shown in a frame,
  4572.         useful with the Paste Selection Behind and Find commands
  4573.     •    Reformat Selection can “pretty up” a comment or selection of text,
  4574.         rebreaking lines to your specified width.
  4575.     •    Syntax coloring, for line comments, strings, and ticks
  4576.     •    Graphic nesting display
  4577.  
  4578. “Balance”, “Show Activities”, and “Options”, under the Edit menu, are
  4579. described in their own separate chapters later in this manual.
  4580.  
  4581.  
  4582. §    Undo
  4583. EnterAct has one level of undo and redo, via Undo/Redo under the Edit
  4584. menu. The undoable and redoable actions are: typing, Cut, Copy, Paste,
  4585. Paste Selection Behind, Clear (Backspace), Shift Left, Shift Right,
  4586. Reformat Selection, Replace, Replace and Find Again, and Replace All.
  4587.  
  4588. Revert is not undoable, though discarded changes can often be recovered
  4589. with Show Activities. All other “undoable” changes (such as changing
  4590. the font) can be undone by reusing the same command (such as changing
  4591. the font back).
  4592.  
  4593. Just clicking the mouse or selecting a range of text does not affect
  4594. undo. Changing the window does make the last change temporarily
  4595. undoable, but you can restore the ability to undo the last change by
  4596. bringing the appropriate window to the front again.
  4597.  
  4598. To selectively undo past activities or revert files back past the last
  4599. saved version, see the “Show Activities” chapter. For these purposes,
  4600. EnterAct records your last 10,240 activities in full to disk.
  4601.  
  4602.  
  4603. §    Typing, Cut, Copy, Clear
  4604. “Typing” means hitting a sequence of keys that produces text,
  4605. intermingled with any number of <Backspace>’s. A new typing operation
  4606. begins whenever you change the insertion point or select characters
  4607. and then type something. As with all actions, just changing the
  4608. insertion point or selecting characters does not affect your ability
  4609. to undo—it’s the subsequent change to your text that does it.
  4610.  
  4611. When you type <Return> the resulting new line will have the same
  4612. indentation as the line above it, unless you hold down the <Option>
  4613. key, in which case you’ll end up flush at the left margin.
  4614.  
  4615. Cut and Copy are as you would expect, but there is one special feature:
  4616. if you want to take a screen-shot in EnterAct, first Copy a single
  4617. character, and then immediately after taking the screen-shot paste it
  4618. into your scrapbook.
  4619.  
  4620. As an aside, please see "EnterAct's magic clipboard" for a way to run
  4621. hAWK programs on whatever you Copy with EnterAct. The basic 
  4622. sequence is: you write the hAWK program you need, and start it
  4623. running; and then whenever you need the program's results, Copy
  4624. some text to give it the appropriate input, and Paste the results.
  4625. Typically the menu bar will flash to show that your program has
  4626. done something with the current clipboard's contents (this and
  4627. all other aspects of the program are under your control). This
  4628. effectively gives you programmable Copy/Paste using what has
  4629. been called the best little language in the world, and some example
  4630. programs are provided to get you going.
  4631.  
  4632. "Clear" has the same effect as the <Clear> key, and <Backspace> is also
  4633. the equivalent of a Clear if a range of text is selected. If no text
  4634. is selected, <Backspace> will delete one character, whereas Clear will
  4635. not.
  4636.  
  4637.  
  4638. §    Paste preserves indentation
  4639. At least, it does if the range of text you select to be pasted over,
  4640. or the insertion point for the paste, satisfies the requirement: “all
  4641. tabs or spaces to the left at the start”. Also, the text must have been
  4642. cut or copied with EnterAct.
  4643.  
  4644. “All tabs or spaces to the left at the start” means that the first
  4645. character you select for replacement should be the first character on
  4646. the line that is not a space or tab. If you have just an insertion
  4647. point for the Paste, then the same applies—there should be nothing but
  4648. spaces and tabs from the insertion point to the left margin. Starting
  4649. at the left margin will also do.
  4650.  
  4651. The basic rule is you shouldn’t “see” any printing characters between
  4652. the left margin and the start of your selection or insertion point.
  4653. If this rule is satisfied when you are about to Paste, then the paste
  4654. will preserve your relative indentation, removing the need to Shift
  4655. Left or Shift Right afterwards.
  4656.  
  4657. About the only special action you should take to have Paste preserve
  4658. your indentation is to open up a new line with a <Return> just before
  4659. you paste in a block of code, which you probably do anyway.
  4660.  
  4661. Paste Selection Behind also preserves indentation.
  4662.  
  4663. §    Code templates
  4664. Save those fingers. All templates are stored in the text file
  4665. "EnterAct Code Templates", which is very easy to modify (please
  4666. take a look at it). Add this file to the folder where you keep
  4667. EnterAct, at the same level. If you save changes to your "EnterAct
  4668. Code Templates" file using EnterAct, your new templates are
  4669. instantly available (no need to quit and restart).
  4670.  
  4671. To use a template, you type its name and press <command><return>.
  4672. And <command><return> will also advance you to the next logical
  4673. insertion point in your template (or in any code for that matter).
  4674. Templates don't have to contain code, and template names can
  4675. contain any non-blank characters, not just letters and numbers.
  4676.  
  4677. To force <command><return> advancing to stop at a particular point,
  4678. put an '@' sign in the template. Then <command><return> will stop
  4679. at the '@' sign and select it. There's an example just below.
  4680. (For templates that contain C/C++/Java code, <command><return> will
  4681. advance to almost all logical insertion points, with no need for
  4682. '@' signs in the template. But feel free to put them in anywhere.) 
  4683.  
  4684. Keep all your entries flush-left, and EnterAct will adjust your
  4685. indentation when pasting your template in. Just open up a new line
  4686. and tab in to the right position before typing the entry name and
  4687. pressing <command><return>.
  4688.  
  4689. Here are two templates, from the "EnterAct Code Templates" file:
  4690. ____
  4691.  
  4692. ENTRY
  4693. for
  4694. for (; ; )
  4695.     {
  4696.     
  4697.     }
  4698.  
  4699. END
  4700. ENTRY
  4701. i
  4702. #include "@.h"
  4703.  
  4704. END
  4705.  
  4706. ____
  4707. Each entry begins with "ENTRY" on a separate line, followed by the
  4708. name of the entry on a separate line, then the body of the template
  4709. definition, and finally "END" on a separate line. To use the "for"
  4710. template, you would type "for" and then press <command><return>.
  4711. That would paste in the body of the template, and advance your
  4712. insertion point to just before the first ';'. Every subsequent press
  4713. of <command><return> would advance you to the next logical insertion
  4714. point in the template. In the "i" (for "include") template, typing "i"
  4715. plus <command><return> would replace the "i" with
  4716. ____
  4717. #include "@.h" [plus a new line]
  4718. ____
  4719. and select the '@' sign so you could type in a file name.
  4720.  
  4721. You can use templates to hold arbitrary chunks of text. For example,
  4722. if you find yourself typing "if (theErr == noErr) {}" a lot, you could
  4723. reduce this to "e" plus <command><return> with a template
  4724. entry such as
  4725. ____
  4726. ENTRY
  4727. e
  4728. if (theErr == noErr)
  4729.     {
  4730.     
  4731.     }
  4732.  
  4733. END
  4734. ____
  4735.  
  4736. Tip: add "EnterAct Code Templates" to your "Locations" menu so you
  4737. can change your templates on the fly. Remember, when you change
  4738. your "EnterAct Code Templates" with EnterAct the updated templates
  4739. are instantly available.
  4740.  
  4741. hAWK command lines are handled specially: if your template name
  4742. expands into a hAWK command line, it will all be selected, and if
  4743. you press <command><return> a second time, Enteract will run the
  4744. specified hAWK program. Here's a sample hAWK command line entry
  4745. from the code templates file:
  4746. ____
  4747. ENTRY
  4748. echo
  4749. hAWK -f$EchoFullPathNames -- MFS
  4750.  
  4751. END
  4752. ____
  4753. EnterAct treats any selection beginning with "hAWK" as a hAWK
  4754. command line. If you type "echo" in a text window and then press
  4755. <command><return>, then "hAWK -f$EchoFullPathNames -- MFS"
  4756. will be pasted in as usual for a code template, but because it's
  4757. a hAWK template, the entire line will be selected. The special
  4758. symbol "MFS" stands for all files in your multi-file selection
  4759. in your current project (the files with bullets on the left in the
  4760. project window). So to run this program for real you should first
  4761. select some file for multi-file operations in a project (see the
  4762. Search chapter) and then type "echo<command><return><command>
  4763. <return>". You will end up with a list of full path names for your
  4764. selected files in the "stdout" window.
  4765.  
  4766. §    Selection: front, next–to–front
  4767. EnterAct shows you what you have selected in the text window that is
  4768. just behind the front window. This helps you to make use of the
  4769. Paste Selection Behind command, and also shows you where you are
  4770. when the Find dialog is in front of your text window.
  4771.  
  4772. The selection in your front window is highlighted normally.
  4773. EnterAct draws a black outline around the selection in your
  4774. next–to–front window so you can distinguish it from the front selection.
  4775.  
  4776. You’ll see the selection in your next–to–front window only when
  4777. something can be done with it (such as Paste Selection Behind, or
  4778. Replace). For an illustration, see just below.
  4779.  
  4780.  
  4781. §    Paste Selection Behind
  4782. Paste Selection Behind does the following three actions in one : Copy
  4783. what is selected in the front window; switch to the window just behind
  4784. it; and Paste the copy in over the selection in that window. You’ll
  4785. see your selection in the next–to–front window just beforehand, as
  4786. described above. If you can’t see what is selected in the next–to–front
  4787. window, you can either trust to memory (it’s undoable) or do a “manual”
  4788. Copy, switch windows, Paste.
  4789.  
  4790. Paste Selection Behind is especially handy when switching back and
  4791. forth between your working text window and a lookup window, but it can
  4792. be used with any two text windows.
  4793.  
  4794. Your indentation will be preserved with Paste Selection Behind under
  4795. the same circumstances that apply to a Paste (see “Paste preserves
  4796. indentation” above).
  4797.  
  4798. If you want to undo a Paste Selection Behind but have switched to a
  4799. different window, bring the two windows involved in the Paste Selection
  4800. Behind to the front alternately until Undo becomes enabled. The two
  4801. windows involved are the one you pasted into, and the one you copied
  4802. from.
  4803.  
  4804. (before Paste Selection Behind)
  4805.  
  4806.  
  4807.  
  4808.  
  4809.  
  4810.  
  4811.  
  4812.  
  4813.  
  4814.  
  4815.  
  4816.  
  4817.  
  4818.  
  4819.  
  4820. (after Paste Selection Behind)
  4821.  
  4822.  
  4823.  
  4824.  
  4825.  
  4826.  
  4827.  
  4828.  
  4829.  
  4830.  
  4831.  
  4832.  
  4833.  
  4834.  
  4835.  
  4836. §    Font, font size, tabs
  4837. Sizes for your font are restricted to sizes that are actually installed
  4838. in your system. The default font for text windows in EnterAct is Monaco
  4839. 9, with 4 spaces per tab.
  4840.  
  4841. You can also change the font for the project window. The default here
  4842. is also Monaco 9.
  4843.  
  4844. For projects only, holding down the <Option> key while changing
  4845. the font or size will give you a bold style.
  4846.  
  4847. Tabs in EnterAct are of the relative sort, meaning that when you press
  4848. <Tab> your insertion point advances to the next tab stop. Tab stops
  4849. are placed a fixed number of spaces apart, and you can change this
  4850. number with the Tabs dialog. Note that if you change the font it may
  4851. throw off your nicely–aligned code, so it’s best to pick one font for
  4852. code at the beginning of your programming career and stick with it.
  4853.  
  4854.  
  4855.  
  4856.  
  4857.  
  4858.  
  4859.  
  4860.  
  4861.  
  4862.  
  4863.  
  4864. §    Shift Left / Right
  4865. Shift Left and Shift Right will shift one or more entire lines left
  4866. or right by a tab stop, allowing you to repair or alter the relative
  4867. indentation of your code or text. For simplicity, you should select
  4868. one or more entire lines before calling these commands. They are
  4869. undoable.
  4870.  
  4871.  
  4872.  
  4873.  
  4874.  
  4875.  
  4876.  
  4877.  
  4878.  
  4879.  
  4880. (the effect of Shift Left on the above selection)
  4881.  
  4882.  
  4883.  
  4884.  
  4885.  
  4886.  
  4887.  
  4888.  
  4889.  
  4890.  
  4891.  
  4892.  
  4893. §    Reformat Selection
  4894. Reformat Selection will rebreak the lines in your selection, but the
  4895. result may not always be an improvement. It is designed to work with
  4896. multiple paragraphs, provided you don’t indent the beginning of the
  4897. first line, and that you separate paragraphs with a blank line.
  4898.  
  4899.  
  4900.  
  4901.  
  4902.  
  4903.  
  4904.  
  4905.  
  4906.  
  4907.  
  4908.  
  4909.  
  4910.  
  4911. (the above after Reformat Selection, with the default settings)
  4912.  
  4913.  
  4914.  
  4915.  
  4916.  
  4917.  
  4918.  
  4919.  
  4920.  
  4921.  
  4922.  
  4923.  
  4924.  
  4925. Reformat Selection doesn’t work well on C code, although it may on
  4926. occasion help to tidy up a complicated “if” statement. It works best
  4927. with one or more paragraphs of text, either an entire comment or part
  4928. of a comment, or paragraphs in a text document.
  4929.  
  4930. Since Reformat Selection is undoable there’s no harm in trying it. The
  4931. maximum selection that can be reformatted at one time is roughly the
  4932. standard Text Edit limit, 32,000 or so characters.
  4933.  
  4934. The specific reformatting that Reformat Selection does is governed by
  4935. two options in the Options dialog. The default action is to rebreak
  4936. lines with a “ragged right” format and a maximum line length of 74
  4937. characters, a nice width for printing Monaco 9. In the Options dialog
  4938. (near the bottom) you can alter the maximum number of characters per
  4939. line, and also select a “full justification” look if you want to knock
  4940. people over with your comments. The maximum number of characters per
  4941. line is restricted to a range of 30 to 150.
  4942.  
  4943. §    Syntax coloring
  4944. Color can be applied to comments, strings, and constants inside
  4945. ticks -- if you don’t like the default colors, there are a few
  4946. commands to change them, under the Edit menu.
  4947.  
  4948. This is a simple implementation of coloring, and it doesn't color
  4949. multiline strings properly. The goal here was to color only those
  4950. things that might usefully be colored, things that don’t immediately
  4951. catch the eye and yet are of some importance. Keywords are not
  4952. colored; if they don’t immediately catch your eye yet, just be
  4953. patient, with a bit more programming under your belt they will.
  4954.  
  4955. Syntax coloring might improve with future versions, but one thing
  4956. you can say about EnterAct’s coloring: it doesn't flicker!
  4957.  
  4958. If you grow bored with merely colored comments, try out the
  4959. "Comment options..." command under the Edit menu.
  4960.  
  4961. §    Graphic nesting display
  4962. Hold down the <Option> AND <Command> keys with a source file
  4963. frontmost and vertical lines will appear showing the scope of
  4964. each statement block (ie anything inside {} curly braces). It’s
  4965. OK to scroll with these keys down, but you should release them
  4966. before further editing (I think).
  4967.  
  4968. §    Arrow keys for moving around
  4969. The up down left right arrow keys will move your cursor by one
  4970. character or line. If you hold down the <Option> or <Command> key an
  4971. arrow key will take you all the way in the appropriate direction.
  4972. <Option><up arrow> and <Option><down arrow> are especially useful for
  4973. taking you to the top or bottom of your document.
  4974.  
  4975. (Here’s a glance ahead at the Show Activities command, which produces
  4976. a list of your recent activities for review or undo. The positions
  4977. shown, such as “«Cedar_MarksA.c» 1411 3” below, are compatible with
  4978. EnterAct’s Go to command, and positions can be corrected for the
  4979. effects of other activities to give you a list that is as up to date
  4980. as possible. Within generous limits, you will be able to review,
  4981. recover, or undo anything you’ve done with EnterAct recently. Details
  4982. are in the “Show Activities” chapter.)
  4983.  
  4984.  
  4985.  
  4986.  
  4987.  
  4988.  
  4989.  
  4990.  
  4991.  
  4992.  
  4993.  
  4994.  
  4995.  
  4996.  
  4997.  
  4998.  
  4999.  
  5000.  
  5001. -    -    -    -    -    -    -    -    -    -    -    -
  5002. Balance
  5003. -    -    -    -    -    -    -    -    -    -    -    -
  5004. NOTE you can also Balance a delimiter by double-clicking on it.
  5005.  
  5006. §    Checks everything
  5007. ...except those angular brackets that you find only in
  5008. ____
  5009.         #include <SystemHeader.h>.
  5010. ____
  5011. The full list is (), [], {}, /* */, " ", and ' '.
  5012. Balance will also detect nested comments and any single
  5013. improperly–formed comment start or end. Two improper comment delimiters
  5014. in a row (improper start followed by improper end, or vice versa) will
  5015. not be detected, but that’s a one–in–a–million case that you’ll
  5016. probably never see. 
  5017.  
  5018. Because Balance detects nested comments, it will signal an error if
  5019. you use a comment start or end within a comment (nested comment starts
  5020. are excepted if you deselect the “Detect nested comment starts” option
  5021. in the Options dialog)—see “Nested and bad comments” below. 
  5022.  
  5023. For strings in double quotes " ", the line continuation character '\'
  5024. must be the last character on the line if the string is continued to
  5025. the next line:
  5026. ____
  5027.     "This string is \<Return>
  5028.     properly continued."
  5029.     "This string will trigger<Return>
  5030.     a Balance error."
  5031.     "So will \<space><Return>
  5032.     this string, due to the space before Return."
  5033. ____
  5034. Balance will behave in different ways depending on where you are in
  5035. the code. To Balance an entire file, select an insertion point at the
  5036. very top of the file (<Option><up arrow> will take you there). To
  5037. Balance a specific delimiter, either click just to the left of it or
  5038. select the delimiter (note for comment starts and ends this means both
  5039. characters). 
  5040.  
  5041. Given an insertion point, Balance will first look to the immediate
  5042. right for a delimiter that wants balancing, and then to the immediate
  5043. left. When several delimiters are side by side, you can avoid having
  5044. to remember this by just selecting the delimiter you wish balanced.
  5045. Clicking between the characters of a comment start or end also counts
  5046. as a “hint” to find the other end. 
  5047.  
  5048. If your range of characters selected doesn’t consist of just a single
  5049. delimiter, or if your insertion point is not right next to a delimiter,
  5050. then Balance will try to find the smallest enclosing pair of
  5051. delimiters. Your selection range will expand to the next enclosing pair
  5052. as you repeat the Balance command.
  5053.  
  5054.  
  5055. §    Shows the error location
  5056. Any unmatched or mismatched delimiter will be selected and shown. In
  5057. the case of mismatched delimiters, you can switch between the two
  5058. delimiters by selecting Balance again. If the delimiter is an “orphan”,
  5059. the second Balance will just produce a beep, since there’s no other
  5060. end to show.
  5061.  
  5062.  
  5063.  
  5064.  
  5065.  
  5066.  
  5067.  
  5068.  
  5069. (if there’s a mismatch, a second Balance will show the other end)
  5070.  
  5071.  
  5072.  
  5073.  
  5074.  
  5075.  
  5076.  
  5077.  
  5078.  
  5079. §    Balancing a file
  5080. Given an insertion point at the top of a file, Balance will balance
  5081. the entire file. If you hear a beep and the cursor does not move from
  5082. the top of the file, that means the entire file is balanced. Either
  5083. Go Top or <Option><up arrow> will take you to the top of a file.
  5084.  
  5085. Balancing a file by starting from the top will always work correctly.
  5086. You can also Balance a file by starting at the very bottom, but this
  5087. may not work properly if the file contains any assembly–language
  5088. sections (see “The asm problem” at the end of this chapter).
  5089.  
  5090.  
  5091. §    Balancing a specific delimiter
  5092. Balance looks for a “hint” from you, as indicated by your insertion
  5093. point or selection, before going ahead. As mentioned above, you can
  5094. Balance one specific delimiter by selecting it just before the balance,
  5095. or by selecting an insertion point just to the left of it. If the
  5096. delimiter is not next to another delimiter, you can click on either
  5097. side of it. With comments and strings it is best to start the Balance
  5098. off with a “hint”, that is, select one end of the comment or string
  5099. or click next to one end, since if you start in the middle of a comment
  5100. or string the text will be checked as strictly as possible, without
  5101. allowance for it being within a comment or string.
  5102.  
  5103.  
  5104.  
  5105.  
  5106.  
  5107.  
  5108.  
  5109.  
  5110. (Balance will take the selected ')' as a hint)
  5111.  
  5112.  
  5113.  
  5114.  
  5115.  
  5116.  
  5117.  
  5118.  
  5119.  
  5120.  
  5121. §    Nested and bad comments
  5122. Balance will detect all nested comments, and any comment that has one
  5123. end missing. In the case of a comment with one end missing , you will
  5124. be shown a “good” end in the vicinity of the bad one, and you’ll have
  5125. to deduce on your own where the other end should be. Comment errors
  5126. can sometimes be subtle and difficult to see, such as a space between
  5127. the '*' and the '/'.
  5128.  
  5129.  
  5130.  
  5131.  
  5132.  
  5133.  
  5134.  
  5135.  
  5136.  
  5137.  
  5138.  
  5139.  
  5140.  
  5141.  
  5142.  
  5143.  
  5144.  
  5145. You may find it worthwhile to Balance all your source files with
  5146. EnterAct’s balance command, since comment errors can sometimes slip
  5147. past THINK C’s compiler, resulting in some of your code being quietly
  5148. treated as though it was commented out. This can have unpleasant
  5149. consequences—if you’re not lucky, it can generate a wild pointer. Note
  5150. that any files in your EnterAct project are guaranteed to be free of
  5151. these comment errors after a successful Update Dictionary, since the
  5152. dictionary–builder checks comments thoroughly.
  5153.  
  5154. The one price to be paid for EnterAct’s improved comment checking is
  5155. that you should not use a comment start or end within a comment. Such
  5156. things as
  5157.     /*.../*...*/
  5158. and
  5159.     /*...*/...*/
  5160. will be treated as errors, both by the Balance command and by the
  5161. dictionary–builder. If you do need to use a comment start or end within
  5162. a comment, the general cure is to place some character between the star
  5163. and the slash. A space will do, or you could be pedantic and place each
  5164. character in separate single quotes, for example instead of /* use /
  5165. * or '/''*'.
  5166.  
  5167. Well, OK—some of you deliberately double up your comment starts to save
  5168. on typing. If you do this, select the Options command under the Edit
  5169. menu and uncheck the “Detect nested comment starts” check box. This
  5170. affects the dictionary builder also.
  5171.  
  5172.  
  5173.  
  5174.  
  5175.  
  5176.  
  5177.  
  5178.  
  5179.  
  5180.  
  5181.  
  5182.  
  5183.  
  5184.  
  5185.  
  5186.  
  5187.  
  5188.  
  5189.  
  5190.  
  5191.  
  5192. §    Starting in the middle
  5193. If your selection doesn’t indicate a hint, Balance first looks
  5194. backwards in your file for a delimiter; when it finds one, it then
  5195. looks forwards for another delimiter, hoping to match them up. Of
  5196. course, if you supply an opening delimiter as a “hint”, or start from
  5197. the top of the file, Balance will proceed in the forward direction
  5198. immediately.
  5199.  
  5200. On rare occasions you may wish to balance the contents of a comment
  5201. or string as though it were code, and not just text. To do this, click
  5202. or select a range of characters within the comment or string, away from
  5203. either end. Balance will then check all delimiters as it works
  5204. outwards, until it encounters one end of the comment or string and
  5205. “realizes” that it has been fooled. 
  5206.  
  5207. By the way, EnterAct also accepts “C++” style comments, as in
  5208. ____
  5209.     //comment beginning with two slashes, to end of line
  5210. ____
  5211. but only to the extent of skipping over the contents when balancing.
  5212. If you start the Balance within this sort of comment it may just
  5213. beep at you. 
  5214.  
  5215.  
  5216.  
  5217.  
  5218.  
  5219.  
  5220.  
  5221.  
  5222.  
  5223.  
  5224.  
  5225.  
  5226.  
  5227.  
  5228.  
  5229.  
  5230.  
  5231.  
  5232.  
  5233.  
  5234.  
  5235.  
  5236.  
  5237.  
  5238.  
  5239.  
  5240.  
  5241.  
  5242.  
  5243.  
  5244.  
  5245.  
  5246. §    The asm problem
  5247. If Balance runs into an “asm {...}” construction while looking
  5248. backwards through your code, it just plain won’t know that it’s inside
  5249. an asm. Any error you’re shown in this one circumstance is not to be
  5250. trusted, since it will almost certainly be due to a delimiter inside
  5251. an assembly–language comment (they start with a semicolon). 
  5252.  
  5253. When you balance a file from the top, all asm constructions will be
  5254. handled properly. The dictionary–builder, by the way, also handles
  5255. asm’s properly. Be warned that in other cases if you ask Balance to
  5256. run backwards through a block of assembly language it will hiccup if
  5257. it runs into a delimiter within an assembly–language comment. This is
  5258. a bug, but I haven’t found a cure that wouldn’t slow balancing down
  5259. to a crawl. 
  5260.  
  5261. Because of this problem it is best to always balance an entire file
  5262. by starting from the top rather than from the bottom, unless you’re
  5263. sure that the file contains no assembly language.
  5264.  
  5265. To Balance an assembly–language block, or a function containing
  5266. assembly language, select or click next to the opening curly brace '{'
  5267. at the top rather than the closing curly brace.
  5268.  
  5269. Otherwise, this will only be a problem if you’re balancing inside a
  5270. function that contains a block of assembly language. Then, you should
  5271. select opening delimiters rather than closing delimiters before
  5272. balancing. 
  5273.  
  5274.  
  5275. -    -    -    -    -    -    -    -    -    -    -    -
  5276. Search
  5277. -    -    -    -    -    -    -    -    -    -    -    -
  5278.  
  5279.  
  5280.  
  5281.  
  5282.  
  5283.  
  5284.  
  5285.  
  5286.  
  5287.  
  5288.  
  5289. (both Find and Replace strings are limited to 255 characters)
  5290.  
  5291. §    Introduction
  5292. Single and multi–file searches in EnterAct are controlled by a modeless
  5293. Find dialog. The one important novelty is that you fine–tune your
  5294. multi–file selection by holding down the <Option> key and dragging over
  5295. the files in the project window (bullets • appear beside each file
  5296. included in the search). Your multi-file selection can also be used
  5297. to remove files from a project, or used by a hAWK program as a list
  5298. of files to take input from.
  5299.  
  5300. Replace, Replace and Find Again, and Replace All are all undoable.
  5301. The commands Find, Find Again, and Enter Selection all function when
  5302. the project window is in front, and the “find” commands also function
  5303. when the project window is just behind the Find dialog. Find commands
  5304. will search the currently active pane, useful if you are trying to spot
  5305. one file in a long list, or pick out files with similar names. Enter
  5306. Selection will enter the currently-selected file name in the Find
  5307. dialog.
  5308.  
  5309.  
  5310. §    Find is modeless
  5311. This requires a few minor adjustments in the way you search. 
  5312. There is no Cancel button in the Find dialog box—it has a Close box
  5313. instead. 
  5314.  
  5315. While the Find dialog is the front window, search commands that deal
  5316. with single files will apply to the window just beneath the Find
  5317. dialog. Replace All is excepted because it can cause multiple changes,
  5318. so to use this command you must have the text window in front.
  5319.  
  5320. Find and Find Again also function if the Find dialog is in front of the
  5321. project window, searching the current pane as though it were a text
  5322. list of file names (actually, that’s what it is…).
  5323.  
  5324. The “Find” button is the equivalent of the Find Again command. When
  5325. you click the Find button or select Find Again, the window just beneath
  5326. the Find dialog will be brought to the front, and the next instance
  5327. of your find string shown. The Find dialog will stay on–screen, moving
  5328. just behind the window being searched, so to find again you can if you
  5329. wish leave your mouse stationed over the Find button and double–click
  5330. (not a true double–click, the first click brings the Find dialog to
  5331. the front, and the second does the Find Again).
  5332.  
  5333. Buttons for multi–file searching are incorporated directly in the Find
  5334. dialog (more on this in “Multi-file searches” below). To modify your
  5335. multi–file search selection of files, hold down the <Option> key and
  5336. drag over the file names in the project window. You’ll see the
  5337. “eyeball” cursor while doing this.
  5338.  
  5339.  
  5340.  
  5341.  
  5342.  
  5343.  
  5344.  
  5345.  
  5346.  
  5347.  
  5348.  
  5349.  
  5350.  
  5351.  
  5352.  
  5353.  
  5354.  
  5355. §    Find options
  5356. Select “Match Words” if  you don’t wish to match a longer string that
  5357. contains your find string in a form that makes a different word. For
  5358. example, the string “Open” will also match “Opening”, “Opened” etc
  5359. unless you select the “Match Words” option in the Find dialog.
  5360.  
  5361. A special case: if your string begins or ends with punctuation, such
  5362. as “->structMember” then leave “Match Words” unselected.
  5363.  
  5364. “Wrap Around” will continue your search from the beginning of your
  5365. document if the next Find runs off the bottom end of it. 
  5366.  
  5367. This also affects the Replace commands: to Replace All instances in
  5368. a file, it’s simplest to select an insertion point at the top of the
  5369. file beforehand; to Replace All instances below a certain point, click
  5370. just before the position where you want the replacing to start, and
  5371. leave “Wrap Around” deselected.
  5372.  
  5373. “Ignore Case” treats upper and lower–case letters as the same.
  5374.  
  5375. §    Batch Find options
  5376. If you click the "Batch" check box, your multi-file search will be
  5377. done all at once, and the results presented in a text window
  5378. (file name, line number, and the full line where found). To view
  5379. a particular found instance in the original file, click on the result
  5380. line and use "Go to...".
  5381.  
  5382. For Batch finds, if you select "List markers" then the line that lists
  5383. a particular location will include the containing function name.
  5384. Here's an example result (results appear in the stdout window):
  5385. ____
  5386. Batch find results for: «nextName»
  5387. --------------------------------------------
  5388. «CEDAR_AutoLook.c»  3513 |ResolveOneLink| Boolean ResolveOneLink(StringPtr t1, short nextName, Handle *hTextP, long *primaryLinkP)
  5389. «CEDAR_AutoLook.c»  3524 |ResolveOneLink|         // Note nameLink0 is set only if nextName == 0.
  5390. «CEDAR_AutoLook.c»  3841 |GetSomeTypeNameForMember| /* typeLink1 is the index of a type name, nextName is sNameChain index
  5391. «CEDAR_AutoLook.c»  3843 |GetSomeTypeNameForMember| for nextName (and if nextName is 0 set nameLink0), return TRUE;
  5392. ____
  5393. Once again, to jump to a particular instance, click on the line that
  5394. contains the file location and use "Go to...".
  5395.  
  5396. Please see "§    Skip '-' : excluding files from a search" below if you wish
  5397. to skip certain files easily while searching or carrying out some
  5398. other multi-file operation.
  5399.  
  5400. §    Dual Batch Find
  5401. Translated into English, the dialog that appears when you click the
  5402. Dual Batch Find button in the Find dialog lets you do "Find two
  5403. strings wihin a certain number of lines or characters of each
  5404. other". This is a multi-file operation, that is it looks in files
  5405. that you've bulleted for multi-file searches, and it's a Batch
  5406. operation in that it presents its result in the stdout window.
  5407.  
  5408. To find the two strings on the same line, enter a zero for the
  5409. number of lines. Zero characters means the two strings must
  5410. be found right together with no characters in between.
  5411.  
  5412. Dual Batch Find is a sort of mini-grep for dummies (like me).
  5413. hAWK can perform full grep searches if you need the extra power
  5414. (but in practice I've found that setting up grep searches is too
  5415. error-prone for casual use).
  5416.  
  5417. §    <Tab> and <Return>
  5418. A plain <Tab> will jump your cursor from one edit field to the other,
  5419. and a plain <Return> is the equivalent of the “Find” button. To enter
  5420. a <Tab> or <Return> in either the find or the replace text, hold down
  5421. the <Command> key while typing the character.
  5422.  
  5423.  
  5424. §    Find again
  5425. This menu command is the equivalent of the “Find” button in the Find
  5426. dialog, and finds the next instance of your find string in accordance
  5427. with your Find options (see above). Find Again searches the front
  5428. window, or, if the Find dialog is in front, the window just behind the
  5429. Find dialog.
  5430.  
  5431. Find Again also works with the project window, allowing you to search
  5432. for part of a file name in a long list of files. It searches the active
  5433. pane only (the one with filled-in scroll bars).
  5434.  
  5435.  
  5436. §    Enter selection
  5437. Enter Selection will replace your current find string with whatever
  5438. text you have selected. It works with any text window including lookup
  5439. windows, and also the project window (in case you wish to search for
  5440. a file name). If your Find dialog is on–screen, you will see the new
  5441. find string in the dialog.
  5442.  
  5443.  
  5444. §    Recent finds are remembered
  5445. Your most–recent find strings will be stored in the popup “Find:” menu
  5446. at top–left of the Find dialog. Selecting an item from the popup will
  5447. copy it to your find string box.
  5448.  
  5449. Two minor limitations apply: find strings containing <Return>s or more
  5450. than 48 characters will not be remembered by the popup menu.
  5451.  
  5452.  
  5453.  
  5454.  
  5455.  
  5456.  
  5457.  
  5458.  
  5459.  
  5460.  
  5461.  
  5462.  
  5463.  
  5464.  
  5465.  
  5466.  
  5467.  
  5468.  
  5469.  
  5470.  
  5471.  
  5472.  
  5473.  
  5474.  
  5475. §    Replace
  5476. Replace can be thought of as a Paste for short strings (up to 255
  5477. characters). The replacement text is taken from the replace string in
  5478. the Find dialog. No checking is done to see if the selection that will
  5479. be replaced corresponds to your find string, so the replacement string
  5480. can in effect be used as a second (small) clipboard. To set up a choice
  5481. between two “Paste” alternatives, enter one selection into the
  5482. replacement string in the Find dialog, and then Copy the other
  5483. selection. Then Paste or Replace in your document as appropriate.
  5484.  
  5485. If the Find dialog is in front, Replace will affect the window just
  5486. behind the Find dialog.
  5487.  
  5488. Replace is undoable provided the window in which the Replace was done
  5489. is in front, and provided you don’t perform some other undoable action
  5490. before undoing.
  5491.  
  5492.  
  5493. §    Replace and Find Again
  5494. This command is the exact equivalent of Replace followed by Find Again,
  5495. and is undoable.
  5496.  
  5497.  
  5498. §    Replace All
  5499. Unlike other search commands, Replace All cannot be called when the
  5500. Find dialog is in front—you must specifically bring frontmost the
  5501. window in which you wish to use Replace All. This small awkwardness
  5502. is an attempt to remind you that Replace All is the one editing command
  5503. that can make a real mess of your document. However, it is undoable—as
  5504. with other undoable operations, you need only have the correct window
  5505. in front before undoing.
  5506.  
  5507. If you have selected the “Wrap Around” option in the Find dialog,
  5508. Replace All will indeed replace all instances of the find string with
  5509. the replace string throughout your document. If “Wrap Around” is not
  5510. checked, replacement will be done only below your current position in
  5511. the text. To prevent a single instance of the find pattern from being
  5512. replaced, select at least the first character of the instance in your
  5513. document just before Replace All (selecting all of it will do).
  5514.  
  5515.  
  5516. §    Multi–file searches
  5517. Any file in your project can be added to a list of files to be
  5518. searched. Files that are included in a multi–file search will have a
  5519. bullet • just to the left of the name in the project window.
  5520.  
  5521. “Coarse” setup of the multi–file search is done with the small buttons
  5522. in the lower–right of the Find dialog. These allow you to select all
  5523. files of a particular type—.c, ".h", <.h>, or plain text. The “None”
  5524. button will clear the multi–file search selection, and the “All” button
  5525. will add all of your project text files to the list. A counter in the
  5526. Find dialog shows how many files will be searched.
  5527.  
  5528. To “fine–tune” your list of files to be searched, hold down the
  5529. <Option> key and click on or drag over the files in the project window.
  5530. The cursor will change to an eye, and bullets beside the file names
  5531. will appear or disappear as you drag up and down over the files. There
  5532. is an illustration of this near the beginning of this chapter.
  5533.  
  5534. Once your files are selected (and you’ve entered what you want found
  5535. in the find string in the Find dialog) select Find In Next File or
  5536. click the equivalent button in the Find dialog. As the search
  5537. progresses, you will see the bullets beside file names in the project
  5538. window disappear as each file is searched. The counter in the Find
  5539. dialog will also count down the number of files remaining. If an open
  5540. file is searched by Find In Next File, it will be searched from the
  5541. beginning of the file. When an instance is found, Find Again will
  5542. locate other instances in the same file. To continue the multi–file
  5543. search with the next  file, select Find In Next File again.When all
  5544. files have been searched, you’ll hear a beep, the counter in the Find
  5545. dialog will read zero, and all bullets will be gone from the project
  5546. window.
  5547. Even if you don’t find anything, it puts on a nice show.
  5548.  
  5549. A <Command><period> will interrupt a multi–file search, and also clear
  5550. the list of files to be searched.
  5551.  
  5552. To generate a list of all instances of your search string, click
  5553. the "Batch" check box before doing your Find In Next File. Results
  5554. of the search will be shown to you in the "$tempStdOut" window
  5555. in the format «file name» line-number line-where-found, and
  5556. to view a particular instance in its original context click on the
  5557. line and use "Go to...".
  5558.  
  5559. By the way, your list of bulleted files in the project window can also
  5560. be used to remove those files from your project (see “Remove •'d Files”
  5561. in the “Projects” chapter), and used by a hAWK program as a list of
  5562. input files (see Appendix 2, and the hAWK User’s Manual on disk 2).
  5563.  
  5564.  
  5565.  
  5566.  
  5567.  
  5568.  
  5569.  
  5570.  
  5571.  
  5572.  
  5573.  
  5574.  
  5575.  
  5576.  
  5577.  
  5578. §    Skip '-' : excluding files from a search
  5579. In the Find dialog, the "Skip '-'" checkbox lets you exclude project files
  5580. that are marked with a dash '-' when carrying out a multi-file operation
  5581. such as searching. These dashes are primarily used to exclude files
  5582. from a dictionary build, and are placed by holding down the <Command>
  5583. key and clicking on the file's name in the project window. But you
  5584. may also wish to skip over these files when multi-file searching: if
  5585. so, you should turn this checkbox on in the Find dialog before
  5586. carrying out the search. Note if the "Skip '-'" option is on, then files
  5587. with a '-' beside them will not be passed to hAWK in your multi-file
  5588. selection, and they will not be removed from your project when
  5589. you pick "Remove •'d Files", whether or not they have bullets beside
  5590. them. Neither will they be selected or deselected for searching if
  5591. you click on the "All" or "None" buttons in the Find dialog.
  5592.  
  5593. If you have the "Skip '-'" checkbox turned on, then when you fine-tune
  5594. your multi-file selection by <Option>clicking in the project window
  5595. you will not be able to place bullets beside files that have a dash '-'
  5596. beside them. But note that "Skip '-'" takes precedence, so if you
  5597. put bullets beside files that have dashes and then turn on "Skip '-'",
  5598. those dashed files will not be included in multi-file operations.
  5599. At any time, the "Files to search:" number in the Find dialog
  5600. accurately shows the total number of files that will be searched,
  5601. so if "Skip '-'" is on then dashed files will not be included in the total.
  5602.  
  5603. To run a multi-file operation (such as the hAWK program
  5604. "$EchoFullPathNames", or a Batch Find) on just files that
  5605. are not marked with a '-':
  5606.     • select "Skip '-'"
  5607.     • mark the files with bullets (eg by clicking the All ".c" button
  5608.         or by holding down the <Option> key and clicking on project file
  5609.         names)
  5610.     • run the multi-file operation.
  5611.  
  5612. To run a multi-file operation on all excluded files, ie those
  5613. that are marked with a '-':
  5614.     • deselect "Skip '-'"
  5615.     • click the "All" button in the Find dialog
  5616.     • select "Skip '-'"
  5617.     • click the "None" button in the Find dialog
  5618.         (this will leave bullets beside files marked with a '-')
  5619.     • deselect "Skip '-'" again so the bulleted files won't be ignored
  5620.     • run the multi-file operation.
  5621.  
  5622. §    THINK Find commands
  5623. Located under the Search menu near the bottom, three commands allow
  5624. you to make use of the THINK Project Manager's "Find" results from
  5625. within EnterAct. To use these commands, you must use THINK C 6 or
  5626. later, and set up EnterAct as the Project Manager's editor as described
  5627. in Appendix 4 here.
  5628.  
  5629. After completing a "batch" find in THINK C, you can use the THINK
  5630. Find Again and THINK Find Previous commands to step through the
  5631. results. These two commands work only with the results of a
  5632. batch find.
  5633.  
  5634. To start or continue a multi-file search using the THINK Project
  5635. Manager's multi-file search rather than EnterAct's, use the
  5636. THINK Find In Next File commands after setting up the (non-batch)
  5637. search in the THINK Project Manager. Note this means you can perform
  5638. and even alternate between two separate multi-file searches, THINK's
  5639. and EnterAct's.
  5640.  
  5641. Find in THINK Reference does the same thing as the command of the
  5642. same name in the THINK Project Manager's editor: it passes your
  5643. currently-selected text over to THINK Reference, where you'll be
  5644. shown any entry it has on the name in question. Note this works only
  5645. with THINK Reference version 2 or later.
  5646.  
  5647. To use EnterAct's "Find in THINK Reference" command under any
  5648. circumstances, create a folder named "Tools" or "(Tools)" next
  5649. to EnterAct and drop an alias of Think Reference in it.
  5650.  
  5651. Find in Toolbox Assistant is much the same, just drop an
  5652. alias of QuickView in your Tools folder.
  5653.  
  5654. -    -    -    -    -    -    -    -    -    -    -    -
  5655. “Go” commands
  5656. -    -    -    -    -    -    -    -    -    -    -    -
  5657. Of the four “Go” commands under the Search menu, the most important
  5658. is the “Go to” command. This command allows you to jump to any marked
  5659. position in any project file, and since the marker position is
  5660. maintained as you edit, so is your ability to jump to it. The standard
  5661. suite of “go” capabilities is also available.
  5662.  
  5663.  
  5664. §    Go to Top/Bottom
  5665. The Go to Top and Go to Bottom menu commands do the same thing as
  5666. <Option><up arrow> and <Option><down arrow>, namely take you to the
  5667. top or bottom of your text window. They also function in the project
  5668. window.
  5669.  
  5670.  
  5671. §    Go to
  5672. The Go to command allows you to jump to a fixed position or a marker,
  5673. based on the text you have selected in your front window. The position
  5674. or marker can be in any project file.
  5675.  
  5676. For example, you can jump to a specific marker in a specific project
  5677. file with Go to. And there is an easy way to generate the file name
  5678. and marker name text (pick the marker from its popup marker menu while
  5679. holding down the <Shift> key), as explained in “Going to markers” a
  5680. couple of pages ahead. A typical link of this form in your code might
  5681. look like
  5682. ____
  5683.     /* See «MyProject Log» «Conversation with J.B. re New Features» */
  5684. ____
  5685. where the project file is “MyProject Log” and the marker name is inside
  5686. the second set of Euorpean quotes «». You could jump to the marker in
  5687. your “MyProject Log” file by clicking anywhere on the line mentioning
  5688. the file and marker and then selecting Go to. Selecting the
  5689. entire file name and marker name including the surrounding «» quotes
  5690. would also work. Since markers are maintained by most editors
  5691. (EnterAct, THINK C, and MPW for example), links of this form will also
  5692. be maintained as long as the marker exists and the file is in your
  5693. current project.
  5694.  
  5695. (If both file name and marker name are in «» quotes, then both file
  5696. and marker name can be highly abbreviated, eg
  5697. ____
  5698.     /* See «Log»«J.B. News» */
  5699. ____
  5700. —as with regular lookup, your spelling just needs to be
  5701. “distinctively close”, in terms of runs of matching characters
  5702. when comparing against file and marker names in your project.
  5703.  
  5704. Go to also works with file names or marker names alone, or with line
  5705. and character positions in a file, or with file name followed by line
  5706. and character position. And it also accepts full path names.
  5707.  
  5708. The following terms are used below to help summarize selection
  5709. possibilities:
  5710.     • file_name:         the name of a project file, optionally enclosed in
  5711.     European-style quotes, ie «». Your selection will be extended to
  5712.     include any trailing file extension (such as “.c” or “.NOTES”),
  5713.     provided your basic selection is not by itself the name of a project
  5714.     file. This could also be a full path name.
  5715.     • marker_name:     the name of a marker in a project file, optionally
  5716.     enclosed in European style quotes «». Note the name of the marker
  5717.     should be specified, not the text (if any) that is selected when you
  5718.     jump to the mark.
  5719.     • text_position:     line number, optionally followed by character position
  5720.     on the line, for example 123 6 to specify the 123rd line in a file,
  5721.     just before the 6th character. The first line in a file is line 1, and
  5722.     the insertion point before the first character on a line is character
  5723.     position 1.
  5724.     • other_text:     by itself, text that is none of the above; following a
  5725.     file_name, text that is not a marker_name or text_position.
  5726.     • insertion_point: an empty selection.
  5727.  
  5728. Go to acts on selections in the following ways:
  5729.     • file_name     :            open the project file, or just bring it to the front if
  5730.                                     open
  5731.     • marker_name :        equivalent to selecting the marker from the
  5732.                                     window’s marker menu
  5733.     • text_position :        go to the position specified
  5734.     • file_name marker_name :     open the project file or bring it to front, and
  5735.                                     go to the marker specified
  5736.     • file_name text_position :     open the project file or bring it to front,
  5737.                                     and go to the position specified
  5738.     • file_name other_text :    open the project file or bring it to front, then
  5739.                                     use “Find” on the other_text in an attempt to
  5740.                                     locate it
  5741.     • other_text :            display a dialog in which to enter a line number
  5742.                                     to jump to.
  5743.     • insertion_point :    if the text of the link is quoted, ie file_name or
  5744.                                     marker_name if present are within «» quotes, then
  5745.                                     clicking anywhere on the line is sufficient to select
  5746.                                     the link for goto purposes. Otherwise, you will be
  5747.                                     shown the line number dialog, as with “other_text”
  5748.  
  5749. Note if both file name and marker name are in «» quotes you can use
  5750. extremely abbreviated versions of the names: the file name just has
  5751. to be "distinctively close" to the name of a project file, likewise
  5752. the marker name to a marker in that file.
  5753.  
  5754. Selections intended for the Go to command are called Go to selections
  5755. or “Go to” links in this manual. Here are some examples:
  5756.  
  5757.  
  5758. (a file_name link: note selecting the “.h” is optional)
  5759.  
  5760.  
  5761. (file_name in quotes followed by line number and character position
  5762. on line—for Go to, any insertion point on the line will do)
  5763.  
  5764.  
  5765.  
  5766. (instead of an insertion point, you can select all of the file_name
  5767. text_position)
  5768.  
  5769.  
  5770.  
  5771. (unquoted version of the same)
  5772.  
  5773.  
  5774.  
  5775. (file_name marker_name: with both in quotes, your selection can be
  5776. an insertion point anywhere on the line, here between the file and
  5777. marker names)
  5778.  
  5779.  
  5780.  
  5781.  
  5782. (without quotes, you must select the entire file_name marker_name)
  5783.  
  5784.  
  5785.  
  5786.  
  5787. (a marker-name link in the document “Proj Interface.DSGN”? Probably.
  5788. But it could also be a file name, or a marker in some other document.
  5789. The context of your current project and front window will determine
  5790. what  «Modifier keys»  is, and where you go to. Note for Go to
  5791. purposes, you could also just click in the line rather than selecting.
  5792.  
  5793. The one important restriction on Go to is that if you specify a file
  5794. name, the file you are going to must be in your currently open project.
  5795. If it isn’t, you can add it with the Add Files command.
  5796.  
  5797. To resolve ambiguity, file names take precedence over marker names.
  5798. And if you should have a marker name that looks like a text position,
  5799. enclosing it in quotes«» will force treatment as a marker name.
  5800.  
  5801. The file name can be the name of a PICT file, by the way, allowing you
  5802. to use single pictures as popup illustrations. And Go to works with
  5803. file names selected in the project window, performing the same as if
  5804. you double-clicked on the file name to open the file.
  5805.  
  5806. Spaces or tabs before, between, or after the components of a Go to
  5807. selection will be ignored. Hence the enclosing «» quotes are required
  5808. if a file name or marker  name begins or ends with “white space”.
  5809. Otherwise they’re optional, but quotes do help Go to selections to
  5810. stand out quietly from the surrounding text. And if both file name and
  5811. marker names are quoted, clicking anywhere on the line is
  5812. equivalent to selecting both parts for Go to purposes, a handy
  5813. shortcut. Quotes are included when you copy a marker name (and file
  5814. name) from a marker menu, as explained in “Going to markers” on the
  5815. next page.
  5816.  
  5817. If you have included a file name in your Go to selection but are
  5818. immediately shown the line number dialog instead of the desired file,
  5819. this means you haven’t yet added the file to your project. If you see
  5820. a message that the file couldn’t be found, this means the file has been
  5821. moved, renamed, or deleted since you added it to your project, and the
  5822. solution is to delete the file from your project and re-add it. If a
  5823. line that you go to seems to be the wrong line, this normally just
  5824. means that the file has been edited (lines added or deleted) since the
  5825. line number was specified. And if going to a marker doesn’t work, this
  5826. usually means that the marker has been deleted from the file (note that
  5827. if you delete the actual text marked then you lose the marker, even
  5828. if you immediately undo the delete).
  5829.  
  5830. File-name line-number links are of limited use, since the line numbers
  5831. can quickly become obsolete. Links of this form are however generated
  5832. by EnterAct and by hAWK programs when displaying lists of positions
  5833. (see the next section). File-name marker-name links are better for your
  5834. own use since their locations are maintained for you, and you’ll find
  5835. in the “Going to markers” section below an easy way to generate the
  5836. necessary text for them. And any existing mention of a file name or
  5837. marker name in any of your project documents is now a “Go to” link,
  5838. as you no doubt gathered -- just add the corresponding document to
  5839. your project.
  5840.  
  5841. §    Going to included files
  5842. To jump to the top of an included file such as
  5843. ____
  5844.     #include "thisheader.h"
  5845. ____
  5846. click on the line and select "Go to...".
  5847.  
  5848. Note if you have more than one header file with the same name
  5849. in your project you might not get the right one.
  5850.  
  5851. §    Going to text positions
  5852. Text positions compatible with the Go to command are displayed by the
  5853. Show Activities command, for example:
  5854. ____
  5855.     ¶60
  5856.     Sat Jan 16, 1993 10:51:48 pm PASTE «hAWK_FilesandClip.c» 390 4
  5857.     =>inserted 50 characters:
  5858.     «if (!dirs && !(fpb->ioFlAttrib & 16)) /* a file */»
  5859.     ¬
  5860. ____
  5861. To see the place where this paste took place, you would select
  5862. “«hAWK_FilesandClip.c» 390 4”, or just click in the line
  5863. somewhere, and then Go to. For details, please see the “Show
  5864. Activities” chapter. For now, note that the Show Activities
  5865. command can update the text positions (and even file names) for
  5866. you, to keep them as current as theoretically possible, which is to
  5867. say almost always useful.
  5868.  
  5869. Many hAWK programs generate file-name line-number text that is
  5870. compatible with the Go to command. For example, $CompareFiles shows
  5871. document differences in this form, and $XRef generates file name and
  5872. line number listings for C terms in your source code. Several of
  5873. the Index commands under the EnterAct menu also generate line
  5874. numbers.
  5875.  
  5876. Text positions can be used to link documents together, but you’ll
  5877. usually find it better to use marker names instead (see just below).
  5878. The reason is that marker positions are maintained as you edit files,
  5879. whereas line numbers can go out of date quickly.
  5880.  
  5881.  
  5882. §    Going to markers
  5883. The ability to “go to” any marker in any project file means you can
  5884. use a file name followed by a marker name as a true “hyperlink”,
  5885. especially useful for placing references to supporting documentation
  5886. in your source files or other documents.
  5887.  
  5888. To generate the necessary text for establishing a file-name marker-name
  5889. link:
  5890.     •    open the file that contains the marker
  5891.     •    hold down the <Shift> and <Option> keys, and click-and-drag in the
  5892.         window’s title bar to access the popup marker menu; select the marker
  5893.         you want
  5894.     •    the link, in the form «file name» «marker name» , is now on the
  5895.         clipboard, ready for pasting.
  5896.     •    (note <Shift> <Command> will also work when picking from a marker
  5897.         menu)
  5898.  
  5899. EnterAct places «» quotes around both the file name and the marker name.
  5900.  
  5901. To generate file-name marker-name link text for all markers in one or
  5902. more files, use the "Index Marker Names" command under the EnterAct
  5903. menu, as described in the "'Index' commands" chapter.
  5904.  
  5905. With quotes around both the file name and marker name, you can “select”
  5906. a file-name marker-name for Go to purposes by clicking anywhere on
  5907. the line if it's the only link on the file, or between the two quoted
  5908. bits of text otherwise. Your selection will be expanded to include the
  5909. quoted file name and marker names when you pick Go to. And with
  5910. both file and marker name in «» quotes you can use highly abbreviated,
  5911. even slightly incorrect versions of the names, provided those names
  5912. are distinctively close to the names of a file in your project and a
  5913. marker in that file (in terms of case-sensitive runs of matching
  5914. characters).
  5915.  
  5916.  
  5917.  
  5918.  
  5919.  
  5920.  
  5921.  
  5922.  
  5923.  
  5924.  
  5925.  
  5926.  
  5927.  
  5928.  
  5929.  
  5930.  
  5931.  
  5932.  
  5933.  
  5934.  
  5935.  
  5936.  
  5937.  
  5938.  
  5939.  
  5940.  
  5941.  
  5942.  
  5943. To go to the position referenced by a file-name marker-name link,
  5944. click on the line containing the link text,
  5945. and then issue a Go to (see next illustration).
  5946.  
  5947. On the chance that too many new things at once have pushed some old
  5948. things out the bottom of your memory stack, a reminder that to jump
  5949. to the definition of a term that’s in your current project dictionary
  5950. just <Option> double-click on it. File-name marker-name links are
  5951. mainly for jumping to places in your (unparseable) supporting
  5952. documentation.
  5953.  
  5954. Tip: if you want to be able to jump to an illustration in a text file,
  5955. mark its location and then copy the marker name for pasting elsewhere.
  5956.  
  5957.  
  5958. §    Go Back
  5959. This command takes you back to your last signficantly different
  5960. position in a text file. Usually the two positions will be in the same
  5961. file, and a typical use is to “toggle” back and forth within a function
  5962. between the spot where you’re creating code and the top of the function
  5963. where the locals and parameters are declared.
  5964.  
  5965. Whenever you move your insertion point or make a new selection, you
  5966. define a “significantly different” position to go back to if you: bring
  5967. a different text window to the front, or; click more than 3/4 of a
  5968. window away from your previous position. You can alter your current
  5969. position without spoiling the memory of your previous position by
  5970. inching along—click half a window away, scroll, click half a window
  5971. away, scroll….
  5972.  
  5973. You can also toggle between two positions in a file with markers, or
  5974. “go to” links, or by pressing <Enter> to switch between the top and
  5975. bottom ends of a large selection.
  5976.  
  5977.  
  5978.  
  5979.  
  5980.  
  5981.  
  5982.  
  5983.  
  5984.  
  5985.  
  5986.  
  5987.  
  5988.  
  5989.  
  5990.  
  5991.  
  5992.  
  5993.  
  5994.  
  5995.  
  5996.  
  5997.  
  5998.  
  5999.  
  6000.  
  6001.  
  6002.  
  6003.  
  6004.  
  6005.  
  6006.  
  6007.  
  6008.  
  6009.  
  6010.  
  6011.  
  6012.  
  6013.  
  6014.  
  6015.  
  6016.  
  6017.  
  6018.  
  6019.  
  6020.  
  6021. (Note the link text
  6022.     «hAWK User's Manual» «F        Running hAWK programs»
  6023. could have been abbreviated as say
  6024.     «hAWK Man»«running»
  6025. —when both file and marker name are in «» quotes, the file
  6026. and marker names just have to be reasonably close to the
  6027. actual names.)
  6028.  
  6029. -    -    -    -    -    -    -    -    -    -    -    - - -
  6030. Markers and the Locations menu
  6031. -    -    -    -    -    -    -    -    -    -    -    - - -
  6032. §    Introduction
  6033. A “marker” is a marked location in your text consisting of a start
  6034. point, an end point, and a name to be associated with the marked
  6035. position. Typically, you’ll place markers in your C source files
  6036. all at once with the Automark command, and you’ll place markers in
  6037. supporting documents one-at-a-time with the Mark command. Marks can
  6038. be placed in header files with Automark, but you may prefer to use
  6039. Mark. To bring up a popup menu of a window’s markers, hold down the
  6040. <Option> or <Command> key and click in the window’s title bar.
  6041.  
  6042. EnterAct's default behavior is to automatically generate markers
  6043. for all functions in source files and all struct/class definitions
  6044. in header files as you open or save the files, and to not save those
  6045. markers with the document. If you manually insert markers in a
  6046. document that goes in your project's rightmost (documentation)
  6047. pane, these markers will be saved with your document when you
  6048. save the file (this manual is an example). You can force EnterAct
  6049. to save source and header file markers with your files by
  6050. enabling the the “Save source/headers marks” option, but the
  6051. only use for this at present is to allow the “Index Marker Names…”
  6052. command to index marks in your source files.
  6053.  
  6054. At present EnterAct does not support #pragmas for inserting
  6055. special markers in source files.
  6056.  
  6057. Markers do stay attached to the proper position as you edit the file
  6058. around them, but any editing that’s done inside the marked range will
  6059. correspondingly expand or shrink the range associated with the marker.
  6060. If you remove all of the text that is within the marked range, you will
  6061. also remove the marker, and this is not undoable. Markers do not
  6062. survive cutting or pasting—they stay attached to the text only as long
  6063. as the text remains in the document. 
  6064.  
  6065. The Automark command is mainly useful to mark all of the function
  6066. definitions in a source file, though it has other options, and can be
  6067. used to mark a variety of C constructs, with the option of marking just
  6068. the first in a group.
  6069.  
  6070. Marker names can be used as links within or between files, in
  6071. conjunction with the Go to command. Called “Go to” links, these take
  6072. the form
  6073. ____
  6074.     «file name» «marker name»
  6075. ____
  6076. where the enclosing «» quotes are usually optional. Where a link is
  6077. present in your text, you can go to it by selecting the file name and
  6078. marker name (including «» quotes if present), or by clicking anywhere
  6079. on the line, and issuing the Go to command. For an easy way to
  6080. generate the text for these links, see “Copying marker names” below.
  6081. You’ll find details on using “Go to” links in the “‘Go’ commands”
  6082. chapter.
  6083.  
  6084. Please note your markers will be maintained properly only by editors
  6085. that implement MPW–compatible marks. However, if you use Automark to
  6086. set all of your marks in a source file, then re–marking such a file
  6087. after editing it with such an editor will be relatively painless—just
  6088. use Automark again with your preferred options checked, and check
  6089. “Clear all present markers first”. Normally, however, you won't
  6090. have to re-mark a source file yourself; Enteract's default behaviour
  6091. is to re-mark source files for you automatically if they have been
  6092. changed by another editor (this is an option in the "Options..." dialog).
  6093.  
  6094.  
  6095. §    Mark
  6096. To place a single marker, select either an insertion point or the range
  6097. of text that you want remembered, and then select the Mark command.
  6098. You will be asked to supply or modify a name for the marker: click Add,
  6099. and then forever after you will be able to jump to that marker whenever
  6100. you want (marks are saved to disk and properly maintained).
  6101.  
  6102.  
  6103.  
  6104.  
  6105.  
  6106.  
  6107.  
  6108.  
  6109.  
  6110.  
  6111. §    Marker menus
  6112. Every document containing marks has a popup marker menu associated with
  6113. its window. To jump to a marker, hold down either the <Option> or
  6114. <Command> key or both and click-and-hold in the title bar of your
  6115. window. You’ll see a popup menu listing all of the markers attached
  6116. to your file. Pick one, and you go there. The markers are in
  6117. alphabetical order.
  6118.  
  6119.  
  6120.  
  6121.  
  6122.  
  6123.  
  6124.  
  6125.  
  6126.  
  6127.  
  6128.  
  6129.  
  6130.  
  6131.  
  6132.  
  6133.  
  6134.  
  6135.  
  6136.  
  6137.  
  6138.  
  6139.  
  6140.  
  6141.  
  6142.  
  6143.  
  6144.  
  6145.  
  6146. If the name of a marker is present in your text, you can also go to
  6147. it by selecting the name and using the Go to command, as explained in
  6148. the “‘Go’ commands” chapter.
  6149.  
  6150.  
  6151.  
  6152. §    Unmark
  6153. To remove one or more markers, select Unmark. You will be presented
  6154. with a list of markers to select for deletion. This list follows the
  6155. standard Macintosh rules for list selection: click with no keys held
  6156. down to select a single marker (this deselects any other selected
  6157. markers); click with the <Shift> key down to select a contiguous range
  6158. of markers while dragging the mouse; and click with the <Command> key
  6159. held down to select a marker that is away from other selected markers
  6160. (the markers in between are left unselected). 
  6161.  
  6162.  
  6163.  
  6164.  
  6165.  
  6166.  
  6167.  
  6168.  
  6169.  
  6170.  
  6171.  
  6172.  
  6173.  
  6174.  
  6175.  
  6176. To quickly remove all markers from a document, use the Automark command
  6177. with only the “Clear all present markers first” option checked.
  6178.  
  6179.  
  6180. §    Automark
  6181. (Note: The "AutoMark source..." check box in the Options dialog
  6182. will create marks for all functions in a source file when you open it,
  6183. if the file has in the meantime been changed by some other editor.
  6184. This is handy if you're using EnterAct in conjunction with some other
  6185. editor that doesn't support markers, such as CodeWarrior. This option
  6186. is fast enough on most machines that you can just leave it checked
  6187. and not worry about it.)
  6188.  
  6189. This command works with any first-draft or compilable C file, whether
  6190. or not it has been added to your project. You’ll find its main use is
  6191. to mark all of the function definitions in a source file, after
  6192. deleting any existing markers, and this is the default action.
  6193.  
  6194.  
  6195.  
  6196.  
  6197.  
  6198.  
  6199.  
  6200.  
  6201.  
  6202.  
  6203.  
  6204.  
  6205.  
  6206.  
  6207.  
  6208. If you wish to keep special markers that you have manually added, leave
  6209. “Clear all present markers first” without a check mark. When a
  6210. duplicate name or position is found while adding markers, the new entry
  6211. will replace the old one.
  6212.  
  6213. The “first of group only” checks have slightly different
  6214. interpretations: for #defines, it means mark only the first of a group
  6215. of consecutive #defines; for enum constants, it means mark only the
  6216. first within an enum {} statement; and for variables it means mark the
  6217. first of a group of consecutive variables, whether they occur in the
  6218. same statement or in separate statements. If you leave some types
  6219. unselected then EnterAct’s automarker won’t count them as separating,
  6220. say, two groups of variables or #define’s.
  6221.  
  6222. To keep things sane, there is a limit of 499 marks to a file. This is
  6223. a 9 foot popup menu, a bit tedious to scroll through even with a 68070.
  6224. Marker names are limited to 63 characters, but the range of text you
  6225. mark with the name can be as long as you want.
  6226.  
  6227. The Automark command can be used to remove all marks from any file
  6228. (source or not), by checking just the “Clear all present markers first”
  6229. option.
  6230.  
  6231.  
  6232.  
  6233. §    Copying marker names
  6234. To put text of the form «file name» «marker name» on the clipboard for
  6235. a particular marker, hold down the<Shift> key and either the <Option>
  6236. of <Command> key while clicking in the title bar of the marker’s window
  6237. to access the marker popup menu; selecting the marker from the popup
  6238. will put the text on your clipboard. This is the same as going to the
  6239. mark by selecting it from the popup marker menu, except that in
  6240. addition you hold down the <Shift> key.
  6241.  
  6242.  
  6243.  
  6244.  
  6245.  
  6246.  
  6247.  
  6248.  
  6249.  
  6250.  
  6251.  
  6252.  
  6253.  
  6254.  
  6255.  
  6256.  
  6257.  
  6258.  
  6259.  
  6260.  
  6261.  
  6262.  
  6263.  
  6264.  
  6265.  
  6266.  
  6267.  
  6268.  
  6269.  
  6270. Text of the form «file name» «marker name»  can be used with the Go
  6271. to command to jump to any marker in any project file, and variations
  6272. on this theme are available as detailed in the “‘Go’ commands” chapter.
  6273.  
  6274. §    The Locations menu
  6275. This menu allows you to mark and jump to up to 10 different locations.
  6276. You can mark positions in any text file, and they stay recorded in the
  6277. Locations menu until you delete them, independent of whatever project
  6278. you might have open. This is a generalization of the "Go Back" command,
  6279. allowing you to go back to any specific location.
  6280.  
  6281. If you edit files with some other editor, your remembered locations
  6282. may be thrown off, in which case you could delete and re-add them.
  6283. (Function and struct markers that are created automatically by
  6284. EnterAct are not thrown off if you edit files with some other editor.)
  6285.  
  6286. To add a position to the Locations menu:
  6287.     • select the position you want, and optionally some text there
  6288.     • pick Add Current Location from the Locations menu
  6289.     • a dialog will appear which allows you to set the position's
  6290.     name as it will appear under the Locations menu: if you selected
  6291.     some text at the position to be marked, that text will appear in
  6292.     the dialog. You can edit the name, put in an arbitrary name, or
  6293.     have no name at all--in this case, EnterAct will concoct a name
  6294.     for you, made up of the file name, line position, any enclosing
  6295.     function name and maybe other stuff.
  6296.  
  6297. To jump to a position you've added to the Locations menu:
  6298.     • pick it from the Locations menu.
  6299.  
  6300. To delete a position from the Locations menu:
  6301.     • go to the position (pick it from the Locations menu for example)
  6302.     • select Delete Current Location from the Locations menu
  6303.     • if the location can't be found, you will be asked if you want to
  6304.         delete the location from the menu.
  6305.  
  6306. When you hit the limit of 10 marked locations, you won't be able
  6307. to add any more until you delete one of the remembered locations.
  6308.  
  6309.  
  6310. -    -    -    -    -    -    -    -    -    -    -    -
  6311. Options, under the Edit menu
  6312. -    -    -    -    -    -    -    -    -    -    -    -
  6313.  
  6314.  
  6315.  
  6316.  
  6317.  
  6318.  
  6319.  
  6320.  
  6321.  
  6322.  
  6323.  
  6324.  
  6325.  
  6326.  
  6327.  
  6328.  
  6329.  
  6330.  
  6331.  
  6332.  
  6333.  
  6334.  
  6335. §    Introduction
  6336. You can change any of the options at any time. Defaults for the options
  6337. are shown in the figure above, and have been selected to give best
  6338. performance under average conditions. Options are saved with EnterAct
  6339. itself rather than a project. Some of them you’ll set once and forget,
  6340. but the number of lookup windows and the number of entries per lookup
  6341. determine how cluttered your screen can get, and how many alternate
  6342. entries a lookup window will hold, so you’ll vary these two numbers
  6343. to suit particular circumstances.
  6344.  
  6345. For a discussion of “Safe switching under MultiFinder” see the next
  6346. chapter, “Switching to other applications”.
  6347.  
  6348. For a discussion of “Save activities to disk” see “Show Activities”
  6349. near the end, in the section “Turning activity recording on and off”.
  6350.  
  6351.  
  6352. §    Number of lookup windows
  6353. This box allows you to set the maximum number of lookup windows that
  6354. can appear on–screen at one time. For complicated situations you may
  6355. want more than 4, whereas on a small screen you may prefer fewer than
  6356. 4 to avoid clutter.
  6357.  
  6358.  
  6359. §    Number of entries per lookup window
  6360. The number in this box determines how may dictionary entries will be
  6361. retrieved in a lookup window, if your spelling does not match any term
  6362. in the dictionary exactly. If your spelling does match a term exactly,
  6363. all exact matches will be retrieved, up to a maximum of 60. You may
  6364. wish to temporarily increase the number in this box if your
  6365. recollection of the spelling of a term is shaky. On a regular basis,
  6366. you may prefer 3 or 5 entries rather than 4—a bit of experience will
  6367. tell.
  6368.  
  6369.  
  6370. §    Remembering window locations
  6371. By default, EnterAct will remember the window locations of all your
  6372. documents (saved in a small resource with the document). Also, you will
  6373. not be asked if you want to save changes to a document when you close
  6374. it if the only change is a change in window location (the “don’t
  6375. pester” option). You can take advantage of the remembered window
  6376. locations to work with groups of documents; arrange each group nicely
  6377. on the screen, and then if you later reopen the documents in that group
  6378. they will be arranged on–screen where you left them.
  6379.  
  6380.  
  6381. §    Long or short windows
  6382. If there is no remembered location for a document, or if you have
  6383. switched off the “Save document window locations” option, then a
  6384. newly–opened window will come up near the top of your screen, with a
  6385. relatively short or long length according to what you select in the
  6386. option “Windows open short/long by default”. You may not notice much
  6387. of a distinction if you have a small screen. This short/long option
  6388. always governs the appearance of new text windows, and of text files
  6389. created by other applications that have never been saved while using
  6390. EnterAct.
  6391.  
  6392.  
  6393. §    Reformat Selection options
  6394. Reformat Selection will rebreak the lines in a selection of text to
  6395. improve the appearance of the right margin. Aside from selecting a
  6396. “ragged right” or “full justification” look, you can also set the
  6397. maximum number of characters per line in the “Reformat line width” box.
  6398. The default of 74 gives a reasonable and printable line in Monaco 9.
  6399.  
  6400.  
  6401. §    Detect nested comment starts
  6402. This option is on by default, meaning that EnterAct will accurately
  6403. trap any single failure to properly start or end a comment, both while
  6404. building your dictionary and while balancing. If you are in the habit
  6405. of doubling up on comment starts, as in
  6406. ____
  6407.     /*#define Flag37 /* if defined, use SlowDraw */
  6408. ____
  6409. and if you are not willing to mend your ways, uncheck this option:
  6410. comment starts within a comment will then be ignored for dictionary
  6411. and balance purposes. Just make sure you type carefully!
  6412.  
  6413. §    Ignore 'ckid's
  6414. A 'ckid' is a resource that SourceServer uses to keep track of
  6415. whether a file is modifiable or read-only, and also if the file's
  6416. status has been changed from read-only to modifiable by an
  6417. editor while the file was checked out. EnterAct obeys these
  6418. resources (a "no pencil" icon appears in the window's display
  6419. box for read-only), and allows you to make changes to a
  6420. read-only file after you select the "Modify Read Only"
  6421. command.
  6422.  
  6423. Selecting "Ignore 'ckid's" in the Options dialog will force
  6424. EnterAct to completely ignore these resources. You’ll be able
  6425. to edit a file that was checked out as read-only, and the
  6426. SourceServer will never know. This can really screw things up.
  6427. Don’t do it. There, you’ve been warned.
  6428.  
  6429. §    Automark source files, Save source/headers marks
  6430. The "AutoMark source..." check box will create
  6431. marks for all functions in a source file when you open it,
  6432. and marks for struct and class definitions in headers.
  6433. The marks are redone (to pick up new functions etc) when
  6434. you save the files.
  6435.  
  6436. “Automark source/headers...” is ON by default.
  6437.  
  6438. You can force EnterAct to save source and header file markers
  6439. with your files by enabling the the “Save source/headers marks”
  6440. option, but the only use for this at present is to allow the
  6441. “Index Marker Names…” command to index marks in your source files.
  6442.  
  6443. “Save source/headers marks” is OFF by default.
  6444.  
  6445. §    Relocate files automatically
  6446. When this box is unchecked (the default), EnterAct will present
  6447. a dialog asking you to relocate a file whenever it loses track of
  6448. where a file is. This typically happens when you trash a whole
  6449. folder and replace it with a newer version. If you check this
  6450. box, then if EnterAct loses track of a file it will attempt to
  6451. relocate it without your help, by searching down from the top
  6452. level of the disk where it was last seen. If this doesn't work,
  6453. you'll still be asked to help.
  6454.  
  6455. Check the "Relocate files automatically" box only if you're sure that
  6456. each of your source files is uniquely named on the disk where you've
  6457. stored it. If you can't guarantee that, then please leave the box unchecked,
  6458. and put up with the occasional request to relocate a file -- it's no
  6459. more painful than resetting file paths with Code Warrior.
  6460.  
  6461. Note that if you just move a folder around on the same disk,
  6462. or rename a folder, EnterAct will still keep track of where
  6463. the contained files are. To make EnterAct lose track of a file,
  6464. you have to move it to a different folder, including the case of
  6465. trashing a folder and replacing it with one that has the same name.
  6466. (What about renaming the file? From EnterAct's point of view,
  6467. if you rename a file then it's a different file, and you'll have to
  6468. add it separately to your project.)
  6469.  
  6470. -    -    -    -    -    -    -    -    -    -    -    -
  6471. Switching to other applications
  6472. -    -    -    -    -    -    -    -    -    -    -    -
  6473. §    Under the Finder (System 6)
  6474. There are some nifty INIT’s that will let you switch between
  6475. applications under the Finder almost as quickly and easily as if you
  6476. were using MultiFinder—On Cue and Master Juggler come to mind.
  6477. (OK, you got me - this manual was started in 1990, and there are
  6478. a few "fossils" here and there....)
  6479.  
  6480. Whatever means you employ to switch to another application from
  6481. EnterAct while under the Finder, you will be asked if you wish to save
  6482. any documents that need saving, and they will all be closed. The
  6483. situation with MultiFinder (or System 7) is different , since documents
  6484. can be left open when switching to another application.
  6485.  
  6486.  
  6487. §    Under MultiFinder (or System 7)
  6488. If you switch from EnterAct to some other application while under
  6489. MultiFinder or System 7, you will not be required to close your
  6490. documents. This means that while using the other application you could
  6491. attempt to access documents that you have left open in EnterAct. If
  6492. this potential conflict weren’t handled, you could end up working with
  6493. two different versions of the same document, and inevitably you would
  6494. lose one version.
  6495.  
  6496. One solution to this problem would be to prevent you from opening that
  6497. document with any other application if it is left open in EnterAct.
  6498. This restrictive “my file and you can’t have it” attitude is
  6499. appropriate if an application is meant for use on a network, where
  6500. several people could want access to the same file at once.
  6501.  
  6502. However, EnterAct is not meant to be used on a network, so it does not
  6503. take this approach. Instead, when you switch, all open documents are
  6504. quietly saved if they need saving and have ever been saved before
  6505. (“untitled” documents present no problem—you can’t get at them with
  6506. another application). In addition, when you return to EnterAct,
  6507. EnterAct will check your disk to see if you have altered any of the
  6508. open documents while you were away—if so, they will be quietly
  6509. reloaded. EnterAct, if effect, opts for the “low man on the totem pole”
  6510. position when it comes to having control over file access, and does
  6511. the necessary behind–the –scenes work to allow you to leave files open
  6512. and still be able to open and change them with other applications.
  6513.  
  6514. To make this bulletproof, it will be safest if you close all text
  6515. documents when leaving the other application, since that other
  6516. application will typically not be able to compensate for files being
  6517. changed “behind its back” in EnterAct.
  6518.  
  6519. You can, if you wish, defeat this protection by unchecking the “Safe
  6520. switching under MultiFinder” option in the Options dialog. However,
  6521. EnterAct will not restrict access to open files when you switch, so
  6522. you will be entirely responsible for ensuring that you don’t end up
  6523. with two versions of the same file floating around. Closing all open
  6524. text documents before switching would be sufficient.
  6525.  
  6526.  
  6527.  
  6528.  
  6529.  
  6530.  
  6531.  
  6532.  
  6533.  
  6534.  
  6535.  
  6536.  
  6537.  
  6538.  
  6539.  
  6540.  
  6541.  
  6542.  
  6543.  
  6544.  
  6545.  
  6546. Safe switching protection can also be defeated on a per–switch basis,
  6547. by holding down any of the <Shift>, <Option>, or <Command> modifier
  6548. keys while you switch. Holding down a modifier key while you switch
  6549. out from EnterAct means that unsaved changes to files will be left
  6550. unsaved, and when you return to EnterAct any files open in EnterAct
  6551. that were changed elsewhere will not be updated for you on–screen.
  6552. Holding down a modifier key while returning to EnterAct will prevent
  6553. just the updating on–screen of any files that were changed elsewhere.
  6554. This is, on rare occasions, handy if you change a file with some other
  6555. application, realise you’ve made a mistake but can’t revert, and wish
  6556. to recover the version of your file that’s still open in EnterAct.
  6557.  
  6558. If you wish to have several people working on the same source
  6559. files at the same time with EnterAct, your best approach is to
  6560. use SourceServer or some other version of source control that
  6561. uses 'ckid's to mark files as modifiable or read-only.
  6562.  
  6563. §    Check the disk for changes
  6564. When you edit source (.c or .h) files that are in an EnterAct project
  6565. with some other application, select Update Dictionary when
  6566. you reopen the project to ensure that your dictionary is brought up
  6567. to date, unless you clearly recollect that you didn’t change anything
  6568. outside of a function body. This update typically takes only a few
  6569. seconds.
  6570.  
  6571. Only the project you have open will track which files are changed, so
  6572. if you switch to a different project you will also need to select
  6573. Update Dictionary to rebuild the dictionary if any .c or .h
  6574. files in the project were changed while the project was not open,
  6575. whether or not the files were changed with EnterAct.
  6576.  
  6577. Experience suggests that it's more efficient to update your EnterAct
  6578. dictionary when you notice that it's producing lookup that's out of
  6579. date (unless more than one person is involved, in which case you may
  6580. be better off doing the Update routinely).
  6581.  
  6582. §    Working with THINK C
  6583. This section describes working with THINK C as a separate application:
  6584. to use EnterAct as a replacement for THINK’s own editor (the “use
  6585. external editor” Edit option in THINK C version 6 or later) please see
  6586. Appendix 4.
  6587.  
  6588. If you adopt EnterAct as your C editor of choice, you’ll often change
  6589. several files with EnterAct over an extended period, and then switch
  6590. to THINK C to bring your application up to date. Fortunately, there
  6591. is no need to keep exact track of which files you change, since THINK
  6592. C’s Make command can do this for you. Call up the Make dialog, click
  6593. the “Use Disk” button, and, after the brief wait while THINK C checks
  6594. the modification dates of your project files, click the “Make” button
  6595. to bring your THINK C project fully up to date. If you remember exactly
  6596. which files were changed, you can instead select them one by one in
  6597. the project window and use the “Compile” command to update your THINK
  6598. C project.
  6599.  
  6600. Conversely, if you use THINK C to make some changes to your source
  6601. files, you can bring your EnterAct project fully up to date by
  6602. selecting the Update Dictionary command from the EnterAct
  6603. menu, as mentioned above. Note this step is not necessary if your
  6604. changes while in THINK C were restricted to function bodies, which
  6605. should often be the case. This is because EnterAct does nothing with
  6606. function bodies except check them for balance in a few key delimiters.
  6607.  
  6608. Editing files with THINK C, or any other editor besides EnterAct, will
  6609. compromise your ability to revert files to earlier versions with
  6610. EnterAct (see the “Show Activities” chapter). That’s worth remembering,
  6611. but in practice the need to revert a file is so rare that you shouldn’t
  6612. let it influence your editing.
  6613.  
  6614. -    -    -    -    -    -    -    -    -    -    -    -
  6615. Show activities
  6616. -    -    -    -    -    -    -    -    -    -    -    -
  6617. §    Introduction
  6618. EnterAct will, at your option, keep track of your recent activities
  6619. in full detail. The Show Activities command under the Edit menu
  6620. generates a window holding descriptions of those activities, with
  6621. details in plain English of what, when, and where. Here are three
  6622. typical entries from the “••Recent Activities••” window generated by
  6623. Show Activities:
  6624. ____
  6625.  
  6626. ¶148
  6627. Tue Jan 12, 1993 8:22:23 pm OPEN «PICT saving»
  6628. ¬
  6629. ¶149
  6630. Tue Jan 12, 1993 8:23:17 pm CUT «PICT saving» 45 1 (temp)
  6631. <=deleted 289 characters:
  6632. «/* save pict "dataH" under the full path name "fileName", on
  6633. the volume "volumeName" */
  6634.     /* open the file, which should already exist */
  6635.     pb.ioCompletion = 0L;
  6636.     pb.ioNamePtr = (StringPtr)fileName;
  6637.     pb.ioVRefNum = 0;
  6638.     pb.ioVersNum = 0;
  6639.     pb.ioPermssn = 3; /* = fsRdWrPerm */
  6640.     pb.ioMisc = 0L;»
  6641. ¬
  6642. ¶150
  6643. Tue Jan 12, 1993 8:23:21 pm CLOSE «PICT saving»
  6644. ¬
  6645.  
  6646. ____
  6647. —where, for example, “CUT «PICT saving» 45 1 (temp)” means characters
  6648. were cut from the document “PICT savings” starting at line 45 position
  6649. 1, and the cut was temporary, ie not saved to disk—if it had been,
  6650. there would have been a SAVE before the CLOSE. Both file names and data
  6651. are enclosed in European-style quotes «».
  6652.  
  6653. Activity records are kept on disk in the log file “EnterAct Recent
  6654. Activities”. This file is created and managed for you, and is preserved
  6655. between sessions. Your most-recent 10,240 activities will be recorded
  6656. in full detail, up to the limits of 65,535 characters per insert or
  6657. delete, and a total of 1,310,720 characters of inserts and deletes for
  6658. the 10,240 activities (typically only 1/4 or less of that is needed).
  6659. Everything of interest, including all edits, searches,
  6660. open/close/save/save as, switching in and out, etc will be recorded.
  6661.  
  6662. Armed with a display of your recent activities, you will typically be
  6663. able to:
  6664.     •    remind yourself of what you did recently (another form of “context
  6665.         restoration”)
  6666.     •    selectively undo or recover the contents of any recent insert or
  6667.         delete
  6668.     •    generate a reverted version of a file, back to a particular activity
  6669.         (multiple files can be done one file at a time, back to different
  6670.         activities)
  6671.  
  6672. To turn the recording of activities off temporarily, select the menu
  6673. item named Recording activities under the Edit menu: it will change
  6674. to read Not recording activities. This is a toggle, and selecting it
  6675. again will turn recording back on. Your recording status is remembered
  6676. between sessions.
  6677.  
  6678. If you’re just interested in a quick first look, skim through the
  6679. “What’s shown” and “Reviewing activities” sections later in this
  6680. chapter.
  6681.  
  6682. To revert one or more files, you’ll need to follow the checklist in
  6683. the “Reverting a file” section, since the procedure is relatively
  6684. lengthy. For other uses of the “••Recent Activities••” window, an
  6685. understanding of the format of a displayed activity is all you really
  6686. need. Many obvious points are explained at length below, both to scrub
  6687. away the fuzziness from some intuitive notions and to introduce you
  6688. gently to what is, at heart, a simple way of keeping track of what
  6689. you’ve done recently.
  6690.  
  6691.  
  6692. §    What’s recorded
  6693. Full details on the following activities are recorded in the log file
  6694. “EnterAct Recent Activities”:
  6695.     •    all edits which affect your text, including typing, Cut, Paste,
  6696.         Paste Selection Behind, Undo, and replacements done with any of the
  6697.         replacement commands under the Search menu. The only notable edit
  6698.         exception is Copy
  6699.     •    all search results, in one or multiple files
  6700.     •    session start and end, switching in and out, running a Drag_on Modul
  6701.     •    Open, Close, Save, Save As, Revert, for text, lookup, PICT, and
  6702.         project windows (when applicable)
  6703.     •    Go to, Go Back, Go to Top, Go to Bottom, and jumping to a definition
  6704.  
  6705. After starting EnterAct at least once, you’ll find your log file in
  6706. the same folder as EnterAct itself, and you’ll probably be able to
  6707. identify it as a “log” file just by its icon. Note that it is not a text
  6708. file, at least not entirely, and its contents can be shown only with
  6709. EnterAct’s Show Activities command.
  6710.  
  6711. For each activity, the following information will be recorded, if
  6712. appropriate:
  6713.     •    the name of the activity (eg TYPING, SAVE, RUN DRAG_ON MODULE)
  6714.     •    the time at which it occurred
  6715.     •    the name of the file in which it occurred
  6716.     •    the position in the file at which it occurred, specifically the
  6717.         starting position if it was an insert, delete, or Find of some sort
  6718.     •    for inserts and deletes, the full contents, and the size of the edi
  6719.     •    for search and replace, the found text and the replacement text
  6720.     •    for Save As only, the previous name of the window.
  6721.  
  6722. Inserts and deletes are recorded as separate activities, even if they
  6723. result from a single command. For example, pasting over a selection
  6724. will be recorded as a delete followed by an insert:
  6725. ____
  6726. ¶7
  6727. Wed Jan 13, 1993 9:27:52 pm PASTE «Untitled-1» 1 1
  6728. <=deleted 35 characters:
  6729. «This text was deleted when pasting.»
  6730. ¬
  6731. ¶8
  6732. Wed Jan 13, 1993 9:27:52 pm PASTE «Untitled-1» 1 1
  6733. =>inserted 38 characters:
  6734. «This text was pasted over a selection.»
  6735. ¬
  6736. ____
  6737. The recorded file position of an edit is of course the position as
  6738. calculated at the time the activity occurred. Thus, for example, if
  6739. you inserted some text at line 100, character position 3 in a file,
  6740. the recorded position will be line 100, position 3. However, a
  6741. subsequent edit before the position of that insert, for example a
  6742. delete of lines 20 through 29 in the same file, will alter the position
  6743. you would want to examine if you now went looking for that insert,
  6744. assuming you saved your file. Instead of finding the inserted text at
  6745. line 100, you would find it at line 90. This is called the “updated”
  6746. position of the activity. As you’ll see in “What’s shown” below, you
  6747. have the choice of showing either original or updated positions.
  6748.  
  6749.  
  6750. §    Recording limitations
  6751. EnterAct does not record activities carried out in other applications,
  6752. in particular changes to text files. Editing files with some other
  6753. editor (such as THINK C) will compromise your ability to recover
  6754. reverted versions of files using EnterAct’s multiple undo capability,
  6755. in the following ways:
  6756.     •    if the edits elsewhere involved adding or removing lines, you will
  6757.         probably not be able to usefully revert the file with EnterAct
  6758.     •    if the edits elsewhere were fairly small, and did not involve adding
  6759.         or removing lines, then you will probably be able to recover a useful
  6760.         reverted version with EnterAct, but the small changes you made
  6761.         elsewhere will not be reflected in the reverted version.
  6762.  
  6763. Only your most-recent 10,240 activities will be recorded in the
  6764. “EnterAct Recent Activities” log file. The contents of your inserts
  6765. and deletes will be recorded up to a limit of 1,310,720 characters
  6766. total for all activities. In addition,
  6767. inserts and deletes will be fully recorded only if they do not
  6768. exceed 65,535 characters. For edits exceeding this limit, only the
  6769. first 1,024 characters will be recorded for reference.
  6770.  
  6771. Typically:
  6772.     •    10,240 activities represents several days of work. If you want to
  6773.         estimate how far back your activity log goes, bear in mind that inserts
  6774.         and deletes are recorded as separate activities, a run of characters
  6775.         typed without changing the insertion point counts as a single insert,
  6776.         and usually for every insert or delete there is one activity of some
  6777.         other kind such as a save or search. For example, at 4 activities
  6778.         per minute on average, you'll be logging your last 40 hours.
  6779.     •    large edits are rare enough that you won’t run into the recording
  6780.         limits. Your average number of characters per activity will probably
  6781.         be under 50, and, if you’re slightly paranoid like the rest of us, you
  6782.         will probably deal will very large edits by using Save As rather than
  6783.         Cut and Paste.
  6784. Minor activities, such as scrolling or changing windows, are not
  6785. recorded.
  6786.  
  6787. To avoid cluttering your activity log, a Replace All that is just used
  6788. for counting purposes is not recorded in detail. 
  6789.  
  6790. Based on personal experience, the limitation that most affects the
  6791. quality of recorded activities is of the “is it plugged in?” variety.
  6792. If you turn recording off temporarily, remember to turn it back on
  6793. again later!
  6794.  
  6795.  
  6796.  
  6797. §    Showing your recent activities
  6798. Selecting Show Activities from the Edit menu produces the following
  6799. dialog:
  6800.  
  6801.  
  6802.  
  6803.  
  6804.  
  6805.  
  6806.  
  6807.  
  6808.  
  6809.  
  6810.  
  6811.  
  6812.  
  6813.  
  6814.  
  6815. Select the “updated current positions” button to have activity
  6816. positions updated as much as possible. Select the “originally recorded
  6817. positions” button to leave line numbers and character positions
  6818. unchanged from their originally recorded values. For review or single
  6819. undo, you’ll want updated positions, but in order to perform a multiple
  6820. undo the original positions are required.
  6821.  
  6822. You may show up to 10,240 of your recent activities, and as you alter
  6823. the number of activities to show the “Memory needed” display at bottom
  6824. of the dialog will update. Showing a few activities will take 700K
  6825. or so of memory, and showing all 10,240 may require a couple of
  6826. meg or more. If you will need more memory than is available, try
  6827. closing all windows including your current project.
  6828.  
  6829. When you click the OK button, a plain-English description of your
  6830. activities will be generated, and shown to you in a window titled
  6831. either “••Recent Activities••” if you selected original positions, or
  6832. “••Recent Activities (updated)••” if you selected updated positions.
  6833.  
  6834. If you’re only interested in your last few activities, adjusting the
  6835. number of activities to show to a small number will reduce the time
  6836. it takes to generate this description.
  6837.  
  6838. "Show full path names for files" is useful if you have more that one
  6839. file with the same name. This will require slightly more memory for
  6840. all that extra text.
  6841.  
  6842.  
  6843. §    What’s shown
  6844. Here’s are some typical entries selected from a “••Recent Activities••”
  6845. display:
  6846. ____
  6847. ¶60
  6848. Sat Jan 16, 1993 10:51:48 pm PASTE «hAWK_FilesandClip.c» 390 4
  6849. =>inserted 50 characters:
  6850. «if (!dirs && !(fpb->ioFlAttrib & 16)) /* a file */»
  6851. ¬
  6852. ¶359
  6853. Sun Jan 17, 1993 5:53:14 pm SAVE AS «HuffCode.c»
  6854. Previous name was: «Untitled-1»
  6855. ¬
  6856. ¶858
  6857. Sun Jan 17, 1993 11:47:09 pm GO TO «EnterAct log» 1417 1
  6858. ¬
  6859. ¶868
  6860. Sun Jan 17, 1993 11:50:28 pm OPEN «CEDAR_Files.c»
  6861. ¬
  6862. ¶869
  6863. Sun Jan 17, 1993 11:50:28 pm FIND DEFINITION «CEDAR_Files.c» 3035 1
  6864. «GetSwitchOutTime»
  6865. ¬
  6866. ¶870
  6867. Sun Jan 17, 1993 11:50:43 pm FIND «CEDAR_Files.c» 43 23
  6868. «SwitchOutTime»
  6869. ¬
  6870. ¶926
  6871. Mon Jan 18, 1993 12:02:54 am SWITCH OUT 
  6872. ¬
  6873. ¶927
  6874. Mon Jan 18, 1993 12:07:31 am SWITCH IN 
  6875. ¬
  6876. ¶1001
  6877. Tue Jan 19, 1993 11:09:56 pm END OF SESSION 
  6878. ¬
  6879. ¶1002
  6880. Wed Jan 20, 1993 8:00:49 pm START OF SESSION 
  6881. ¬
  6882. ____
  6883. The first line of the activity record begins with “¶”, and is followed
  6884. by the activity number. The oldest activity shown is number 1, followed
  6885. by later (younger) activities up to the last thing you did, and its
  6886. number may be as high as 10,240.
  6887.  
  6888. The second line of the activity record shows the date and time,
  6889. followed by the name of the activity. These are present for all
  6890. activities, and for some activities (such as SWITCH OUT ) that may be
  6891. all there is before the ending “¬”.
  6892.  
  6893. If the activity involves a file or window, its name will be shown next
  6894. inside European style «» quotes. And if the activity relates to a
  6895. specific position in the file, this will be shown after the file name.
  6896. The position is for the start of the activity, and consists of the
  6897. starting line number followed by the character position at which the
  6898. activity started on that line. The first line in the file is line 1,
  6899. and the position before the first character on a line is position 1.
  6900.  
  6901. The third and following lines hold the data, if any, associated with
  6902. the activity. For inserts and deletes, the data will be preceded by
  6903. either “<=deleted xx characters” or “=>inserted xx characters” where
  6904. xx is the number of characters. In rare cases where the entire edit
  6905. could not be recorded, this will be followed by a number telling how
  6906. many characters of the edit have been retained, for example
  6907.     =>inserted 98765 characters (1024 shown)
  6908.  
  6909. The contents of an insert or delete will be trimmed if:
  6910.     •    the edit exceeds 65,535 characters; in this case, only the first
  6911.         1,024 characters will be recorded
  6912.     •    total recorded data would exceed 1.3Meg; in this case the
  6913.         data recorded for the oldest edits will be progressively trimmed until
  6914.         enough room is freed up to record the newest edit. The governing
  6915.         assumption is that the older an edit is, the less important it is,
  6916.         regardless of size. This approach has been chosen so that you will
  6917.         retain multiple-undo capabilities as far back as possible.
  6918.  
  6919. The data associated with the activity is enclosed in European-style
  6920. quotes «», and no characters are appended or altered inside the quotes,
  6921. though as described above characters may on rare occasions be trimmed
  6922. from the end.
  6923.  
  6924. Each activity finishes up with a “¬”, on a line by itself.
  6925. The SAVE AS  activity has a special format, with the second line
  6926. containing SAVE AS  followed by the new file name, and the third line
  6927. giving the previous name of the window, with accompanying text that
  6928. makes this clear.
  6929.  
  6930. The number of activities shown will often fall a few short of the
  6931. number you requested (typically by 1 or 2 per 100). These “missing
  6932. activities” were originally records of your typing. A sequence of
  6933. characters typed without moving the insertion point other than by
  6934. typing counts as, and is recorded as,  a single activity. However,
  6935. there is no such Macintosh event as “end of typing”, and EnterAct is
  6936. slightly conservative in its estimate of when you have finished typing
  6937. in a particular spot. Basically, any recordable activity is treated
  6938. as an “end of typing” event if typing was going on. For example, a Save
  6939. while typing would trigger a recording of your typing up to that point.
  6940. If you then continue typing in the same place, that typing record will
  6941. later be deleted, and a complete record of all your typing in the same
  6942. place will eventually be made. Normally this is of no consequence, and
  6943. now that you know what’s happening you shouldn’t let it affect you in
  6944. the slightest.
  6945.  
  6946.  
  6947.  
  6948. §    Temporary, obsolete, and undone activities
  6949. Though not recorded, the “current relevance” of any activity which
  6950. refers to a specific place in a file is inferred when you Show
  6951. Activities. As a result of later activities up to the time at which
  6952. you show them, an earlier activity may end up being currently classed
  6953. as:
  6954.     •    permanent; the document in which it occurred was saved to disk after
  6955.         the activity in question (ie not closed without saving, or unsaveable
  6956.         such as a lookup window). More accurately, an activity is permanent
  6957.         unless it falls into one of the following categories. “Permanent” is
  6958.         the default category, and permanent activities are not indicated in
  6959.         any special way in activity records.
  6960.     •    temporary; the window in which the activity occurred was
  6961.         subsequently closed without saving, but some version of the document
  6962.         currently exists on disk, so that in principle at least the activity
  6963.         still has a recoverable context. 
  6964.     •    obsolete; not only was the window closed after the activity, but
  6965.         no reasonable version of the document now exists on disk. This can
  6966.         happen if you insert text into a new window and then close it without
  6967.         saving, or if you edit an unsaveable window (such as a lookup window).
  6968.         This can also happen when you use Save As to replace an existing file
  6969.         “OldFile” with a new version; at that point, all previous activities
  6970.         relating to “OldFile”, especially inserts and deletes, become obsolete
  6971.         since they were later overwritten by a new version and hence no longer
  6972.         have a recoverable context in any meaningful sense.
  6973.     •    undone; a permanent activity that was subsequently reversed with
  6974.         the Undo command. All temporary and obsolete edits have already been
  6975.         “undone”, in the sense that from the point of view of your disk files
  6976.         they never happened.
  6977.  
  6978. If a file is open when you select Show Activities, all edits from the
  6979. last save or open of that file up to the present will be classed as
  6980. permanent. However, if you subsequently close the file without saving
  6981. it and then reselect Show Activities, you will find that those edits
  6982. have been reclassified as temporary. And if you later save over the
  6983. file by using Save As, effectively replacing its contents with the
  6984. contents of some other file, then the activities will be reclassified
  6985. as obsolete.
  6986.  
  6987. If an activity is classed as temporary, obsolete, or undone, you’ll
  6988. see “(temp)", “(obs)", or “(undone)" respectively in the activity
  6989. record, following the file name and position numbers. Here are some
  6990. examples to help bring this into focus, each followed by a brief
  6991. explanation:
  6992. ____
  6993. ¶25
  6994. Wed Jan 20, 1993 9:55:07 pm OPEN «HuffCode.c»
  6995. ¬
  6996. ¶26
  6997. Wed Jan 20, 1993 9:55:37 pm TYPING «HuffCode.c» 4 1 (temp)
  6998. =>inserted 69 characters:
  6999. «This text was typed into "HuffCode.c",and then the typing was     
  7000. undone.»
  7001. ¬
  7002. ¶27
  7003. Wed Jan 20, 1993 9:55:37 pm UNDO «HuffCode.c» (temp)
  7004. ¬
  7005. ¶28
  7006. Wed Jan 20, 1993 9:55:46 pm CLOSE «HuffCode.c»
  7007. ¬
  7008. ____
  7009. (Note that the document “HuffCode.c” was closed without saving. The
  7010. typing is classed as temporary, which takes precedence over the undoing
  7011. of the typing. The same would be true of an obsolete edit that was
  7012. undone—it would be classed as obsolete.)
  7013.  
  7014. ____
  7015. ¶31
  7016. Wed Jan 20, 1993 9:58:16 pm OPEN «Untitled-2»
  7017. ¬
  7018. ¶32
  7019. Wed Jan 20, 1993 9:58:46 pm TYPING «Untitled-2» 1 1 (obs)
  7020. =>inserted 87 characters:
  7021. «This text was typed into the window "Untitled-2", which was
  7022. then closed without saving.»
  7023. ¬
  7024. ¶33
  7025. Wed Jan 20, 1993 9:58:48 pm CLOSE «Untitled-2»
  7026. ¬
  7027. ____
  7028. (Text was entered in a window that had never been saved to disk, and
  7029. then the window was closed without saving. The context of this activity
  7030. has been lost for good.)
  7031.  
  7032. ____
  7033. ¶34
  7034. Wed Jan 20, 1993 9:59:51 pm OPEN «RenameTesttemp»
  7035. ¬
  7036. ¶35
  7037. Wed Jan 20, 1993 10:00:58 pm TYPING «RenameTesttemp» 1 37 (undone)
  7038. =>inserted 94 characters:
  7039. «
  7040. This text was typed into "Renametesttemp" and then undone.
  7041. The file was saved before closing.»
  7042. ¬
  7043. ¶36
  7044. Wed Jan 20, 1993 10:00:58 pm UNDO «RenameTesttemp»
  7045. ¬
  7046. ¶37
  7047. Wed Jan 20, 1993 10:01:01 pm SAVE «RenameTesttemp»
  7048. ¬
  7049. ¶38
  7050. Wed Jan 20, 1993 10:01:02 pm CLOSE «RenameTesttemp»
  7051. ¬
  7052. ____
  7053. (Here, the undone typing in “RenameTesttemp” was turned into a
  7054. permanent activity by the following save. Only permanent undone
  7055. activities are shown as “(undone)”.
  7056.  
  7057. ____
  7058. ¶47
  7059. Wed Jan 20, 1993 10:05:22 pm OPEN «Act1»
  7060. ¬
  7061. ¶48
  7062. Wed Jan 20, 1993 10:06:13 pm TYPING «Act1» 1 1
  7063. =>inserted 70 characters:
  7064. «This text was typed into "Act1", made permanent
  7065. by the following save.»
  7066. ¬
  7067. ¶49
  7068. Wed Jan 20, 1993 10:06:14 pm SAVE «Act1»
  7069. ¬
  7070. ¶50
  7071. Wed Jan 20, 1993 10:06:17 pm CLOSE «Act1»
  7072. ¬
  7073. ____
  7074. (The typical case, activities that are made permanent by saving to
  7075. disk. There is no special indication for permanent activities, this
  7076. being the default class).
  7077.  
  7078. A permanent activity is there right now in your disk file or on-screen,
  7079. and you could, with a bit of work, undo it using the information in
  7080. the “••Recent Activities••” window—provided you can untangle it from
  7081. the effects of other permanent activities that followed it. An undone
  7082. activity was explicitly undone and the result saved, but you could redo
  7083. it in the same way you would undo a permanent activity. A temporary
  7084. activity wasn’t saved, but you could, with a bit of work, redo it using
  7085. the information in the “••Recent Activities••” window—provided you can
  7086. untangle it from the effects of other temporary activities that
  7087. preceded it. An obsolete activity no longer has a meaningful context:
  7088. the window or file in which it occurred no longer exists on screen or
  7089. disk, though if it was in a file you might have a backup version
  7090. somewhere.
  7091.  
  7092.  
  7093. §    Updated file names
  7094. When you edit a file and then use Save As to save it under a different
  7095. name, those preceding edits really apply to the file with the new name
  7096. rather than to the old name. As a typical example, when you open a new
  7097. window “Untitled-3”, type in it a bit, and then save it as
  7098. “FileCommands.c”, you will later remember the typing as being
  7099. associated with the name “FileCommands.c” rather than “Untitled-3”.
  7100. In the “••Recent Activities••” window, the file name for the typing
  7101. would be shown as “FileCommands.c”.
  7102.  
  7103. When you use Save As on a file, or Save a window for the first time,
  7104. the file name for preceding activities associated with the old name
  7105. will be updated to the new name. This updating is applied backwards
  7106. to the point where you opened or saved the affected document (or all
  7107. the way back if those activities are too old to be still recorded).
  7108.  
  7109.  
  7110.  
  7111. §    Reviewing activities
  7112. If you anticipate wanting to jump to a file that contains a particular
  7113. edit, in order to view it in context, click the “updated current
  7114. positions” while viewing the Show Activities dialog, so that the line
  7115. and characters positions shown will correspond to current actual
  7116. positions in your files (to the extent that this is possible). If you
  7117. just intend to skim through the activities without jumping to any
  7118. files, selecting the “originally recorded positions” button will speed
  7119. up the process of showing you your activities, at the expense of
  7120. showing you file positions that are uncorrected for other activities.
  7121.  
  7122. With the  “••Recent Activities••” window in front, you can use Find
  7123. to search for activities in the usual way. Here are some (rather
  7124. obvious) things you can search for:
  7125.     •    activity number, such as “¶314” (¶ is <Option><seven>)
  7126.     •    date, such as “Jan 13”
  7127.     •    time, such as “ 10:51” (put a space before the hour:minute to
  7128.         disambiguate it from minute:second)
  7129.     •    activity name, such as “START OF SESSION”
  7130.     •    file name (note including the European quotes «» sometimes helps)
  7131.     •    contents of an insert or delete
  7132.  
  7133. For activities with file positions, such as inserts and deletes and
  7134. search results, you can jump to the file and line by clicking on
  7135. the line with the file-line reference, and then picking Go to.
  7136. For example, given
  7137. ____
  7138. ¶60
  7139. Sat Jan 16, 1993 10:51:48 pm PASTE «hAWK_FilesandClip.c» 390 4
  7140. ...etc
  7141. ____
  7142. to open a window for hAWK_FilesandClip.c  and jump to line 390,
  7143. position 4 on the line, click somewhere on the line (for example,
  7144.  after the ‘»’…)
  7145.  
  7146.  
  7147. …and then pick “Go to”. For more details, see the “‘Go’ commands” chapter
  7148.  
  7149. With this use or any use of Go to, the file must be listed in one of
  7150. your project panes.
  7151.  
  7152. If you have selected the “updated current positions” version of your
  7153. activities, the Go to command will work reasonably well—in fact, it
  7154. will work as well as it possibly can. For example, if you
  7155. paste some text at line 100, and then paste in 10 lines at line 50,
  7156. then the position of the first paste will be updated from line 100 to
  7157. line 110, because that’s where you would find it if you went looking
  7158. for it now—provided it was a permanent activity. If you didn’t save
  7159. the file, thus rendering the activities temporary, then the updated
  7160. position of the first paste would still be line 100, because the
  7161. influence of the second paste was removed by virtue of not saving it.
  7162. In other words, to redo that first temporary paste, you would still
  7163. go to line 100.
  7164.  
  7165. The limit to which edit positions can be meaningfully updated shows
  7166. up for example when you delete a large chunk of text, and that deleted
  7167. chunk contained earlier inserts or deletes. If you paste some text at
  7168. line 100, and then delete lines 50 through 200, what should be the
  7169. updated position of the paste? EnterAct will show the updated position
  7170. as line 50, which, if you think about it, is the best that can be
  7171. done.The positions of obsolete activities are not updated, there being
  7172. no file or window to which the activity can be currently related.
  7173.  
  7174. §    Selective single undo
  7175. By selecting “updated current positions” when showing your activities,
  7176. you stand a very good chance of being able to identify the exact
  7177. current position of any previous insert or delete. However, the updated
  7178. position will not be terribly meaningful if the insert or delete was
  7179. later “engulfed” by a delete (for example a paste on line 100 followed
  7180. by deleting lines 50 through 200). And if the activity was an insert
  7181. that was later “nibbled at” by small inserts and deletes within the
  7182. original insert, you may find that you have to undo several activities
  7183. instead of one, or at least mentally compensate for them.
  7184.  
  7185. Once you have found the activity in the recent activities window, use
  7186. Go to to jump to the current position for the activity, as described
  7187. in the section above. If it still seems appropriate for undoing after
  7188. viewing it in context, the procedure for actually undoing it is, alas,
  7189. devoid of novelty:
  7190.     •    to undo an insert, identify the range of the insert in your document
  7191.         by comparing your document with the text of the insert as shown in your
  7192.         activity record; then select it and clear it out
  7193.     •    to undo a delete, copy the deleted text from your activity record
  7194.         and then paste it into your document at the current position for the
  7195.         activity.
  7196.  
  7197. If you have edited the document in question with some editor besides
  7198. EnterAct, the contents and positions of recorded activities may not
  7199. be entirely accurate. But if the edits elsewhere were small, you should
  7200. be able to compensate for them and still achieve the undo you want.
  7201.  
  7202. The recent activities window does not update as you make changes.
  7203. To force an update of positions and activities, close the window
  7204. and reopen it.
  7205.  
  7206. §    Reverting a file
  7207.  
  7208. >    Introduction
  7209. The procedure for reverting a file to an earlier form based on your
  7210. recorded activities is a bit lengthy, so step-by-step instructions are
  7211. given below. In order to revert a file you need to specify the file,
  7212. and how far back you want to go when reverting the file. The “how far
  7213. back” part is specified by an activity number from your “••Recent
  7214. Activities••” window, so you’ll need to Show Activities (with original
  7215. positions) to identify the right activity number. The actual revert
  7216. is done with the supplied hAWK program “$Multi_Undo”, and to provide
  7217. the needed input for this program you’ll save your “••Recent
  7218. Activities••” window to disk, then add it to an EnterAct project. The
  7219. file you wish reverted must also be added to the same project. The
  7220. reverted file will be presented to you in the “$tempStdOut” window when
  7221. $Multi_Undo is finished, to do with as you wish.
  7222.  
  7223. EnterAct doesn't do version control, and this reversion process, in
  7224. its present inelegant form, should be used in emergencies only.
  7225. It works, but that's all you can say for it.
  7226.  
  7227. >    Limitations
  7228. In order to revert a file (called file A below), several conditions
  7229. must be met:
  7230.     •    file A has been saved since its contents were last changed
  7231.     •    All changes to file A, from to the undo point up to the present,
  7232.         have been made with EnterAct
  7233.     •    From the undo point up to the present, no other file named "A" has
  7234.         been edited with EnterAct (ie a different disk or folder, but the same
  7235.         basic file name A)
  7236.     •    The activity corresponding to the undo point is present in
  7237.         EnterAct's "••Recent Activities••" window (it goes back up to 10,240
  7238.         activities).
  7239.     •    The entire text of each edit on file A is present in "••Recent
  7240.         Activities••": you normally won't want to check for this yourself, and
  7241.         the hAWK program “$Multi_Undo”, which you’ll be using anyway, will do
  7242.         it thoroughly for you. In general, only inserts or deletes below 64K
  7243.         characters are fully recorded, and older large edits near the beginning
  7244.         of "••Recent Activities••" may not be fully recorded if it was
  7245.         necessary to make room for newer large edits, due to the total data
  7246.         limit of 1.3Meg characters. Rule of thumb: barring a sequence of large
  7247.         edits, all of your edits will still be fully recorded. These size
  7248.         limits are only rarely encountered.
  7249.  
  7250. The reverted version of your file presented in “$tempStdOut” will not
  7251. retain any markers or illustrations from the original. Normally,
  7252. markers can be easily replaced with the Automark command. To reinstate
  7253. illustrations, you’ll need to use your resource editor to copy the
  7254. appropriate PICT’s.
  7255.  
  7256.  
  7257. >    How to revert a file
  7258. If your circumstances meet the above conditions, you can revert a file
  7259. (still called “A”) by following these steps:
  7260.     •1    Open an EnterAct project (any will do)
  7261.     •2    If necessary, add file A to it
  7262.     •3    Select "Show Activities..."; click on the "originally recorded
  7263.     positions" button; and for the number of activities to show, enter
  7264.     "10240"; and click the OK button to generate the "••Recent Activities••"
  7265.     window
  7266.     •4    Locate the oldest activity you wish undone, and note its activity
  7267.     number -- this appears just afer the "¶" beginning the activity record,
  7268.     for example "¶314"
  7269.     •5    Save "••Recent Activities••" somewhere - NOTE the name must start
  7270.     with two bullets, but is otherwise arbitrary, for example, "••RA" or
  7271.     "••For undo". The bullet character is <Option><eight>.
  7272.     •6    Add your saved version of "••Recent Activities••" to your project,
  7273.     then close the window for "••Recent Activities••" to save memory
  7274.     •7    Select both the saved version of "••Recent Activities••" and file
  7275.     A for MFS operations, by holding down the <Option> key and clicking
  7276.     on each name in the project window - a bullet • will appear beside the
  7277.     file name). These two should be the only files marked with a • in your
  7278.     project window
  7279.     •8    Call up hAWK and select the supplied program “$Multi_Undo”; the
  7280.     input option should be "MFS selected files"; use "Set Variables" to
  7281.     set the value of the variable "howFarBack" to the activity number that
  7282.     represents how far back (inclusive) you wish to undo. For example,
  7283.              howFarBack=314
  7284.     to undo from the present (the largest activity number) back to and
  7285.     including activity number 314.
  7286.     •9    Click the Run button. The undone version of file A will (eventually)
  7287.     be presented in the "$tempStdOut" window. You can continue working in
  7288.     EnterAct in the meantime.
  7289.     •10    Save "$tempStdOut" under a different name if you wish to keep the
  7290.     results (see “Preserving the undone version” just below for an
  7291.     explanation)
  7292.     •11    If there are other files you wish to restore, add them to your
  7293.     project if necessary, open your saved version of "••Recent
  7294.     Activities••" to determine how far back to undo, then close it and
  7295.     repeat steps 7-10 (especially step 10).
  7296.  
  7297. While you're waiting for $Multi_Undo to finish you should avoid editing
  7298. either file A or your saved version of "••Recent Activities••".
  7299.  
  7300. For more information on running hAWK programs see 
  7301. the “hAWK User’s Manual” supplied on disk.
  7302.  
  7303.  
  7304. >    Preserving the undone version
  7305. The “$Multi_Undo” program stops one step short of actually reverting
  7306. your file, in that the reverted version is contained in the file
  7307. “$tempStdOut” at the end, rather than immediately replacing the
  7308. contents of your file. If you decide to keep the reverted version, you
  7309. can use Save As  on “$tempStdOut” to create a permanent copy of the
  7310. reverted file. You should do this before your next hAWK or Read
  7311. Resource run, because the file “$tempStdOut”, as its name suggests,
  7312. is overwritten with every Drag_on Module run.
  7313.  
  7314. If you use Save As to replace your file A with the reverted version,
  7315. this will not be undoable, and the unreverted version will be lost.
  7316. If you’re not absolutely sure that the reverted version should replace
  7317. the unreverted version, it’s best to give the reverted version a name
  7318. name that is close to the old one (eg the reverted version of
  7319. “MyEvent.c” could be called “MyEvent2.c” or “MyEvent_r1.c” etc).
  7320.  
  7321.  
  7322. §    Turning activity recording on and off
  7323.  
  7324. >    Temporarily
  7325. When activities are being recorded you will see a menu item named
  7326. Recording activities under the Edit menu: it will change to read Not
  7327. recording activities if you select it, indicating that recording is
  7328. turned off. Selecting it again will turn recording back on. Even if
  7329. you are not recording activities, EnterAct will still open the log file
  7330. “EnterAct Recent Activities” each time you start EnterAct, creating
  7331. it if it is not found. And you will still be able to Show Activities.
  7332.  
  7333. Turning activity recording off temporarily is rarely useful. However,
  7334. you might consider it if you are about to perform a number of trivial
  7335. changes, or very large edits that you don’t need recorded, and want
  7336. to preserve the current record of your activities as much as possible.
  7337. But if you are aware that vitally important data exists only in your
  7338. recorded activities, it would be better to Show Activities and Save
  7339. the resulting activity list to disk, to avoid losing the data as older
  7340. activities are dropped from the log file.
  7341.  
  7342.  
  7343. >    More permanently
  7344. The “master switch” for EnterAct’s activity recording is in the Options
  7345. dialog (under the Edit menu). 
  7346.  
  7347. You may wish to forego the recording of your activities if you don’t
  7348. have enough disk space available to hold the log file (2.1Meg), or if
  7349. your hard disk makes so much noise that you can’t work when it’s
  7350. active.  To turn off activity recording, and also instruct EnterAct
  7351. not to look for or create the “EnterAct Recent Activities” log file,
  7352. uncheck the “Save activities to disk” option in the Options dialog and
  7353. click the OK button: as you do so, the icon of the log file will be
  7354. crossed out, indicating that the file will no longer be needed or used.
  7355. You may then dispose of the log file if you wish, and EnterAct will
  7356. not complain.
  7357.  
  7358.  
  7359.  
  7360.  
  7361.  
  7362.  
  7363.  
  7364.  
  7365.  
  7366.  
  7367.  
  7368.  
  7369.  
  7370.  
  7371.  
  7372.  
  7373.  
  7374.  
  7375.  
  7376.  
  7377.  
  7378. To reactivate activity recording, check the “Save activities to disk”
  7379. option in the Options dialog and click OK. A log file will immediately
  7380. be created if one does not exist at the time. If the log file exists,
  7381. recording will pick up again with no loss of previously recorded
  7382. activities.
  7383.  
  7384.  
  7385. -    -    -    -    -    -    -    -    -    -    -    -
  7386. “Index” commands
  7387. -    -    -    -    -    -    -    -    -    -    -    -
  7388.  
  7389.  
  7390.  
  7391.  
  7392.  
  7393.  
  7394.  
  7395.  
  7396.  
  7397.  
  7398.  
  7399.  
  7400.  
  7401.  
  7402.  
  7403.  
  7404.  
  7405.  
  7406.  
  7407.  
  7408.  
  7409.  
  7410.  
  7411.  
  7412.  
  7413.  
  7414.  
  7415.  
  7416.  
  7417.  
  7418.  
  7419. (as of version 2.8, there is an additional "Check Prototypes"
  7420. command at the bottom of the Index list.)
  7421.  
  7422. The “Index” commands under the EnterAct menu generate a variety of
  7423. reports on your source code. With all except the Potential Locals
  7424. and Check Prototypes command, set up a multi-file selection first
  7425. to serve as input for the command. Potential Locals takes a function
  7426. body with parameters as input. Check Prototypes looks at all of
  7427. the function definitions and prototypes in your entire project.
  7428. All output from these commands is to $tempStdOut.
  7429.  
  7430. Functions… builds a list of functions in your selected files: it can
  7431. list functions defined in the files together with sublists of the
  7432. functions that each defined function calls, or conversely you can have
  7433. a list of all the functions called in your source code, together with
  7434. sublists showing which functions call them.
  7435.  
  7436. Cross-Reference… generates a cross-reference listing: you can specify
  7437. the types of term (function, struct, variable etc) to include, the
  7438. specific terms to look for (your current dictionary), and the files
  7439. to look in (your current multi-file selection). Supporting doc files
  7440. in your rightmost project pane can be included in the cross-reference.
  7441. You can also specify a list of common words (such as Handle) to skip
  7442. for cross-reference purposes.
  7443.  
  7444. #Includes and Marker Names generate lists of system or user headers,
  7445. and marker names in a variety of formats, in your selected files.
  7446.  
  7447. Potential Locals classifies and lists all terms in a function. Just
  7448. before this command, select the entire body of the function and the
  7449. parameters (ie from the opening ‘(’ of the parameters to the closing
  7450. ‘}’ of the function, inclusive). In the resulting list, names that have
  7451. no definition and are not parameters, and hence are probably local
  7452. variables, are listed first. The number of times each name was used
  7453. is also listed, and by comparing this list with your original function
  7454. you can quickly declare all necessary variables or eliminate
  7455. unnecessary declarations, and also spot spelling mistakes.
  7456.  
  7457. Standard Metrics issues counts of lines and characters in selected
  7458. files, and also shows character frequencies.
  7459.  
  7460. Check Prototypes is rather primitive, catching only a difference
  7461. in the number of parameters to a function. No need to bullet any
  7462. files, just bring your dictionary up to date beforehand. It's intended
  7463. for use with C source only, not C++ or Java.
  7464.  
  7465.  
  7466. §    Functions…
  7467.  
  7468.  
  7469.  
  7470.  
  7471.  
  7472.  
  7473.  
  7474.  
  7475.  
  7476.  
  7477.  
  7478.  
  7479.  
  7480. This command can be used to build a “skeleton” for selected source
  7481. files, a bare list of functions defined together with the functions
  7482. they call. It also works in reverse, and can be used to list all
  7483. functions that are called, together with sublists of the functions that
  7484. call them. Input is taken from your list of files selected for
  7485. multi-file operations (use the Find dialog buttons, or <Option>click
  7486. in the project window, see the “Search” chapter). Only files in the
  7487. left and middle project window panes will be looked at, and any files
  7488. you select in the right (documentation) pane will be ignored. You’ll
  7489. see results in “$tempStdOut”: if you decide you want to save the
  7490. results permanently, use Save As to save this document under a new name
  7491. of your choice, since the contents of $tempStdOut are overwritten by
  7492. every Index command or Drag_on Module run.
  7493.  
  7494. For proper results, your dictionary should be reasonably up to date
  7495. before using this command. In particular, your dictionary should
  7496. contain entries for all functions that you wish to see listed. For
  7497. example, in order for toolbox functions to show up in the listing
  7498. you’ll need to add the appropriate toolbox headers to your project and
  7499. update your dictionary.
  7500.  
  7501. When you select “with calls” in the Functions dialog, the main list
  7502. in the result will consist of functions defined in your list of source
  7503. files. Indented under each defined function will be a list of functions
  7504. called by the defined function. If you select “as defined” then
  7505. function definitions will be listed in the order encountered in your
  7506. source files, with a comment containing the file name beginning each
  7507. list for each file:
  7508.  
  7509.  
  7510.  
  7511.  
  7512.  
  7513.  
  7514.  
  7515.  
  7516.  
  7517.  
  7518.  
  7519.  
  7520.  
  7521.  
  7522.  
  7523.  
  7524.  
  7525.  
  7526.  
  7527.  
  7528.  
  7529.  
  7530.  
  7531.  
  7532.  
  7533.  
  7534.  
  7535. If you select "sorted” then all of the function definitions from all
  7536. files will be sorted alphabetically. In this case you can select
  7537. “include file locations” to list the defining file for each function:
  7538.  
  7539.  
  7540.  
  7541.  
  7542.  
  7543.  
  7544.  
  7545.  
  7546.  
  7547.  
  7548.  
  7549.  
  7550.  
  7551.  
  7552.  
  7553.  
  7554.  
  7555.  
  7556.  
  7557.  
  7558.  
  7559.  
  7560.  
  7561.  
  7562.  
  7563.  
  7564.  
  7565. If you select “with callers” the resulting list will show all functions
  7566. that are called in your source code, with an indented sublist for each
  7567. naming the functions that call it. Here also, if you select “include
  7568. file locations” then the defining file name will be listed with each
  7569. function name.
  7570.  
  7571.  
  7572.  
  7573.  
  7574.  
  7575.  
  7576.  
  7577.  
  7578.  
  7579.  
  7580.  
  7581.  
  7582.  
  7583.  
  7584.  
  7585.  
  7586.  
  7587.  
  7588.  
  7589.  
  7590.  
  7591.  
  7592.  
  7593.  
  7594.  
  7595.  
  7596.  
  7597. With any function name, you can jump to the definition for it by
  7598. <Option> double-clicking on the name. File names in the listings are
  7599. enclosed in «» quotes: to open a file, click anywhere on the line
  7600. containing the file name and issue a Go to.
  7601.  
  7602.  
  7603. §    Cross-Reference…
  7604.  
  7605.  
  7606.  
  7607.  
  7608.  
  7609.  
  7610.  
  7611.  
  7612.  
  7613.  
  7614.  
  7615.  
  7616.  
  7617.  
  7618.  
  7619.  
  7620.  
  7621.  
  7622.  
  7623.  
  7624.  
  7625.  
  7626.  
  7627.  
  7628.  
  7629.  
  7630.  
  7631.  
  7632.  
  7633.  
  7634.  
  7635.  
  7636.  
  7637. The Cross-Reference command generates a cross-reference for all term
  7638. types you select, in all files selected for multi-file operations.
  7639. Names are listed in alphabetical order, with a sublist for each name
  7640. listing file name and line number for each instance, and optionally
  7641. the name of the function containing the instance. Only names that are
  7642. defined in your current project dictionary will be included in the
  7643. listing. Note that you can cross-reference supporting documents with
  7644. this command, by putting a bullet (•) beside the name of each
  7645. supporting document. The “include containing function names” option
  7646. will be ignored for support docs.
  7647.  
  7648. To generate a cross-reference just for names that are defined in
  7649. certain files, rather than all names defined in your current dictionary
  7650.     •    make a new project, and add to it only those source and header files
  7651.         which contain functions, variables, structs etc to be included in the
  7652.         cross-reference
  7653.     •    use Update Dictionary to build a dictionary for just those names
  7654.     •    add any additional files to be cross-referenced to your project
  7655.     •    place bullets (•) beside the names of all files you want to
  7656.         cross-reference
  7657.     •    select Cross-Reference
  7658.     •    optionally specify a file containing a list of common words to skip,
  7659.         with the “Skip words in…” button
  7660.     •    specify the term types (function, variable etc) to be included in
  7661.         the cross-reference, or click the “All types” button
  7662.     •    click OK and your desired list will appear in the $tempStdOut window
  7663.  
  7664. Normally your current project dictionary will be the appropriate one
  7665. to use for cross-referencing, and you won’t need to make a new project
  7666. just for this purpose.
  7667.  
  7668. As with all Index commands, use Save As to save $tempStdOut under a
  7669. different name if you decide to keep the results—$tempStdOut will be
  7670. overwritten by your next Index command or hAWK run.
  7671.  
  7672. The “Skip words in…” button in the Cross-Reference dialog allows you
  7673. to specify a list of words to skip, typically common names such as OK,
  7674. Handle, DialogPtr that you aren’t interested in. The names in the file
  7675. can appear in any order, and can be separated from one another by
  7676. spaces or <Return>’s. The file “Skip for XRef” which comes with
  7677. EnterAct contains a starter list. You’ll find it in the “hAWK Programs”
  7678. folder, which is inside the “Drag_on Modules” folder inside your
  7679. development folder.
  7680.  
  7681.  
  7682.  
  7683.  
  7684.  
  7685.  
  7686.  
  7687.  
  7688.  
  7689.  
  7690.  
  7691.  
  7692.  
  7693.  
  7694.  
  7695.  
  7696.  
  7697.  
  7698.  
  7699.  
  7700.  
  7701.  
  7702.  
  7703.  
  7704.  
  7705.  
  7706.  
  7707.  
  7708.  
  7709.  
  7710.  
  7711.  
  7712.  
  7713.  
  7714.  
  7715.  
  7716.  
  7717.  
  7718.  
  7719. To cancel the use of a skip-list, click the “Skip none” button.
  7720. When you select “include containing function names” the name of the
  7721. function, if any, containing each reference will be shown to the right
  7722. of each reference. Names which occur outside of a function body,
  7723. including all names encountered in support documents, will not have
  7724. a containing function listed.
  7725.  
  7726. The format of each reference such as
  7727. ____
  7728.     «AssocArray.c»        260        SetArrayValue
  7729. ____
  7730.  is «file name» line-number containing-function (if any). To go to a
  7731.  particular reference, click on the reference line and use Go to. To
  7732.  jump to the definition of a containing function, <Option> double-click
  7733.  on its name.
  7734.  
  7735.  
  7736. §    #Includes…
  7737.  
  7738.  
  7739.  
  7740.  
  7741.  
  7742.  
  7743.  
  7744.  
  7745.  
  7746.  
  7747.  
  7748.  
  7749.  
  7750.  
  7751.  
  7752.  
  7753.  
  7754.  
  7755.  
  7756.  
  7757.  
  7758.  
  7759.  
  7760.  
  7761.  
  7762. To list header files that are included in one or more source or header
  7763. files:
  7764.     •    select the source and header files for multi-file operations
  7765.     •    select the #Includes… command
  7766.     •    pick either system headers with the <headers> button, or
  7767.         project-specific headers with the “headers” button, or both
  7768.     •    click OK, and the list will appear in the $tempStdOut window
  7769.     •    use Save As on $tempStdOut to make a permanent copy of the results.
  7770.  
  7771. Included file names are listed in the order encountered, together with
  7772. line number.
  7773.  
  7774.  
  7775. §    Marker Names…
  7776.  
  7777.  
  7778.  
  7779.  
  7780.  
  7781.  
  7782.  
  7783.  
  7784.  
  7785.  
  7786.  
  7787.  
  7788.  
  7789.  
  7790.  
  7791.  
  7792.  
  7793.  
  7794.  
  7795.  
  7796.  
  7797.  
  7798.  
  7799.  
  7800.  
  7801.  
  7802.  
  7803.  
  7804. To list the names of all markers in one or more files:
  7805.     •    select the files (any panes) for multi-file operations
  7806.     •    select the Marker Names… command
  7807.     •    pick your preferred format for the names
  7808.     •    click OK, and the list will appear in the $tempStdOut window
  7809.     •    use Save As on $tempStdOut to make a permanent copy of the results.
  7810.  
  7811. The «file-name»«marker-name» format is useful for establishing “go to”
  7812. links, as explained in the “‘Go’ commands” chapter. The other two
  7813. formats can also be used as “go to” links, but work only within the
  7814. file that contains the marker.
  7815.  
  7816. EnterAct's default behavior is to NOT save marks with source or
  7817. header files, so there will normally be no marks listed for these
  7818. files. In practise you will probably not need special  “go to” links
  7819. for functions or structs anyway, since <Option>double-clicking
  7820. on the name anywhere will take you to the definition. “Go to” links
  7821. are intended mainly for establishing hyperlinks to documentation
  7822. files (this manual is already redundant enuff, so please see chapter 17
  7823. for details on creating and using «file-name»«marker-name» links).
  7824.  
  7825. §    Potential Locals
  7826.  
  7827.  
  7828.  
  7829.  
  7830.  
  7831.  
  7832.  
  7833.  
  7834.  
  7835.  
  7836.  
  7837.  
  7838.  
  7839.  
  7840.  
  7841.  
  7842.  
  7843.  
  7844.  
  7845.  
  7846.  
  7847.  
  7848.  
  7849.  
  7850.  
  7851.  
  7852.  
  7853.  
  7854.  
  7855.  
  7856.  
  7857.  
  7858.  
  7859.  
  7860.  
  7861.  
  7862.  
  7863.  
  7864.  
  7865.  
  7866.  
  7867. This command helps with the declaration of local variables. To use it,
  7868. first select the parameters and body of a function, from the opening
  7869. parenthesis of the parameters to the closing curly brace of the
  7870. function body, inclusive, as shown above left. Then select Potential
  7871. Locals:results will be shown in $tempStdOut.
  7872.  
  7873. Names are shown three per line, each followed by the number of times
  7874. the name was encountered in the function. The first list, “These look
  7875. most like locals:”, consists of those names seen in the function which
  7876. have no entries in your current dictionary, and hence they are the best
  7877. candidates to be local variables. Note, though, that they could also
  7878. be goto labels, or names that for some reason are not defined in your
  7879. dictionary. Names in this list with a frequency of 1 bear a close
  7880. look—often they have been used but not declared, or declared but not
  7881. used, or the name has a typo. Names in the other lists might also need
  7882. declaration as local variables, if you have used the same name for a
  7883. local and something else (such as a global variable, typically).
  7884.  
  7885.  
  7886. §    Standard Metrics
  7887. This command reports the total lines and characters in each of your
  7888. files selected for multi-file operations, followed by a C-style array
  7889. listing the number of times each character was seen. Comment characters
  7890. and lines are included in the totals, but blank lines at the end of
  7891. a file aren’t counted as lines.
  7892.  
  7893.  
  7894.  
  7895.  
  7896.  
  7897.  
  7898.  
  7899.  
  7900.  
  7901.  
  7902.  
  7903.  
  7904.  
  7905.  
  7906.  
  7907.  
  7908.  
  7909.  
  7910.  
  7911.  
  7912.  
  7913.  
  7914.  
  7915.  
  7916.  
  7917.  
  7918. §    Check Prototypes
  7919. This command checks all of the function definitions and
  7920. prototypes in your project dictionary, checking ONLY the
  7921. number of parameters for each function. It reports the
  7922. names of any functions that are declared with different
  7923. numbers of parameters. Before calling this command, you
  7924. should bring your dictionary up to date with Update Dictionary
  7925. for best results.
  7926.  
  7927. There is no need to select any files for multi-file operations
  7928. when using this command. You just need a project open with
  7929. a built dictionary.
  7930.  
  7931. This is a primitive version, and catches only differences in the
  7932. NUMBER of parameters to a function. And it's only for C files, not
  7933. C++ or Java. Don't trust it to validate prototypes, use it only
  7934. to spot the particular problem of the same-named
  7935. C function having a different number of parameters in
  7936. variant declarations. This typically happens when you change
  7937. the definition of a function and forget to change a prototype
  7938. for it in a different file.
  7939.  
  7940. If no prototypes are shown in stdout, your function definitions
  7941. and declarations all had a consistent number of parameters.
  7942. Or arguments, if you prefer. I won't argue.
  7943.  
  7944. -    -    -    -    -    -    -    -    -    -    -    -
  7945. Some thoughts on using EnterAct
  7946. -    -    -    -    -    -    -    -    -    -    -    -
  7947. (Worth mentioning again, EnterAct can be used as just a
  7948. "definition viewer" to help out other editors -- see
  7949. the end of "Lookup", chapter 10)
  7950.  
  7951. (As of September 95, the advice below about how to avoid lookup
  7952. delays and minimize memory use is sounding a bit dated; however,
  7953. it's stil true that smaller projects are easier to manage.)
  7954.  
  7955. §    Projects are cheap
  7956. EnterAct projects are quick and easy to create, the only real penalty
  7957. being the amount of disk space used. While an EnterAct project can be
  7958. truly enormous and still be usable, lookup will be faster and more
  7959. appropriate if you tailor your project to the problem at hand. As an
  7960. extreme example, here’s a generic project that would be perfectly
  7961. suitable for developing file–handling functions:
  7962.  
  7963.  
  7964.  
  7965.  
  7966.  
  7967.  
  7968.  
  7969.  
  7970.  
  7971.  
  7972. Lookup in this size project will always be instantaneous no matter how
  7973. bad your spelling, and lookup for your terms will never be confused
  7974. by accidental matches against terms in files that you don’t need
  7975. reference to. While accidental matches are not common, the speed of
  7976. lookup when your spelling is not exact does depend directly on the size
  7977. of your dictionary.
  7978.  
  7979. At the other extreme, you can create projects with files from more
  7980. that one application/driver etc. This can be very handy for comparing
  7981. different versions or different approaches to a problem. In practise,
  7982. the main penalty comes when you want to jump to a particular
  7983. definition, and there's more than one: to choose the one you want,
  7984. you have to press <Enter> to look it up and then <Option>double-click
  7985. in the lookup window.
  7986.  
  7987. The rule of thumb then is that an EnterAct project can consist of
  7988. whatever files you want, but performance will be better if you don’t
  7989. add files that you don’t need. There is a tradeoff between having
  7990. absolutely everything of potential interest in a large, complicated
  7991. project, and having several smaller but better–performing projects.
  7992.  
  7993. For ultra-compact project backup, in the event that some of your
  7994. projects are tedious to create:
  7995.     •    select all of the files in your project for multi-file ops, by
  7996.     clicking the "All" button in the Find dialog
  7997.     •    select hAWK from the EnterAct menu, and select and run
  7998.     the program "$EchoFullPathNames"
  7999.     •    use Save As on the resulting stdout window to save your
  8000.     list of project files
  8001.     •    to recreate your project: create a New Project; hold
  8002.     down the <Shift> key while selecting "Add Files..." (the menu
  8003.     text will read "Add Files from List...") and select your text
  8004.     file of full path names in the subsequent Open dialog; and
  8005.     bring your dictionary up to date after the files are added.
  8006.  
  8007. §    Learning from or reviewing code
  8008. If your purpose is to explore rather than create, then you won’t be
  8009. typing in many incorrect spellings. Lookup when spelling is correct
  8010. is always instant, which is the case if you’re just reading through
  8011. code and looking up terms in the code as you go. In this case the only
  8012. restrictions on the size of the project are the amount of disk space
  8013. and RAM needed, and you can add absolutely all files related to the
  8014. application without slowing down the lookup.
  8015.  
  8016. (Strictly speaking, lookup is instant only for terms with entries
  8017. in your dictionary. Specifically, struct and class member names
  8018. are not separately entered in your dictionary, and it can take
  8019. a second or more for the AutoLook window to pull up a definition
  8020. that contains the member name. Sorry, there's no plan to speed
  8021. up member lookup. Member lookup won't hang you up, it will just
  8022. be stopped if you start typing or mousing around during the search.)
  8023.  
  8024. §    On documenting your work
  8025. There is little in this manual on the topic of documentation, primarily
  8026. because it’s up to you how, and how much, you document your work in
  8027. separate files. But it’s worth mentioning that EnterAct has a variety
  8028. of features to help you create and maintain your documentation. Here’s
  8029. a list:
  8030.     •    documentation files can be added to the rightmost pane of your
  8031.         project, for regular double-click access just like source and header
  8032.         files
  8033.     •    <Option> double-click or Find Definition can be used on any term
  8034.         that appears in your documentation to jump to its definition (provided
  8035.         of course that your dictionary is reasonably up-to-date)
  8036.     •    the AutoLook window will instantly update to display definitions
  8037.         of terms in your documentation (double-click on the term or click just
  8038.         after it). And clicking after a term and pressing the <Enter> key will
  8039.         produce a more persistent separate lookup window
  8040.     •    your own notes on various programming topics can be “disguised” as
  8041.         C terms, and in this form they can be built into your project
  8042.         dictionary for instant retrieval to the AutoLook window or a separate
  8043.         lookup window wherever the name of the note appears (see “Looking up
  8044.         your notes” in the “Lookup” chapter)
  8045.     •    Go to accepts file name followed by marker name, as explained in
  8046.         the “‘Go’ commands” chapter. These look like
  8047.         /* See «MY OOP Notes» «Static variables» */
  8048.         and the text for them can be generated by picking the marker from
  8049.         the popup menu in the document where it is defined while holding down
  8050.         the <Shift> key as well as the usual <Option> or <Command> key. The
  8051.         link location is maintained as you edit, since the marker’s location
  8052.         is maintained, and if the file and marker names are in «» quotes
  8053.         they can be abbreviated or even slightly incorrect and still work.
  8054.     •    Go to also accepts file-name and/or line-number selections. Text
  8055.         for this style of “go to” link is generated by the Show Activities
  8056.         command, and by a variety of supplied hAWK programs. For an example
  8057.         of line numbers used to index a document, see the “Active Index” at
  8058.         the bottom of the “hAWK User’s Manual” on disk 2.
  8059.     •    Reformat Selection can be used to even up the lines in one or more
  8060.         paragraphs of your documentation
  8061.     •    if you have any relevant PICT files, you can add them to your
  8062.         project for quick access. And Go to accepts PICT file names. You can
  8063.         also add one or more PICT’s as illustrations in a TEXT document (see
  8064.         “Illustrating your text” in the “Documents and windows” chapter).
  8065.     •    the hAWK program "$CompareFiles" can be run on any two of your
  8066.         project files to list differences.
  8067.  
  8068. EnterAct can track and link all of your supporting documentation. If
  8069. you develop naming conventions for your documents, and make use of some
  8070. of EnterAct’s linking power, you should find it’s a lot easier to keep
  8071. track of things. References will be just a double-click or Go to away,
  8072. which beats shuffling through a stack of papers or calling up an
  8073. accessory outliner all to heck (pardon the enthusiasm).
  8074.  
  8075. -    -    -    -    -    -    -    -    -    -    -    -
  8076. If there’s a problem
  8077. -    -    -    -    -    -    -    -    -    -    -    -
  8078. §    Out of memory
  8079. If you run out of memory while trying to do something, you’ll see an
  8080. Alert saying “Out of memory. Please close up and try again when things
  8081. are less busy.” or the equivalent. Open windows take up memory that
  8082. you can free by closing the window The project especially can
  8083. take a lot of memory (a Megabyte or more), since the entire dictionary
  8084. associated with it is kept in memory.
  8085.  
  8086. If you encounter frequent “Out of memory” messages, the least
  8087. inconvenient but most expensive cure is to add more memory to your
  8088. Macintosh. However, you can often free up a considerable amount of
  8089. memory by removing relatively unneeded files from your project. The
  8090. rough rule is that your project dictionary will take up in memory about
  8091. one–half of the disk space used by all .c and .h files in the project
  8092. (a better estimate, 16% of source files plus 120% of header files).
  8093. If you don’t need lookup for any of the terms in a .c or .h file,
  8094. removing it from your project will free up some memory. Note that plain
  8095. text files in the rightmost pane do not greatly affect memory used,
  8096. since they are not incorporated into the dictionary.
  8097.  
  8098. To see how much memory is free at any time, select Show Activities from
  8099. the Edit menu. At the bottom of the resulting dialog you will see the
  8100. amount of memory currently available.
  8101.  
  8102. For a guide to estimating memory needs and trimming unneeded files from
  8103. your project, see the file “EnterAct memory needs”.
  8104.  
  8105.  
  8106. §    Dictionary problems
  8107. >    Missing dictionary entries
  8108. In rare cases, an error in your source may lead to a term not being
  8109. recorded in your dictionary, with no message. An example is
  8110. ____
  8111.     int x        /* missing semicolon */
  8112.     long y;
  8113. ____
  8114. for which EnterAct would record only the “y”, missing the “x”. This
  8115. is the one time that EnterAct’s tolerance of errors can be a nuisance,
  8116. but if you can remember where the term is defined then visual
  8117. inspection should reveal the error, typically a missing semicolon or
  8118. a missing or misspelled keyword. If you can’t remember where the term
  8119. is defined, and you really want lookup to be available for it, then
  8120. the one sure cure is to switch to THINK C and Compile or Check Syntax
  8121. until you spot and fix the bug.
  8122.  
  8123.  
  8124. >    Trouble building your dictionary
  8125. If the dictionary–builder trips over a bug in your code and you can’t
  8126. spot the problem after reading this section and examining your code,
  8127. your next best course of action is to switch to THINK C and compile
  8128. the offending file. If you call for technical support and your code
  8129. is not compilable, there is only a small chance we can help, since the
  8130. possibilities would be too open–ended. Look on the bright side, you’ll
  8131. have to compile your code sooner or later anyway. 
  8132.  
  8133. EnterAct sets moderately strict standards for the part of your code
  8134. that is outside of a function, struct, or union body. However, code
  8135. that is inside of a function, struct, or union body is primarily
  8136. checked only for proper balance in a few key delimiters, typically {},
  8137. (), and /* */. As a result, almost all of your first–draft errors will
  8138. be simply ignored. Some errors outside of a body can be compensated
  8139. for, and the remainder that do trigger a complaint from the
  8140. dictionary–builder will almost always be fairly obvious.
  8141.  
  8142. Here follows a complete list of the messages you might see after
  8143. selecting Update Dictionary or Update For Front File Only. 
  8144.  
  8145. ____
  8146. "Statement too complex to deal with all at once. Any chance you could
  8147. simplify?"
  8148. ____
  8149. This message should be rather rare. You would have to nest brackets
  8150. more than 200 deep, or have more than 256 enum constants in a single
  8151. enum in order to produce it. I’m not giving an example! The cure would
  8152. be to reduce the number of brackets in your deeply–nested construction,
  8153. or split a monstrous enum into two parts.
  8154.  
  8155. ____
  8156. "Typedef cannot have an init. One or the other has to go."
  8157.     typedef int SHORT = 7;
  8158. ____
  8159. This should prove rare. “typedef” essentially creates a new keyword,
  8160. and you can no more initialize it than you could initialize “int”
  8161. itself. Apologies for stating the obvious.
  8162.  
  8163. ____
  8164. "Illegal word or punctuation after struct or union."
  8165.     struct int myStruct {...     /* int */
  8166.     struct /myStruct {...        /* the '/' */
  8167.     struct myStruct (...}        /* wrong bracket */
  8168. ____
  8169. Something between “struct” or “union” and the opening left brace (if
  8170. any) of the body doesn’t belong. Or, you may have neglected to type
  8171. in a name for the struct or union.
  8172.  
  8173. ____
  8174. "Illegal word or punctuation after enum."
  8175.     enum Numbers int {...        /* int */
  8176.     enum /Numbers {...            /* the '/' */
  8177.     enum Numbers {one two three}; /* missing commas */
  8178.     enum Numbers {one, two; three}; /* that first semicolon */
  8179. ____
  8180. Includes all the sorts of errors for a “struct” or “union”, and also
  8181. any error inside the body of the enum where the enum constants are
  8182. listed. EnterAct does not record any terms inside a struct or union,
  8183. but does record all enum constants, hence checking for an enum is more
  8184. strict. Some errors (such as an extra comma) can be shrugged off, but
  8185. most others will trigger this message.
  8186.  
  8187. ____
  8188. "#if has no matching #endif, #else, or #elif."
  8189. ____
  8190. I’m afraid you’re on your own tracking this error down, since it could
  8191. be anywhere in the file after the position shown. It could be due to
  8192. a misspelling, such as #eles, or the necessary “if–ender” could be
  8193. missing altogether.
  8194.  
  8195. ____
  8196. "Function(?) has no name."
  8197.     long    (int x, char *tPtr);
  8198. ____
  8199. So, give the poor function a name.
  8200.  
  8201. ____
  8202. "Pascal must be followed by a function."
  8203. ____
  8204. “Pascal” or “pascal” indicates that a function passes arguments and
  8205. returns a value according to Pascal rather than C conventions. For more
  8206. on this topic, see your THINK C manual.
  8207.  
  8208. ____
  8209. "Couldn't find end of initialization."
  8210.     struct MyStruct {int x; long y} instance = {4, 7L;
  8211. ____
  8212. Typically this is caused by a missing or extra '}', as in the above
  8213. example. It could also be caused by a missing semicolon.
  8214.  
  8215. ____
  8216. "Unbalanced statement. Use the Balance command right after OK'ing this
  8217. alert to diagnose the problem."
  8218. ____
  8219. Since the Balance command checks all delimiters and shows you at least
  8220. one end of an unbalanced construction, finding the typo that caused
  8221. the lack of balance is usually straightforward. Selecting Balance a
  8222. second time can be useful—after the second Balance either you’ll be
  8223. shown a mismatch for the first delimiter or you’ll hear a beep
  8224. indicating that the other end is completely missing.
  8225.  
  8226. ____
  8227. "Unbalanced or nested comment. Use the Balance command right after
  8228. OK'ing this alert to diagnose the problem."
  8229. ____
  8230. EnterAct’s comment checking while dictionary–building (and balancing)
  8231. is even stricter than most compilers. For details, see the “Nested and
  8232. bad comments” section in the “Balance” chapter. As a byproduct of
  8233. dictionary–building, all source files in your project will be
  8234. thoroughly checked for comment errors.
  8235.  
  8236. If the problem is due to consecutive comment starts, and you want to
  8237. keep them because that’s the way you do things, select Options from
  8238. the Edit menu and uncheck the “Detect nested comment starts” check box.
  8239. This will partially disable EnterAct’s ability to trap comment
  8240. problems, both when building your dictionary and when balancing.
  8241.  
  8242. ____
  8243. "Lack of balance in parentheses (). Use the Balance command right after
  8244. OK'ing this alert to diagnose the problem."
  8245. ____
  8246. See above, Unbalanced statement....
  8247.  
  8248. ____
  8249. "Unbalanced single or double quotes. Use the Balance command right after
  8250. OK'ing this alert to diagnose the problem."
  8251. ____
  8252. See above, Unbalanced statement....
  8253.  
  8254. ____
  8255. "Unbalanced square brackets []. Use the Balance command right after
  8256. OK'ing this alert to diagnose the problem."
  8257. ____
  8258. See above, Unbalanced statement....
  8259.  
  8260. ____
  8261. "Left curly brace { is not preceded by struct, union, enum, =, or
  8262. function definition."
  8263.     typedef stork MyStruct {int x; long y};/* stork?struct? */
  8264.     long ShouldBeFunction{int x, long y); /* '{' vs '(' */
  8265. ____
  8266. Either the '{' should be something else, such as a '(', or a keyword
  8267. just before the '{' is missing or badly misspelled. EnterAct can handle
  8268. some typo’s, such as typdef sturct... but at some point (such as
  8269. twerpdeaf stork) has to give up and complain.
  8270.  
  8271. ____
  8272. "Colon must signal class name, method name, or low-memory global."
  8273. ____
  8274. Note this exludes some uses of the colon which are irrelevant for
  8275. dictionary–building, such as bit fields and any usage inside a function
  8276. body.
  8277.  
  8278. ____
  8279. "Something is wrong at or near the position shown. Sorry,
  8280. if you can't fix the problem please email tech support."
  8281. ____
  8282. A Shakespearean sonnet will trigger this message. In general, the error
  8283. lies outside of EnterAct’s area of competence. Check for typo’s at or
  8284. near the position shown in the file. This message corresponds to the
  8285. “Syntax error” message that compilers issue when they give up and don’t
  8286. have a clue what’s going on.
  8287.  
  8288. My favourite way to generate this error is to accidentally add a junk
  8289. file with a name ending in .c or .h to a project. A reminder, Add All
  8290. In Folder inhales every text file in a folder.
  8291.  
  8292. This message can also be triggered by a preprocessor conditional that's
  8293. too tough for EnterAct to handle without your help -- see
  8294. "DON’T GIVE UP" near line 108 in this file, and also "Source code
  8295. restrictions", chapter 7, for the details. The symptom here is often
  8296. that the indicated error position is within a function body, an unusual
  8297. case because EnterAct's parser does almost nothing with function
  8298. bodies except check them for balance -- this means the parser ran
  8299. past the start of the function without seeing it. If you spot the usage
  8300. of a macro just above the function, and the usage does not end with
  8301. a semicolon, try entering the name of the macro in the "Macro's to
  8302. skip..." dialog. This usually fixes the problem.
  8303.  
  8304. ____
  8305. "Function body was expected but not found at the position shown."
  8306. ____
  8307. This typically results from a missing left brace '{' at the start of
  8308. a function. Rarely, it can be caused by an excess semicolon in an
  8309. “old–fashioned” style function definition, between the list of
  8310. arguments in round brackets and the start of the function body, eg:
  8311. ____
  8312.     int myFunc(x,y)
  8313.     int x;
  8314.     long y;; /* extra semicolon */
  8315.     {...}
  8316. ____
  8317. The dictionary–builder counts up your arguments, and won’t allow more
  8318. semicolons than you have arguments.
  8319.  
  8320.  
  8321. §    Lookup problems
  8322. For background, here’s a list of common errors that may throw regular
  8323. lookup off:
  8324.     •1    using a synonym
  8325.     •2    full spelling when a nonstandard abbreviation is wanted
  8326.     •3    use of an abbreviation when fuller spelling is wanted
  8327.     •4    full spelling when a standard abbreviation is wanted
  8328.     •5    case error
  8329.     •6    permutation of the words in a name
  8330.     •7    typo
  8331.     •8    spurious extra character
  8332.     •9    homonym (sounds the same, spelled differently)
  8333.     •10    missing definition, due to an error in the source or source file
  8334.             not included etc
  8335.  
  8336. Regular lookup can compensate for the more popular single instances
  8337. of 1-3 above with the lookup table of alternate spellings that you’ll
  8338. find in EnterAct’s 'TEXT' 1000 resource. Single instances of 4-5 are
  8339. thoroughly checked (see next page for the definition of a standard
  8340. abbreviation). An instance of error 6 is also caught, provided there
  8341. are at most four words making up the name. For all other errors (7-10,
  8342. or combinations of errors) EnterAct exhaustively checks what you’ve
  8343. typed against all dictionary entries, totalling up runs of matching
  8344. characters and showing the best matches. If the definition is just
  8345. plain missing, there’s not much that EnterAct can do to help.
  8346.  
  8347. “Sounds like” lookup is extremely error-tolerant, including being
  8348. case-insensitive, at the expense of ignoring some of the information
  8349. (mainly vowels and case) in what you type. It does do the fast checks
  8350. for errors 1-6 above, in the same way as regular lookup. On average
  8351. it’s less accurate than regular lookup, but useful as a last resort.
  8352.  
  8353. Reverse lookup tolerates only case errors, being case-insensitive;
  8354. otherwise, your spelling must be exact (current machines are too slow
  8355. for error-tolerant reverse lookup, and in any case it would be too
  8356. hyperactivated).
  8357.  
  8358.  
  8359. >    Memory failure (yours, that is)
  8360. The term is in your dictionary but you can’t remember the spelling well
  8361. enough to retrieve it? Here are some guidelines to follow:
  8362. •    Nearly every name in your dictionary will have some distinctive part
  8363.     that uniquely identifies it, both from your point of view and
  8364.     EnterAct’s. Spell the distinctive part right, and you’ve got it.
  8365. •    If a name consists entirely of common words (Handle, Get, etc) you’ll
  8366.     have to spell more of the name correctly to help EnterAct distinguish
  8367.     among the possibilities.
  8368. •    If in doubt, spell it out. If there’s no exact match, EnterAct will
  8369.     try all standard abbreviations of each of the words in the name.
  8370. •    When you abbreviate part of a name in your source code, try to follow
  8371.     one of these standard abbreviation rules: 1) starting from the end of
  8372.     a word, drop vowels, and when all vowels are gone start over at the
  8373.     end and drop consonants; 2) truncate the word without regard for
  8374.     vowels; 3) either of the above rules, but keep the last letter of the
  8375.     word. If you follow any of these rules and leave at least 3 characters
  8376.     in the abbreviation then EnterAct will be able to generate the
  8377.     abbreviation from the full spelling, producing instant lookup (eg
  8378.     commandKey will retrieve cmdKey, by applying rule 1 but keeping the
  8379.     last letter of command).
  8380. •    If lookup for the name is immediate but wrong, add a spurious
  8381.     uncommon character at the beginning of the name and try again (if name
  8382.     doesn’t work try zname or xname to force a full search).
  8383. •    Use the Options dialog to increase the number of entries kept per
  8384.     lookup window to 10 or more, and try again.
  8385. •    A single case error will be shrugged off, but otherwise regular
  8386.     lookup is case–sensitive (eg CmdKey or cmdkey will retrieve cmdKey
  8387.     immediately, but CMdKey or CMDKey won’t). If you think you have several
  8388.     case errors, try “sounds like” (<Option><Enter>) lookup instead of
  8389.     regular lookup.
  8390.  
  8391.  
  8392. >    Lookup fails
  8393. You know the term should be in your dictionary but even typing its
  8394. exact name doesn’t retrieve it? This is rare, and is caused by EnterAct
  8395. misinterpreting an error in your source code. Looking at the statement
  8396. where the term is defined or mentioned in your source code will usually
  8397. reveal a simple error such as a missing semicolon or a misspelled
  8398. keyword. If not, switch to your compiler and compile your code until
  8399. you’ve cleared any bugs in the statement where the term occurs.
  8400.  
  8401.  
  8402. >    Miscellaneous lookup problems
  8403. In the rare case that your dictionary is small and the name you type
  8404. doesn’t match any term in the dictionary to any reasonable extent,
  8405. you’ll just hear a beep and no lookup will appear.
  8406.  
  8407. The hint for #defined macros is the same as the hint for other
  8408. #defines—add a '#' after the name, rather than a '('. In general, if
  8409. the lookup you see is not what you wanted and you supplied a
  8410. one–character hint, try again without the hint.
  8411.  
  8412. Looking up classes and methods is discussed in more detail in the
  8413. “Browsing” chapter.
  8414.  
  8415. If you suspect your spelling may be way off, try increasing the “Number
  8416. of entries per lookup window” in the Options dialog to 10 or more, and
  8417. then try the lookup again.
  8418.  
  8419. If you’re quite sure that a term should be in your dictionary but it
  8420. doesn’t appear when you look it up, take a look at the statement where
  8421. the term is defined or mentioned: you could have accidentally violated
  8422. a required coding convention (unlikely), or you could have a succession
  8423. of first–draft errors that has confused EnterAct. A missing semicolon
  8424. or misspelled keyword can sometimes result in a term being skipped.
  8425.  
  8426. If you employ macro’s to do such things as optionally include or omit
  8427. full prototypes, or typedef’s, then you should register them with
  8428. EnterAct using the Macro's to skip command, as described in the “Source
  8429. code restrictions” chapter.
  8430.  
  8431. If you run into a problem that stumps you, please compile your code
  8432. in THINK C before calling for help. However, if you end up fixing bugs
  8433. in your code that you feel EnterAct should have been able to tolerate,
  8434. please call and let us know.
  8435.  
  8436.  
  8437. §    Editing problems
  8438. EnterAct has a single level of undo, and the window that the undo
  8439. applies to must be in front in order for the Undo command to be
  8440. enabled. 
  8441.  
  8442. To undo a Paste Selection Behind, the window pasted into must be in
  8443. front, and the window copied from must be just beneath, the way
  8444. EnterAct leaves them after carrying out the command. If you can
  8445. remember which two windows were involved in the Paste Selection Behind,
  8446. just bring them to the front alternately until the Undo is enabled.
  8447.  
  8448. If Paste doesn’t preserve your indentation, it’s because you’re leaving
  8449. some text at the left of the first line unselected when you select a
  8450. range or insertion point for the Paste. In particular, Paste won’t
  8451. preserve indentation if you select an insertion point for the Paste
  8452. that is to the right of the first visible character on the line
  8453. (“visible character” here meaning something that is not a space or
  8454. tab). While we’re on the subject, you can switch off the preservation
  8455. of indentation for a Paste by typing a single character just before
  8456. you Paste, and then deleting it after.
  8457.  
  8458.  
  8459. §    Balance problems
  8460. If lack of balance is caused by mismatched delimiters, such as '{'
  8461. matched against ']', then by repeatedly selecting Balance you can
  8462. toggle between the two mismatched delimiters.
  8463.  
  8464. If the unbalance is due to a missing delimiter, keep in mind that
  8465. EnterAct handles comments properly, so the error will not be due to
  8466. an extra delimiter inside a comment. For example, a comment such as
  8467. ____
  8468.     /* 1) load
  8469.         2) decrement
  8470.         3) store
  8471.     */ 
  8472. ____
  8473. won’t trigger an error, unless you start with an insertion point or
  8474. selection that is inside the comment.
  8475.  
  8476. If you’re attempting to balance a closing delimiter and Balance has
  8477. to run backwards through an “asm {..}” block while searching for the
  8478. matching opener, you might get a spurious error due to something in
  8479. an assembly–language comment—see the “Balance” chapter in “The asm
  8480. problem” section for details.
  8481.  
  8482. If the problem is due to consecutive comment starts, and you want to
  8483. keep them because that’s the way you do things, select Options from
  8484. the Edit menu and uncheck the “Detect nested comment starts” check box.
  8485. This will partially disable EnterAct’s ability to trap comment
  8486. problems, both when building your dictionary and when balancing.
  8487.  
  8488. When you Balance an entire file, you will hear a beep whether or not
  8489. the file balanced, just to tell you that the balancing is finished.
  8490. If the cursor doesn’t move from the top of the file, that means the
  8491. entire file is balanced. If there is any error in the file, you will
  8492. be shown the first unbalanced delimiter.
  8493.  
  8494. When balancing just part of a file, you will hear a beep only if there
  8495. is an error. Otherwise, the selection range will quietly expand to the
  8496. next largest balanced range. If there is no larger enclosing range
  8497. (this is the case when you start with an entire function body selected,
  8498. for example) you’ll hear a beep but the selection range will not change
  8499.  
  8500. With the exception of strings, only two types of balance errors can
  8501. occur; mismatched ends, and missing ends. If Balance beeps and shows
  8502. you an unbalanced delimiter, try immediately selecting Balance again.
  8503. Then, if the problem is due to mismatched delimiters, you will be shown
  8504. the other end. If the problem is a missing end, nothing new will
  8505. happen—you’ll hear another beep, but the selected delimiter will not
  8506. change.
  8507.  
  8508. Strings in double quotes " " are checked for one additional special
  8509. error, a missing backslash if the string is continued across lines.
  8510. The backslash must be the very last character on the continued line,
  8511. just before the <Return>—note that even a space before the <Return>
  8512. will “hide” the backslash. Personally, I don’t think this is
  8513. reasonable, but that’s the way C is.
  8514.  
  8515. -    -    -    -    -    -    -    -    -    -    -    -
  8516. License agreement, tech support
  8517. -    -    -    -    -    -    -    -    -    -    -    -
  8518. §    Technical support
  8519. You can reach me (Ken Earle) at:
  8520. ____
  8521.  
  8522. 73073,2166                                    via CompuServe,
  8523.  
  8524. 73073.2166@compuserve.com        via InterNet.
  8525.  
  8526. or via real-mail at:
  8527. Ken Earle
  8528. 697 Spadina Ave
  8529. Toronto, Ont
  8530. Canada M5S 2J1
  8531. ____
  8532.  
  8533. (reply will be by e-mail, so please include a
  8534. CompuServe or InterNet address).
  8535.  
  8536. §    License
  8537. By using EnterAct, you are agreeing to abide by the
  8538. terms of this license. If you disagree, don't use it. If you agree,
  8539. send money, then come to disagree and want your money
  8540. back—well heck, everybody makes mistakes now and then,
  8541. just let me know what the problem is and you'll get your
  8542. refund. Do so within 60 days though, else I may deem that
  8543. EnterAct in your hands has already paid for itself several
  8544. times over.
  8545.  
  8546. This version of EnterAct carries a charge of zero dollars and
  8547. zero cents Canadian, so sending that in is optional.
  8548.  
  8549. Neither Apple Computer, Inc., nor Symantec Corporation make any
  8550. warranties, either express or implied, regarding the enclosed computer
  8551. software, its merchantibility, or its fitness for any particular
  8552. purpose. The exclusion of implied warranties is not permitted by some
  8553. governments. The above exclusion may not apply to you. This warranty
  8554. provides you with specific legal rights. There may be other rights that
  8555. you may have which vary according to location.
  8556.  
  8557. EnterAct and this manual are copyrighted, with all rights reserved.
  8558. You may distribute full copies of EnterAct (omitting no files from
  8559. the compressed archive that comprises EnterAct), provided you
  8560. do not charge for EnterAct itself.
  8561.  
  8562. In no event shall Dynabyte or any other legal entity involved in the
  8563. creation, production, or delivery of this product be liable for any
  8564. direct, indirect, consequential, or incidental damages (including loss
  8565. of data, lost business profits, business interruption, carpal tunnel
  8566. syndrome, and the like) arising out of the use of or inability to use the
  8567. software or accompanying material.
  8568.  
  8569. EnterAct does not support shared file access. If you use EnterAct on
  8570. a network, or as a member of a team working on the same source,
  8571. be aware that EnterAct will allow two or more people to open
  8572. one file with full read/write access. You must use some separate
  8573. form of source code control to avoid losing or accidentally
  8574. generating variant versions of files.
  8575.  
  8576. This agreement will be governed by the laws of the Province of Ontario
  8577.  
  8578. "hAWK", "Read Resource", their associated source code and
  8579. manuals, and the Drag_on Modules interface are yours to keep,
  8580. free, no matter what. They are governed by the Free Software
  8581. Foundation's "copyleft", as described in the document "copying
  8582. hAWK", included with your EnterAct package.
  8583.  
  8584. -    -    -    -    -    -    -    -    -    -    -    -
  8585. Appendix 1 Drag_on Modules
  8586. -    -    -    -    -    -    -    -    -    -    -    -
  8587.  
  8588. Drag_on Modules resemble HyperCard XCMD’s and MPW tools in that
  8589. they are separately–compiled chunks of code that are designed to
  8590. be called from within some application. The calling application is
  8591. at liberty to provide any of a dozen or so callback functions, which
  8592. mainly enhance text–oriented communication between the calling
  8593. application and Drag_on Modules, but these are all optional. The
  8594. calling interface has been kept simple, so that if you have an
  8595. application written in C or C++ you can add to it the ability to call
  8596. Drag_on Modules without hurting yourself—a day or two should do
  8597. it. Instructions for doing so can be found towards the end of the
  8598. “hAWK User’s Manual” and in the file “Call_Resource.c”. The
  8599. source code for “Minimal App7" illustrates the basic process. As
  8600. far as the callback functions go, if your application deals with
  8601. TEXT documents you’ll be able to support most of them easily, and
  8602. if you can’t support one then the Drag_on Modules will get along
  8603. without it.
  8604.  
  8605. The idea behind Drag_on Modules is to provide a medium for the
  8606. inexpensive modular distribution of source code that works best
  8607. when it is allowed to interact with full applications. Drag_on
  8608. Modules could easily be repackaged as separate applications, but
  8609. then the interaction with other applications would be slower. In
  8610. the absence of a universal “shell”, the next–best solution offered
  8611. by Drag_on Modules and the like is to let each application be a
  8612. shell. Admittedly, System 7 has promise as a universal application
  8613. coordinator, but while we’re waiting it’s nice to be able to achieve
  8614. the same effect with just 2K of overhead per application and the
  8615. extreme simplicity of file–based communication for major input
  8616. and output.
  8617.  
  8618. To help the illusion that there is a shell lurking in the background,
  8619. Drag_on Modules communicate by means of standard input, output, and
  8620. error files. This allows results from one Drag_on Module run to be
  8621. passed as input to a subsequent run, for example.
  8622.  
  8623. Two Drag_on Modules are currently being shipped, hAWK and Read
  8624. Resource.
  8625.  
  8626. Read Resource is just a simple resource or data fork viewer.
  8627.  
  8628. hAWK is a Mac implementation of AWK. You may have seen above
  8629. that hAWK has a "three clicks and Run" interface, and it's true:
  8630. for example, you could select hundreds of file as input to a
  8631. hAWK program by putting bullets beside them in your project
  8632. window, and then to call up the program: select "hAWK" from
  8633. the EnterAct menu; pick your program from the top popup;
  8634. optionally adjust the input option (all or part of the front file,
  8635. MFS-selected (ie bulleted) files, or a specific file -- this option
  8636. can be saved with the program, so normally there is no need to
  8637. change it); and then click Run. The program will run in the
  8638. background as you continue to work with EnterAct.
  8639.  
  8640. Added for version 3, you can now write hAWK programs that
  8641. watch EnterAct's clipboard, and, when your specified conditions
  8642. are met, write anything you like back to the clipboard. This
  8643. gives you in effect a "magic clipboard", ideal for reducing
  8644. repetitive, moderately complicated tasks to a simple Copy
  8645. and Paste. For details see the separate document
  8646. "EnterAct's magic clipboard".
  8647.  
  8648. And in version 3.6, a hAWK program can be invoked by placing
  8649. a command line for the program in any EnterAct text window and
  8650. then  pressing <enter> or <command><return> with the command line
  8651. selected. For an example, see "§    Code templates" in the Editing chapter
  8652. above. For details, see "Appendix 2 Calling hAWK programs" just below.
  8653.  
  8654. Drag_on Modules come with complete source code. Complete code and
  8655. instructions for calling Drag_on Modules from your own application can
  8656. be found in the file “Call_Resource.c”, as supplemented by the example
  8657. of “Minimal App7".  If you are interested in creating your own Drag_on
  8658. Module, please see the “write your own Drag_on” folder.
  8659.  
  8660. -    -    -    -    -    -    -    -    -    -    -    -    -    -    -    -
  8661. Appendix 2 Calling hAWK programs
  8662. -    -    -    -    -    -    -    -    -    -    -    -    -    -    -    -
  8663. hAWK programs can be called via a dialog, by picking "hAWK" from
  8664. the EnterAct menu, or by entering a command line in any text
  8665. window. The "hAWK User's Manual" explains how to write hAWK
  8666. programs, and also how to run programs via the dialog. If you like
  8667. the idea of being a power EnterAct user, the section below called
  8668. "Calling hAWK with a command line" will have you firing off
  8669. hAWK programs by typing a few characters.
  8670.  
  8671. §    Calling hAWK from the menu
  8672. EnterAct follows the procedure described in the hAWK User's Manual,
  8673. in the chapter "Running hAWK programs". The "MFS selected files"
  8674. input option corresponds to the bulleted text files in your current
  8675. EnterAct project (you can put bullets (•) beside project file names by
  8676. using the buttons in the Find dialog, or by <option>dragging in the
  8677. project window). Your hAWK program will run in the background
  8678. by default, so you can continue working in EnterAct while running
  8679. a lengthy program.
  8680.  
  8681. If you're using EnterAct to view this and have installed the
  8682. Drag_on Modules folder, give hAWK a try right now:
  8683. •    put some bullets beside some file names in your project window
  8684. (if you don't have a project yet, please read at least "EnterAct in
  8685. brief" to get going)
  8686. •    select "hAWK" from the EnterAct menu
  8687. •    pick the program "$EchoFullPathNames" from the top popup
  8688. menu in the resulting setup dialog
  8689. •    click the Run button
  8690. •    the stdout window will appear after a couple of seconds,
  8691. holding a list of the full path names for your selected project
  8692. files.
  8693.  
  8694. If you're intrigued, please see the hAWK User's Manual for details.
  8695.  
  8696. §    Calling hAWK with a command line
  8697. If you need to regularly run a hAWK program, and it doesn't take
  8698. its input from the front text window, you might find it handier
  8699. to run it with a command line. Command lines aren't too nasty
  8700. to construct, and you'll only have to do it once for each program
  8701. if you create a code template for the command line. There
  8702. are examples below, and it really is fairly easy.
  8703.  
  8704. You can enter a hAWK command line in any text window. To run it,
  8705. select the entire command line and press <command><return>
  8706. or <enter>. This will run the hAWK program immediately, without
  8707. any setup dialog to go through. Hey, that's the whole point.....
  8708.  
  8709. First let's build hAWK command lines. This is the format of a hAWK
  8710. command line (note it can cover several lines):
  8711. ____
  8712. hAWK -f"Program Name" -f"Library Name"
  8713.     -s -ss -n
  8714.     -vVariableName="some value" -- MFS "InputFullPathname"
  8715. ____
  8716.  
  8717. and this is what that means:
  8718. •    the command line text must begin with "hAWK" followed by a space
  8719. or tab
  8720. •    there must be one program name, as signalled by -f. If you just supply
  8721. a simple program name, it must reside in the "hAWK programs" folder.
  8722. Use a full path name if the program is in some other folder. If the
  8723. program name (or any part of the full path name) contains a space, then
  8724. put quotes "" around the full name, otherwise the quotes are not needed.
  8725. •    the library names are the same as program name, and these are
  8726. optional. Since library names look the same as the program name, the
  8727. first one seen is taken as the program name. Libraries are scarce as
  8728. hen's teeth, so forget about them.
  8729. •    variables are signalled by the -v option, eg -vmyName="Ken E" or
  8730. -vLevel=1 where the quotes "" are optional if the value contains no
  8731. spaces or tabs. Spaces before the '=' sign are optional, but don't put any
  8732. between the '=' and the actual value. Variables are optional. In
  8733. particular, any variable settings that have been saved with the program
  8734. (by using the setup dialog) will automatically be passed along with the
  8735. command line, and so you should set these variables on the command
  8736. line only if you want to override the default saved values (to see those,
  8737. select the program in the setup dialog and click the "Set variables..."
  8738. button).
  8739. •    "--" signals that input files only follow. This is optional, mainly to
  8740. make reading easier.
  8741. •    "MFS" stands for "all files currently selected for multi-file
  8742. operations", in other words the bulleted files in your project
  8743. window as you're no doubt tired of hearing. This one is optional.
  8744. •    input file names are optional, and should be provided as full path
  8745. names. If any part of the full name contains a space then the quotes ""
  8746. are necessary, otherwise they're optional.
  8747.  
  8748. You may also optionally use the following output options (ugh was
  8749. that English?) in the command line (place them before any "--"):
  8750. •    -s means show stdout when done
  8751. •    -ss means show and select stdout when done
  8752. •    -n means no showing of stdout when done.
  8753.  
  8754. If you don't provide an output option, any output option from the
  8755. settings saved with the program will be used instead (these correspond
  8756. to the "Show/select stdout" checkboxes in the setup dialog). Any output
  8757. option you do provide overrides the saved settings.
  8758.  
  8759. You may supply both "MFS" and one or more specific input files on a
  8760. command line, and unlike the dialog approach you may supply any
  8761. number of variables (the dialog is limited to 10).
  8762.  
  8763. Here are some example command lines:
  8764. ____
  8765. hAWK -f$EchoFullPathNames -- MFS
  8766.  
  8767. hAWK -f$BoilerPlate -vputInComment=1 -vfile="@.c"
  8768.     -vauthor="KE" -vcompany="bdibdi" -ss
  8769.  
  8770. hAWK -f$FormatFunctionIntro
  8771.  
  8772. hAWK -f"Disk:Folder:$SomeProgram" -- "Disk:Folder2:OneInputFile"
  8773.     "Disk:Folder3:AnotherInputFile"
  8774. ____
  8775. The first three there are real hAWK programs supplied with EnterAct,
  8776. and if you take a look at the programs themselves it will help you
  8777. see what happens with each command line. The last one is made up.
  8778. "bdibdi" is pronounced "two little bdi's".
  8779.  
  8780. Now the point of this, as mentioned, is to bypass the setup dialog
  8781. and call a hAWK program with just a few keystrokes. Since command
  8782. lines are more than a few keys long, there are two approaches you can
  8783. take to avoid retyping them:
  8784. •    save them all in a file, and then select them when needed
  8785. •    create a code template with a nice mnemonic name for each
  8786. command line. This is the handiest approach, provided you don't
  8787. have several dozen programs you want to run regularly.
  8788.  
  8789. Code templates are explained in the "Code templates" section of the
  8790. "Editing" chapter, in fact they're nicely explained at the top of the
  8791. "EnterAct Code Templates" file which is where they all live. This is
  8792. essentially a glossary capability, and to use an entry you type its
  8793. name and press <command><return> to expand it. Code templates know
  8794. about hAWK templates, and if an entry expands to a hAWK template
  8795. then it will be selected for you. To run the template, you press
  8796. <command><return> a second time.
  8797.  
  8798. Here's a typical code template for a hAWK command line, taken from
  8799. the EnterAct Code Templates file:
  8800. ____
  8801. ENTRY
  8802. echo
  8803. hAWK -f$EchoFullPathNames -- MFS
  8804.  
  8805. END
  8806. ____
  8807. This means you can get a list of full path names for bulleted files in
  8808. your project by typing "echo" and then pressing <command><return>
  8809. twice. The first <command><return> replaces "echo" with the
  8810. command line, and selects it: the second <command><return> runs
  8811. the hAWK program "$EchoFullPathNames".
  8812.  
  8813. To try one out for yourself, open up the EnterAct Code Templates file,
  8814. scroll down just a little bit to the "boiler" entry, and change the
  8815. values of the "author" and "company" variables to suit your taste.
  8816. Save the Templates file, and then (immediately) in any text window
  8817. type "boiler" and press <command><return> twice. See what you get.
  8818.  
  8819. Not that tough after all.
  8820.  
  8821. -    -    -    -    -    -    -    -    -    -    -    -    -    -    -    -
  8822. Appendix 4 EnterAct as THINK's editor
  8823. -    -    -    -    -    -    -    -    -    -    -    -    -    -    -    -
  8824.  
  8825. EnterAct can be used as a replacement for THINK’s own internal editor.
  8826. This means you can take full advantage of EnterAct’s features when
  8827. creating your documentation and source, and the THINK Project Manager
  8828. will be able to track all the changes you make as though you were using
  8829. its own editor.
  8830.  
  8831.  
  8832. §    Requirements
  8833. To use EnterAct as a replacement for THINK’s own internal editor, you
  8834. must have:
  8835. •    EnterAct 2.5 or later (you do)
  8836. •    THINK C 6 or later
  8837. •    System 7
  8838. •    about 2 Megabytes each for the THINK Project Manager and EnterAct.
  8839.  
  8840. §    Installing EnterAct as THINK’s editor
  8841. Create an alias of EnterAct, rename it “Editor”, and drop it into
  8842. the “Tools” or “(Tools)” folder inside your THINK C folder. Then
  8843. start up THINK Project Manager, and under the Project Managers’s
  8844. Editor options select “use external editor”—you’ll find this under
  8845. the Edit menu, in the “Editor” options for the Project Manager.
  8846. Recommended, deselect the “Reopen files” option in THINK’s Editor
  8847. options at this point, since EnterAct does a more thorough job of
  8848. reopening EnterAct project files, and this should prove to be all
  8849. you need.
  8850.  
  8851.  
  8852. §    Starting a session
  8853. Start the THINK Project Manager and open a THINK project in your usual
  8854. way. The first action you undertake that requires viewing a text file
  8855. will trigger THINK to start EnterAct. Most often you’ll double-click
  8856. on a file listed in your THINK project, but you might also select the
  8857. “Open” command, or double-click on the result of a batch find to view
  8858. a particular instance, etc. In all cases, when EnterAct starts up you
  8859. will be offered the opportunity to open an existing EnterAct project
  8860. or create a new one. After you’ve opened or created a project, or
  8861. cancelled, the text file will open in EnterAct.
  8862.  
  8863.  
  8864. §    Working with EnterAct as THINK’s editor
  8865. EnterAct and THINK projects serve different purposes, and typically
  8866. even hold different lists of files—an EnterAct project, for example,
  8867. can contain source files that are included for reference only, and
  8868. system and other header files can be explicitly listed in the project
  8869. window, and your dictionary updated for them, right from the moment
  8870. you create the project. So you’ll need an EnterAct project to handle
  8871. your code creation, documentation, and review, and a THINK project to
  8872. handle compiling and testing.
  8873.  
  8874.  
  8875. For the most part, when you want to compile or test you should be in
  8876. THINK, and when you want to edit or view files you should be in
  8877. EnterAct. To switch from EnterAct to THINK, click in your THINK project
  8878. window. To return to EnterAct, click in your EnterAct project window,
  8879. or any open text window that belongs to EnterAct. Though EnterAct may
  8880. be more tightly coupled to THINK in future versions, this simple
  8881. approach has the advantage that all of the THINK commands you use
  8882. regularly are still where you expect under your THINK menus, with one
  8883. extra click on your THINK project window required to place you back
  8884. in the right context for them.
  8885.  
  8886. Of course, opening any text file when in THINK will automatically
  8887. switch you over to EnterAct in order to display the file. And if a file
  8888. is listed in both your THINK and EnterAct projects, you can
  8889. double-click on either instance to open the file, with the same results
  8890.  
  8891. If all of your changes to source files have been made with EnterAct
  8892. acting as THINK’s replacement editor, or with THINK’s own editor, then
  8893. you can bring your THINK project fully up to date with the “Bring Up
  8894. To Date” command under THINK’s “Project” menu, and there is no need
  8895. to “Make” or “Scan Disk” to detect which files have changed. Your
  8896. EnterAct projects will typically need to be brought up to date only
  8897. for significant changes made outside of function bodies, and if all
  8898. changes were made with EnterAct you can use the Update Dictionary
  8899. command under EnterAct’s “EnterAct” menu.
  8900. Please note that both EnterAct and the THINK Project Manager will
  8901. automatically note changed files only for the project that is currently
  8902. open, and if some other project includes a changed file then you will
  8903. need to use THINK’s “Make” command or EnterAct’s Update Dictionary
  8904. to bring the project fully up to date.
  8905.  
  8906. In brief: there is nothing special you need to do when using EnterAct
  8907. as THINK’s editor.
  8908.  
  8909.  
  8910. §    Using THINK’s Find commands from EnterAct
  8911. Three commands at the bottom of EnterAct’s Search menu allow you to
  8912. invoke THINK’s Find commands: specifically, you can view the next or
  8913. previous matches from a batch find, or call THINK’s “Find In Next File”
  8914. command from EnterAct.
  8915.  
  8916. THINK Find Again and THINK Find Previous refer to the results of a
  8917. batch find done in THINK, and allow you to step through the matches,
  8918. viewing them with EnterAct. The batch find must first be carried out
  8919. in THINK, for which see your THINK User Manual.
  8920.  
  8921. THINK Find In Next File is the equivalent of returning to the THINK
  8922. Project Manager and selecting “Find In Next File”—once again, you will
  8923. need to use THINK’s Find dialog to set up the multi-file search
  8924. beforehand.
  8925.  
  8926. By the way, EnterAct’s own multi-file searching capabilities are
  8927. entirely independent of the THINK Project Manager’s. To do a straight
  8928. multi-file search, you should use EnterAct, since here it is slightly
  8929. easier to set up. For a batch find, you’ll need to set your search up
  8930. in the THINK Project Manager and then use THINK Find Again and THINK
  8931. Find Previous in EnterAct afterwards. (EnterAct also has a batch find,
  8932. but doesn't (yet) have the nifty Find Previous gizmoid. To jump to
  8933. a particular instance of one of EnterAct's finds, click on the line
  8934. reporting the find and use "Go to...".)
  8935.  
  8936. Find in THINK Reference does the same thing as the command of the
  8937. same name in the THINK Project Manager's editor: it passes your
  8938. currently-selected text over to THINK Reference, where you'll be
  8939. shown any entry it has on the name in question. Note this works only
  8940. with THINK Reference version 2 or later. For this command to work,
  8941. you need to have a folder named "Tools" or "(Tools)" next to EnterAct,
  8942. and drop an alias of THINK Reference in it.
  8943.  
  8944. -    -    -    -    -    -    -    -    -    -    -    -    -    -    -    -
  8945. Appendix 5 EnterAct and Code Warrior
  8946. -    -    -    -    -    -    -    -    -    -    -    -    -    -    -    -
  8947. By default, when you open a document and Code Warrior also has the
  8948. document open, EnterAct will put up a dialog giving you the options
  8949. of forcing Code Warrior to save and close the file before EnterAct
  8950. opens it, or of cancelling the Open. If you're not sure, return to
  8951. Code Warrior and decide whether or not to save the file. Note if
  8952. you do click "OK" to have EnterAct tell Code Warrior to save and
  8953. close the file, any changes to the file will not be undoable --after
  8954. all, it's not like editors these days have 10,000-level persistent
  8955. selective undo or anything. But shouldn't they?
  8956.  
  8957. As described elsewhere, EnterAct will by default save all
  8958. documents when you switch out, and refresh them from disk
  8959. when you switch back (only if needed of course). So there is
  8960. no decision to make when editing documents with Code Warrior
  8961. while EnterAct has the same documents open, since EnterAct will
  8962. have already saved them. When you switch back to EnterAct,
  8963. if you left the document open with Code Warrior you'll get that
  8964. dialog asking about forcing Code Warrior to save and close it,
  8965. or if you saved and closed the document before leaving Code Warrior
  8966. then EnterAct will just refresh the document from disk.
  8967.  
  8968. The "default" referred to above is the “Safe switching...” option
  8969. in EnterAct's Options dialog, which is on by default and saves your
  8970. documents when you switch out from EnterAct. Better to save too
  8971. often, since you can always revert with the “Show Activities”
  8972. command and a little cut and paste.
  8973.  
  8974. To use EnterAct as just a looker-upper with Code Warrior, see
  8975. "§    EnterAct as a "definition finder" for other editors" in the Lookup
  8976. chapter.
  8977.  
  8978. You can use EnterAct's multi-file search independently of Code
  8979. Warrior's, and EnterAct's is often handier because you can include
  8980. more files in your EnterAct project (all toolbox headers, or files
  8981. from several separate Code Warrior projects, or all Power Plant
  8982. files, for example).
  8983.  
  8984. -    -    -    -    -    -    -    -    -    -    -    -    -    -    -    -
  8985. Appendix 6 the Scripts menu
  8986. -    -    -    -    -    -    -    -    -    -    -    -    -    -    -    -
  8987. EnterAct itself understands only the four basic Apple events,
  8988. but you can use it to run any compiled AppleScript: just drop
  8989. the script in your "(EnterAct Scripts)" folder and it will
  8990. appear under EnterAct's Scripts menu (the next time you
  8991. start EnterAct). The scripts must be compiled, and should be
  8992. the sort that don't need any parameters or events to get going,
  8993. and that quit when they're done their specific task. Recompiling
  8994. your current CW or Symantec project is an example.
  8995.  
  8996. Any text your script puts in the AppleScript "result" variable
  8997. will be shown to you when the script terminates, in EnterAct's
  8998. stdout window.
  8999.  
  9000. To see it work, try the "Beep Once" script that's supplied. You should
  9001. see the stdout window after you hear a beep.
  9002.  
  9003. Event handling is minimal in EnterAct while a script is running: you
  9004. can interrupt a script with <Command><period>, and switch out of
  9005. EnterAct, but nothing else. The upshot is that scripts are appropriate
  9006. for running within EnterAct if they do something not too lengthy that
  9007. has to be done anyway before you can continue. Scripts that are to
  9008. run all the time or that take a very long time should be run some
  9009. other way (eg by double-clicking on the script itself).
  9010.  
  9011.