Back

Constant Value LineBreak

The constant, LineBreak, contains the two bytes used to mark new lines (Byte 13 and Byte 10)

Use LineBreak to find the end of lines in text.

For example. This script breaks the last text captured by Spartan into single line clips.

[[Script]]
SoundOff
ClearClips
LatestLast
Text1 = LastCopy
'-----------Remove trailing blank lines
Loop
   If Right$(Text1 , 2) = LineBreak
      Text1 = Left$(Text1 , Len$(Text1) - 2)
   Else
      ExitLoop
   EndIf
EndLoop
'---------------------------
Loop
   '-----remove leading blank lines
   Loop
      If Left$(Text1 , 2) = LineBreak
         Text1 = Right$(Text1 , Len$(Text1) - 2)
      Else
         ExitLoop
   EndIf
   EndLoop
   '--------------------
   Counter1 = In$(Text1 , LineBreak , 1)
   If Counter1 = 0
      ExitLoop
   EndIf
   Text2 = Left$(Text1 , Counter1 - 1)
   Text1 = Right$(Text1 , Len$(Text1) - Counter1 + 1)
   MakeClip Text2
EndLoop
MakeClip Text1 'Last line

 

Back