home *** CD-ROM | disk | FTP | other *** search
/ Programming Languages Suite / ProgLangD.iso / Bonus / WSTAR2 / DISK4 / SGLSPACE.WM_ / SGLSPACE.bin
Encoding:
Text File  |  1994-02-28  |  11.2 KB  |  144 lines

  1. REM Description:  Change paragraph(s) to single spacing
  2. REM Filename: sglspace.wmc
  3. REM Created by: Steve Wylie - 11/08/93
  4.  
  5. REM Can't run if no document open
  6. IF GetDocName$() = "" THEN
  7.     MESSAGE "Please create a new document or open an existing document first."
  8.     STOP
  9. ENDIF
  10.  
  11. REM Can't run in a graphic or table frame
  12. frameType% = GetFrameType()
  13. IF frameType% <> 0 THEN
  14.     Message "The current frame must be a text frame."
  15.     STOP
  16. ENDIF
  17.  
  18. REM Can't run in frame mode
  19. ret% = ViewEditMode(1)
  20. IF ret% = 2 THEN
  21.     ret% = ViewEditMode(2)
  22.     BEEP
  23.     STOP
  24. ENDIF
  25.  
  26. REM Changed local% to 0 if you want the change to apply globally to the paragraph style.
  27. local% = 1
  28.  
  29. REM Save the beginning and end of the selection
  30. yes% = GetTextOffset(strt%, end%)
  31. IF strt% = 0 THEN strt% = 4
  32.  
  33. REM Freeze the screen so that the activity isn't visible
  34. freeze% = ViewFreezeScreen(1)
  35.  
  36. REM Count the number of paragraphs
  37. EditGotoOffset strt%, 
  38. DO
  39.     ret% = GetTextOffset(savestart%, saveend%)
  40.     ParaDown 1, 
  41.     ret% = GetTextOffset(start2%, end2%)
  42.     numParagraphs% = numParagraphs% + 1
  43. LOOP UNTIL end2% >= end% OR end2% = saveend%
  44.  
  45. REM Go to the beginning of the selection
  46. EditGotoOffset strt%, 0
  47.  
  48. FOR i% = 1 TO numParagraphs%
  49.     REM Get the style information
  50.     GetStyleFont typeFace$, size%, lineHeight%, bold%, italic%, underline%, strikeout%, hidden%, placeUnderline%, strikeoutChar$
  51.     
  52.     REM Set the line height to 120% of the font size.  Change the number from 240
  53.     REM to a different value to change the default line height.
  54.     lineHeight% = (size% * 120) / 100
  55.  
  56.     REM Redefine the style with the new line height.
  57.     DefineStyle , local%
  58.     DefineStyleFont , , lineHeight%, , , , , , , 
  59.     EndDefineStyle 1
  60.  
  61.     REM Go to the next paragraph.
  62.     ParaDown 1,0
  63.     IF GetNextChar$(1) <> "<Cr>" THEN CharRight 1,0,
  64. NEXT i%
  65.  
  66. REM Restore the selection
  67. EditGotoOffset strt%, 0
  68. if yes%=1 then EditGotoOffset end%, 1
  69.  
  70. REM Restore the screen
  71. freeze% = ViewFreezeScreen(freeze%)
  72.  
  73. 
  74. *****  WARNING *****
  75. This is a WSWin macro file.
  76. Subsequent data is binary information and should not be modified.
  77. # MF # 1.0None762570794╠ⁿΣâ"
  78. 8àêë
  79. âêçèâ
  80. 8ìî
  81. ïìÄÅ
  82. 8    
  83. 8    æÉÆ
  84. 8 âÉöâ
  85. 8ûò
  86. ïûùÿ
  87. 8
  88. 8¢Ç
  89. ܢ֣
  90. 8
  91. âÖ₧ƒâ
  92. 8á₧
  93. ÜáÖí
  94. 8
  95. 8
  96. 8óÇ
  97. 8 ñѪúº
  98. 8
  99. âÑ⌐â
  100. 8 Ѭ
  101. 8 #¡Ç
  102. ¼¡½«
  103. 8#&
  104. »Ñ▒
  105. 8&( ñ┤╡Ö╢
  106. 8()╕Ç
  107. ╖╕╣
  108. 8)* ñ║╗Ö╝
  109. 8*+╜╜Ç
  110. 8+,
  111. ╛╗╡┐ª╛â╗┐▓â
  112. 8,/└
  113. »Ñ└┴
  114. 8/1├╜┬Ç─┬┬Çâ┬├╟â
  115. 813╚╔╩╦╠═╬╧╨╤╥╙
  116. 837╓╩╘╫╓╦╫╒
  117. 87:
  118. ╪ó┘
  119. 8:;┌╦█
  120. 8;<▌Ç▄▌▐
  121. 8<?▀Çα
  122. ╖▀αß
  123. 8??$σÇ
  124. Γσµτ âµΣΦâ
  125. 8?$@ΩÇδ ΘΩδ∞
  126. 8@A╞
  127. 8ADφ
  128. »Ñφε
  129. 8DD
  130. âúÇ≡â
  131. 8DE±Ç
  132. »ª±≥
  133. 8EH
  134. ¼½½≤÷~ƒö⌡⌡⌡⌡⌡⌡⌡⌡⌡⌡⌡⌡⌡⌡⌡⌡⌡⌡⌡⌡.'u.'u.'u .'u-.'u5.'u;.'uA.'uN.'u^.'u    l.'u
  135. z.'u ê.'u û.'uñ.'u▓.'u╢.'u╣.'u╜.'u└.'u┬.'u─.'u╞.'u╔.'u╠.'u╧.'u╥.'u╘.'u╓.'u┌.'u▄.'u▐.'uα.'u Γ.'u!Σ.'u"Θ.'u#∞.'u$≡.'u%⌡.'u&ⁿ.'u'/'u(
  136. /'u)/'u*/'u+/'u,"/'u-(/'u.-/'u/3/'u06/'u1;/'u2@/'u3B/'u4E/'u5J/'u6N/'u7T/'u8Y/'u9`/'u:g/'u;l/'u<o/'u=w/'u>y/'u?{/'u@/'uAê/'uBî/'uCÅ/'uDù/'uE₧/'uFú/'uG¡/'uH┤/'uI╣/'uJ╜/'uK┬/'uL╟/'uM═/'uN╤/'uO╒/'uP▄/'uQπ/'uRΩ/'uS≡/'uT≈/'uU0'uV0'uW0'uX$0'uY10'uZ:0'u[G0'u\P0'u]X0'u^`0'u_h0'u`q0'uav0'ub{0'ucÇ0'udç0'ueÄ0'ufö0'ug¢0'uh¥0'uió0'uj¿0'uk«0'ul╡0'um╛0'un╟0'uo╦0'up╙0'uq╫0'ur▄0'usΓ0'utΦ0'uuε0'uv⌠0'uw∙0'ux■0'uy1'uz1'u{1'u|1'u}╧t  ╧t+╧t+    ╧t╧t╧t  ╧t ╧t
  137. ë,╧t  H1╧t+      4╧t      9╧t     >╧t  HC╧tçK╧t+      Ä╧t      ô╧t  ÿ╧t     ¥╧t          ¿╧tç╡╧t     ║╧t  ÿ┐╧t  ÿ─╧t+      ε╧t      ≤╧t  °╧t     ■╧t          ╧tç╧t  ╧t     ╧t  ⁿ!╧t+  #╧t  ⁿ(╧t  .╧t     4╧t          ;╧t          @╧tçN╧t          T╧t          Y╧t     _╧t  Jd╧t  Ji╧t+  k╧t          s╧tçHä╧t  è╧t     É╧tAEƒ╧t  Ñ╧t     ½╧t  x░╧t  °╢╧t          ┴╧t          ╩╧t     ╨╧tA9┘╧t  ▀╧t     σ╧t          φ╧t          ≤╧t     ∙╧t          ╧t  ╧t  ╧t  ╧t      ╧t          #╧t  (╧t  4.╧t  B4╧t  ,:╧t  N@╧tAM╧t
  138.           W╧t          ]╧t          i╧t          o╧t          w╧t          é╧t          ì╧t          ò╧t          Ñ╧t
  139.           ┤╧t      ║╧t+  x╛╧t+  d┬╧t  ╚╧t  ╬╧tA)┌╧t     α╧tA,≡╧t     ÷╧tA7╧t   ╧t     ╧t  ╧t  ╧t     #╧t
  140. ë<0╧t  @6╧t+      =╧t  C╧t      I╧t     O╧t  @U╧tA>_╧t  e╧t  k╧t     q╧t  w╧t     }╧t  Üâ╧t  Üë╧t  Å╧t     ò╧t     ¢╧t¥╧t????01CANCELERRORNUM[T1]
  141. GETDOCNAME$[L1]""[T2][T3][L2]MESSAGE"Please create a new document or open an existing document first."[T4][T5][T6]FRAMETYPE%GETFRAMETYPE[T7][L3][L4]"The current frame must be a text frame."[T8][T9][T10]RET%VIEWEDITMODE[T11][T12][L5]2[L6][T13][T14]LOCAL%YES%GETTEXTOFFSETSTRT%END%[T15][L7][L8]4FREEZE%VIEWFREEZESCREEN[T16][T17]EDITGOTOOFFSET[T18][T19][L9][L10]SAVESTART%SAVEEND%[T20]PARADOWN[T21][T22]START2%END2%[T23]NUMPARAGRAPHS%[T24][T25][T26][T27]I%[F1][L11][L12][L13][L14]GETSTYLEFONTTYPEFACE$SIZE%LINEHEIGHT%BOLD%ITALIC%UNDERLINE%STRIKEOUT%HIDDEN%PLACEUNDERLINE%STRIKEOUTCHAR$[T28]120100[T29][T30]DEFINESTYLE[T31]DEFINESTYLEFONT[T32]ENDDEFINESTYLE[T33][T34][T35][T36][T37]GETNEXTCHAR$[L15]"<Cr>"[T38][T39][T40][L16]CHARRIGHT[T41][T42][T43][T44][T45][L17][L18][T46][T47][T48]
  142. 
  143. 
  144.