USES Exec, IFFParse, Amiga;

VAR
	buf : String[5];
	err : StrPtr;
	id  : LONG;
	idstr : String;
	
Function MakeID(str : String) : LONG;

begin
	MakeID := (LONG(Ord(Str[1])) shl 24) | (LONG(Ord(Str[2])) shl 16 ) | (LONG(Ord(Str[3])) shl 8 ) | (LONG(Ord(Str[4])));
end;

begin
	IFFParseBase := OpenLibrary('iffparse.library',0);
	Write('Input ID : ');
	Readln(idstr);
	id := MakeID(idstr);
	Writeln('ID : ',id);
	if GoodID(id) <> 0 then Writeln('Good ID');
	if GoodType(id) <> 0 then Writeln('Good type');
	err := IDtoStr(id ,@buf[1]);
	Writeln('IDStr = ',PtrToPas(@buf[1]));
	CloseLibrary(IFFParseBase);
end.
