38 lines
948 B
Plaintext
38 lines
948 B
Plaintext
//
|
|
// Go through the list, and for each element, check the rest of the list to see if it appears again, and discard it if it does.
|
|
//
|
|
INTEGER PROC FNBlockGetUniqueAllToBufferB( INTEGER bufferI )
|
|
INTEGER B = FALSE
|
|
INTEGER downB = TRUE
|
|
STRING s[255] = ""
|
|
IF ( NOT ( IsBlockInCurrFile() ) ) Warn( "Please mark a block" ) B = FALSE RETURN( B ) ENDIF // return from the current procedure if no block is marked
|
|
PushPosition()
|
|
PushBlock()
|
|
GotoBlockBegin()
|
|
WHILE ( ( IsCursorInBlock() ) AND ( downB ) )
|
|
s = GetText( 1, MAXSTRINGLEN )
|
|
PushPosition()
|
|
PushBlock()
|
|
GotoBufferId( bufferI )
|
|
IF NOT LFind( s, "" )
|
|
AddLine( s )
|
|
ENDIF
|
|
PopBlock()
|
|
PopPosition()
|
|
downB = Down()
|
|
ENDWHILE
|
|
PopPosition()
|
|
PopBlock()
|
|
B = TRUE
|
|
RETURN( B )
|
|
END
|
|
//
|
|
PROC Main()
|
|
INTEGER bufferI = 0
|
|
PushPosition()
|
|
bufferI = CreateTempBuffer()
|
|
PopPosition()
|
|
Message( FNBlockGetUniqueAllToBufferB( bufferI ) ) // gives e.g. TRUE
|
|
GotoBufferId( bufferI )
|
|
END
|