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

  1. REM Description:  Change paragraph(s) to one-and-a-half line spacing
  2. REM Filename: hlfspace.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 180% of the font size.  Change the number from 240
  53.     REM to a different value to change the default line height.
  54.     lineHeight% = (size% * 180) / 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.0None762570418╠ⁿΣâ"
  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. ¼½½≤÷~ƒö⌡⌡⌡⌡⌡⌡⌡⌡⌡⌡⌡⌡⌡⌡⌡⌡⌡⌡⌡⌡.╫L.╫L.╫L .╫L-.╫L5.╫L;.╫LA.╫LN.╫L^.╫L    l.╫L
  135. z.╫L ê.╫L û.╫Lñ.╫L▓.╫L╢.╫L╣.╫L╜.╫L└.╫L┬.╫L─.╫L╞.╫L╔.╫L╠.╫L╧.╫L╥.╫L╘.╫L╓.╫L┌.╫L▄.╫L▐.╫Lα.╫L Γ.╫L!Σ.╫L"Θ.╫L#∞.╫L$≡.╫L%⌡.╫L&ⁿ.╫L'/╫L(
  136. /╫L)/╫L*/╫L+/╫L,"/╫L-(/╫L.-/╫L/3/╫L06/╫L1;/╫L2@/╫L3B/╫L4E/╫L5J/╫L6N/╫L7T/╫L8Y/╫L9`/╫L:g/╫L;l/╫L<o/╫L=w/╫L>y/╫L?{/╫L@/╫LAê/╫LBî/╫LCÅ/╫LDù/╫LE₧/╫LFú/╫LG¡/╫LH┤/╫LI╣/╫LJ╜/╫LK┬/╫LL╟/╫LM═/╫LN╤/╫LO╒/╫LP▄/╫LQπ/╫LRΩ/╫LS≡/╫LT≈/╫LU0╫LV0╫LW0╫LX$0╫LY10╫LZ:0╫L[G0╫L\P0╫L]X0╫L^`0╫L_h0╫L`q0╫Lav0╫Lb{0╫LcÇ0╫Ldç0╫LeÄ0╫Lfö0╫Lg¢0╫Lh¥0╫Lió0╫Lj¿0╫Lk«0╫Ll╡0╫Lm╛0╫Ln╟0╫Lo╦0╫Lp╙0╫Lq╫0╫Lr▄0╫LsΓ0╫LtΦ0╫Luε0╫Lv⌠0╫Lw∙0╫Lx■0╫Ly1╫Lz1╫L{1╫L|1╫L}_W  _W+_W+    _W_W_W  _W _W
  137. ë,_W  H1_W+      4_W      9_W     >_W  HC_WçK_W+      Ä_W      ô_W  ÿ_W     ¥_W          ¿_Wç╡_W     ║_W  ÿ┐_W  ÿ─_W+      ε_W      ≤_W  °_W     ■_W          _Wç_W  _W     _W  ⁿ!_W+  #_W  ⁿ(_W  ._W     4_W          ;_W          @_WçN_W          T_W          Y_W     __W  Jd_W  Ji_W+  k_W          s_WçHä_W  è_W     É_WAEƒ_W  Ñ_W     ½_W  x░_W  °╢_W          ┴_W          ╩_W     ╨_WA9┘_W  ▀_W     σ_W          φ_W          ≤_W     ∙_W          _W  _W  _W  _W      _W          #_W  (_W  4._W  B4_W  ,:_W  N@_WAM_W
  138.           W_W          ]_W          i_W          o_W          w_W          é_W          ì_W          ò_W          Ñ_W
  139.           ┤_W      ║_W+  ┤╛_W+  d┬_W  ╚_W  ╬_WA)┌_W     α_WA,≡_W     ÷_WA7_W   _W     _W  _W  _W     #_W
  140. ë<0_W  @6_W+      =_W  C_W      I_W     O_W  @U_WA>__W  e_W  k_W     q_W  w_W     }_W  Üâ_W  Üë_W  Å_W     ò_W     ¢_W¥_W????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]180100[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.