home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 5 Edit / 05-Edit.zip / ftnote1.zip / FOOTCHK < prev    next >
Text File  |  1993-11-07  |  9KB  |  187 lines

  1. !     filename  FOOTCHK         11/07/93
  2. VAR oops
  3. VAR startFrameName
  4. VAR startMarker
  5. VAR holdFrameName
  6. VAR framePageNumber
  7. VAR oopsMessage
  8. VAR currentFrameName
  9. VAR placeMarker
  10. VAR tagPageNumber
  11. VAR message
  12. VAR charAtCursor
  13. VAR previousFootnoteCount
  14. VAR currentFootnoteCount
  15. VAR addedFootnotes
  16.  
  17. MACRO  CheckIfOnSamePageInitial   
  18.         GoToLinkTag "startpoint"
  19.         SET startFrameName TO FrameName
  20.         SET startMarker TO CursorPosition
  21.         SET placeMarker TO CursorPosition 
  22.         SET currentFrameName TO FrameName
  23.         SET SelectedFrame TO "footnote data"
  24.         CursorHome
  25.         SET x TO 0
  26.         REPEAT
  27.                 TableCellTab
  28.                 TableCellTab
  29.                 SET charAtCursor TO CursorCharacter
  30.                 TableCellTab
  31.                 TableCellTab
  32.                 TableCellTab
  33.                 EXIT WHEN charAtCursor = "0"
  34.                 SET x TO x + 1
  35.         END REPEAT
  36.         SET previousFootnoteCount TO x
  37.         SET SelectedFrame TO currentFrameName
  38.         SET x TO 1
  39.         REPEAT
  40.                 ParagraphDown
  41.                 SET x TO x + 1
  42.                 EXIT WHEN EndOfFrame
  43.                 SET currentFootnoteCount TO x
  44.         END REPEAT
  45.         SET CursorPosition TO placeMarker
  46.         SET addedFootnotes TO currentFootnoteCount - previousFootnoteCount
  47.         IF addedFootnotes = 0 THEN
  48.         ELSE    
  49.                 IF addedFootnotes =1 THEN
  50.                         MSG "You have added one footnote. You should skip the Initial Check Phase when you 'Create Footnotes'"
  51.                 ELSE
  52.                         END IF
  53.                 IF addedFootnotes =2 THEN
  54.                         MSG "You have added two footnotes. You should skip the Initial Check Phase when you 'Create Footnotes'"
  55.                 ELSE
  56.                         END IF
  57.                   IF addedFootnotes =3 THEN
  58.                         MSG "You have added three footnotes. You should skip the Initial Check Phase when you 'Create Footnotes'"
  59.                 ELSE
  60.                         END IF
  61.                 IF addedFootnotes =4 THEN
  62.                         MSG "You have added four footnotes You should skip the Initial Check Phase when you 'Create Footnotes'"
  63.                 ELSE
  64.                         END IF
  65.                 IF addedFootnotes =5 THEN
  66.                         MSG "You have added five footnotes. You should skip the Initial Check Phase when you 'Create Footnotes'"
  67.                 ELSE
  68.                         END IF
  69.                 IF addedFootnotes >5 THEN
  70.                 MSG "You have added more than five footnotes. You should skip the Initial Check Phase when you 'Create Footnotes'"
  71.                 ELSE
  72.                         END IF
  73.         END IF
  74.         IF addedFootnotes = 0 THEN
  75.         ELSE
  76.                 IF addedFootnotes < 0 THEN
  77.                         SET addedFootnotes TO 0 - addedFootnotes        
  78.                         IF addedFootnotes = 1 THEN
  79.                                 MSG "You have deleted one footnote. You should skip the Initial Check Phase when you 'Create Footnotes'"
  80.                         ELSE
  81.                                 END IF
  82.                         IF addedFootnotes = 2 THEN
  83.                                 MSG "You have deleted two footnotes. You should skip the Initial Check Phase when you 'Create Footnotes'"
  84.                         ELSE
  85.                                 END IF
  86.                         IF addedFootnotes = 3 THEN
  87.                                 MSG "You have deleted three footnotes. You should skip the Initial Check Phase when you 'Create Footnotes'"
  88.                         ELSE
  89.                                 END IF
  90.                         IF addedFootnotes = 4 THEN
  91.                                 MSG "You have deleted four footnotes You should skip the Initial Check Phase when you 'Create Footnotes'"
  92.                         ELSE
  93.                                 END IF
  94.                         IF addedFootnotes = 5 THEN
  95.                                 MSG "You have deleted five footnotes. You should skip the Initial Check Phase when you 'Create Footnotes'"
  96.                         ELSE
  97.                                 END IF
  98.                         IF addedFootnotes > 5 THEN
  99.                                 MSG "You have deleted more than five footnotes. You should skip the Initial Check Phase when you 'Create Footnotes'"
  100.                         ELSE
  101.                                 END IF
  102.                 ELSE
  103.                 END IF
  104.         END IF
  105.         SET oops TO "off"       
  106.         SET x TO 1
  107.         SET holdFrameName TO FrameName
  108.         SET currentFrameName TO FrameName
  109.         SET SelectedFrame TO "footnote data"
  110.         SET placeMarker TO CursorPosition
  111.         CursorHome
  112.         SET SelectedFrame TO holdFrameName
  113.         REPEAT
  114.                 SET StatusMessage TO "Checking if footnotes are on the correct page........"
  115.                 SET holdFrameName TO FrameName
  116.                 SET SelectedFrame TO "footnote data"
  117.                 DefineToWordEnd
  118.                 CopyToClipboard
  119.                 CancelDefinedBlock
  120.                 SET m TO PastedClipboard        
  121.                 TableCellTab
  122.                 TableCellTab
  123.                 DefineToWordEnd
  124.                 CopyToClipboard
  125.                 CancelDefinedBlock
  126.                 TableCellTab
  127.                 TableCellTab
  128.                 TableCellTab
  129.                 SET x TO PastedClipboard
  130.                 EXIT WHEN x = "0"
  131.                 CONVERT x TOSTRING x
  132.                 SET LinkTagName TO x
  133.                 SET SelectedFrame TO holdFrameName
  134.                 IF LinkTagExists THEN
  135.                         GoToLinkTag x
  136.                         SET tagPageNumber TO CursorPageNumber
  137.                         SET SelectedFrame TO x
  138.                         SET framePageNumber TO CursorPageNumber
  139.                         CONVERT x TOVALUE x
  140.                         IF framePageNumber < tagPageNumber THEN
  141.                                 SET m TO "Footnote " + m
  142.                                 SET m TO m + " on Page "
  143.                                 CONVERT framePageNumber TOSTRING framePageNumber
  144.                                 SET m TO m + framePageNumber
  145.                                 SET m TO m + " is before its reference number on Page "
  146.                                 CONVERT tagPageNumber TOSTRING tagPageNumber
  147.                                 SET m TO m + tagPageNumber
  148.                                 SET m TO m + ".        Run FOOTSTRT to correct this."
  149.                                 SET oops TO "on"
  150.                                 SET StatusMessage TO "This footnote is on the page before its reference. This can be corrected."
  151.                                 MSG m
  152.                         ELSE
  153.                                 IF framePageNumber > tagPageNumber THEN
  154.                                         SET m TO "Footnote " + m
  155.                                         SET m TO m + " on Page "
  156.                                         CONVERT framePageNumber TOSTRING framePageNumber
  157.                                         SET m TO m + framePageNumber
  158.                                         SET m TO m + " is after its reference number on Page "
  159.                                         CONVERT tagPageNumber TOSTRING tagPageNumber
  160.                                         SET m TO m + tagPageNumber
  161.                                         SET m TO m + ".        Run FOOTSTRT to correct this."
  162.                                         SET oops TO "on"
  163.                                         SET StatusMessage TO "This footnote is on the page after its reference. This can be corrected."
  164.                                         MSG m
  165.                                 ELSE                    
  166.                                 END IF
  167.                         END IF
  168.                 ELSE
  169.                         EXIT
  170.                 END IF
  171.                 CONVERT x TOVALUE x
  172.                 EXIT WHEN x = 2100
  173.                 EXIT WHEN x = 0
  174.                 SET x TO x + 1
  175.         END REPEAT
  176.         SET SelectedFrame TO holdFrameName
  177.         IF oops = "on" THEN
  178.         ELSE
  179.                 MSG "All previous footnotes are correctly placed. Use The 'Create 'Footnotes' option if you've added or deleted any. "
  180.                 SET SelectedFrame TO holdFrameName
  181.                 SET CursorPosition TO placeMarker
  182.          END IF
  183. SET SelectedFrame To startFrameName
  184. SET CursorPosition TO startMarker 
  185.  
  186. END MACRO
  187.