/*
** $VER: CommentAminetFiles.ced 0.9 (18-02-2000) by peejay@poczta.fm
**
** Searches for a choosen archive, and comments it with the "short" note
**    from the Aminet index file.
**
** Requires: CygnusEd (tested on v4.20), FileNote (in "C:" directory), and
**    Aminet Index file (from one of the Aminet ftps...) loaded into Ced.
**    The "Current Directory" must be set to the dir with archives you want
**    to comment.
**
*/

LF = '0A'X

ADDRESS "CYGNUSED"

OPTIONS RESULTS

BEG OF FILE

GETFILENAME
	plik = RESULT

Szukaj:
	DO
		SEARCH FOR plik u f o 1
		tak = RESULT

		IF (tak = 1) THEN DO
			BEG OF LINE
			STATUS CURSORLINE
				linia = RESULT + 1
			JUMPTO linia 20
			MARK
			NEXT WORD
			NEXT WORD
			NEXT WORD
			COPY
			STATUS BLOCKBUFFER
				lokacja = RESULT
			JUMPTO linia 40
			MARK
			"END OF LINE"
			COPY
			STATUS BLOCKBUFFER
				komentarz = RESULT
		END
		IF (tak = 0) THEN DO
			tak = 2
			CALL Koniec
		END
	END

OKAY2 "Correct file?" LF "   Name:" plik LF "   Location:" lokacja LF "   Comment:" komentarz
	nie = RESULT

IF (nie = 1) THEN DO
	ADDRESS COMMAND "C:Filenote" '"'plik'"' '"'komentarz'"'
	BEG OF LINE
   OKAY1 "File successfully commented!"
END
IF (nie = 0) THEN CALL Szukaj

Koniec:
	IF (tak = 2) THEN DO
		OKAY1 "File:" LF plik LF "wasn't found..."
		EXIT 0
	END
