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

  1. REM Description:  Indent first line by 1/2 inch.
  2. REM Filename: indfirst.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. GetFrameSize x%, y%, width%, height%
  49. GetFrameMargins left%, right%, top%, bottom%
  50.  
  51. lineLength% = width% - (left% + right%)
  52. REM Change the value from .50 to a different value if you want to use a different indent value.
  53. adjust% = TO_DP("0.50", 0)
  54. lineLength% = lineLength% - adjust%
  55.  
  56. FOR i% = 1 TO numParagraphs%
  57.     REM Get the style information
  58.     GetStyleParagraph first%, left%, right%, above%, below%, align%, location%, span%, hyphen%, numHyph%, keep%, allowBreak%, widow%
  59.     
  60.     first% = first% + adjust%
  61.     if first% > (lineLength% - right%) then first% = lineLength% - right%
  62.     
  63.     REM Redefine the style with the new first indent.
  64.     DefineStyle , local%
  65.     DefineStyleParagraph first%, , , , , , , , , , , , 
  66.     EndDefineStyle 1
  67.  
  68.     REM Go to the next paragraph.
  69.     ParaDown 1,0
  70.     IF GetNextChar$() <> "<Cr>" THEN CharRight 1,0,
  71. NEXT i%
  72.  
  73. REM Restore the selection
  74. EditGotoOffset strt%, 0
  75. if yes%=1 then EditGotoOffset end%, 1
  76.  
  77. REM Restore the screen
  78. freeze% = ViewFreezeScreen(freeze%)
  79.  
  80. 
  81. *****  WARNING *****
  82. This is a WSWin macro file.
  83. Subsequent data is binary information and should not be modified.
  84. # MF # 1.0None762570430Ç░Σ!&
  85. 8àêë
  86. âêçèâ
  87. 8ìî
  88. ïìÄÅ
  89. 8    
  90. 8    æÉÆ
  91. 8 âÉöâ
  92. 8ûò
  93. ïûùÿ
  94. 8
  95. 8¢Ç
  96. ܢ֣
  97. 8
  98. âÖ₧ƒâ
  99. 8á₧
  100. ÜáÖí
  101. 8
  102. 8
  103. 8óÇ
  104. 8 ñѪúº
  105. 8
  106. âÑ⌐â
  107. 8 Ѭ
  108. 8 #¡Ç
  109. ¼¡½«
  110. 8#&
  111. »Ñ▒
  112. 8&( ñ┤╡Ö╢
  113. 8()╕Ç
  114. ╖╕╣
  115. 8)* ñ║╗Ö╝
  116. 8*+╜╜Ç
  117. 8+,
  118. ╛╗╡┐ª╛â╗┐▓â
  119. 8,/└
  120. »Ñ└┴
  121. 8/1┬├─┼╞╟
  122. 812╚╔╩╦╠═
  123. 824╧╔╩╨╧╬┼╨
  124. 846╘╙╒ ╥╘╒╤╓
  125. 867╬╬╤
  126. 879╪╜╫Ç┘╫╫Çâ╫╪▄â
  127. 89; ▌▐╔╩▀αßΓπΣσµτΦΘ
  128. 8;=▐▐╤
  129. 8==*δ╬╩∞δâ▐∞φâ
  130. 8=*>▐╬╩
  131. 8>A
  132. εó∩
  133. 8AB ≡▐±
  134. 8BC≤Ç≥≤⌠
  135. 8CF⌡Ç÷
  136. ╖⌡÷≈
  137. 8FF#
  138. °√ⁿ â√·²â
  139. 8F#G Ç ■ 
  140. 8GH█
  141. 8HK
  142. Ȅ
  143. 8KK
  144. âúÇâ
  145. 8KLÇ
  146. Ȼ
  147. 8LO
  148. ¼½½ ~-║
  149. 
  150. 
  151. 
  152. 
  153. 
  154. 
  155. 
  156. 
  157. 
  158. 
  159. 
  160. 
  161. 
  162. 
  163. 
  164. 
  165. 
  166. 
  167. 
  168. .gW.gW.gW .gW-.gW5.gW;.gWA.gWN.gW^.gW    l.gW
  169. z.gW ê.gW û.gWñ.gW▓.gW╢.gW╣.gW╜.gW└.gW┬.gW─.gW╞.gW╔.gW╠.gW╧.gW╥.gW╘.gW╓.gW┌.gW▄.gW▐.gWα.gW Γ.gW!Σ.gW"Θ.gW#∞.gW$≡.gW%⌡.gW&ⁿ.gW'/gW(
  170. /gW)/gW*/gW+/gW,"/gW-(/gW.-/gW/3/gW06/gW1;/gW2@/gW3B/gW4E/gW5J/gW6N/gW7T/gW8Y/gW9`/gW:g/gW;l/gW<o/gW=w/gW>y/gW?{/gW@/gWAê/gWBî/gWCÅ/gWDù/gWE₧/gWFú/gWG¡/gWH┤/gWI╣/gWJ╜/gWK┬/gWL╟/gWM═/gWN╤/gWO╒/gWP▄/gWQπ/gWRΩ/gWS≡/gWT≈/gWU0gWV0gWW0gWX$0gWY10gWZ:0gW[G0gW\P0gW]X0gW^`0gW_h0gW`q0gWav0gWb{0gWcÇ0gWdç0gWeÄ0gWfö0gWg¢0gWh¥0gWió0gWj¿0gWk«0gWl╡0gWm╛0gWn╟0gWo╦0gWp╙0gWq╫0gWr▄0gWsΓ0gWtΦ0gWuε0gWv⌠0gWw∙0gWx■0gWy1gWz1gW{1gW|1gW}'W  'W+'W+    'W'W'W  'W 'W
  171. ë,'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ç[ä'W  è'W     É'WAXƒ'W  Ñ'W     ½'W  x░'W  °╢'W          ┴'W          ╩'W     ╨'WAL┘'W  ▀'W     σ'W          φ'W          ≤'W     ∙'W          'W  'W  'W  'W      'WA-'W          0'W          3'W          :'W          B'W     H'WA#X'W          ^'W          e'W          j'W          r'W     x'W          ä'W  è'W  É'W          ÿ'Wç(₧'W+      Ñ'W      ½'W  ▒'W     ╖'W          ║'W  ┐'W  ╕┼'W  ╞╦'W  ░╤'W  ╫'WA+Θ'W          ≡'W          ≈'W          ■'W          'W          'W          'W          'W          &'W          ,'W          8'W          ?'W      E'W  :K'W  Q'W  W'W  :]'WA9i'W     o'WA<ä'W     è'WAJÖ'W  ƒ'W     Ñ'W  ½'W  ▒'W     ╖'W
  172. ëO─'W  ⌠╩'W+      ╤'W      ╫'W     ▌'W  ⌠π'WAQφ'W  ≤'W  ∙'W      'W  'W      'W  N'W  N'W  'W     #'W     )'W+'W????01CANCELERRORNUM[T1]
  173. 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]GETFRAMESIZEX%Y%WIDTH%HEIGHT%[T28]GETFRAMEMARGINSLEFT%RIGHT%TOP%BOTTOM%[T29]LINELENGTH%[T30][T31]ADJUST%TO_DP"0.50"[T32][T33][T34]I%[F1][L11][L12][L13][L14]GETSTYLEPARAGRAPHFIRST%ABOVE%BELOW%ALIGN%LOCATION%SPAN%HYPHEN%NUMHYPH%KEEP%ALLOWBREAK%WIDOW%[T35][L15][T36][T37][L16]DEFINESTYLE[T38]DEFINESTYLEPARAGRAPH[T39]ENDDEFINESTYLE[T40][T41][T42][T43][T44]GETNEXTCHAR$[L17]"<Cr>"[T45][T46][L18]CHARRIGHT[T47][T48][T49][T50][T51][L19][L20][T52][T53][T54]
  174.