Browse Source

* added function make_id

nils 22 years ago
parent
commit
52e083a25d
1 changed files with 16 additions and 1 deletions
  1. 16 1
      packages/extra/amunits/units/iffparse.pas

+ 16 - 1
packages/extra/amunits/units/iffparse.pas

@@ -21,6 +21,9 @@
     the library.
     14 Jan 2003.
     
+    Added function Make_ID.
+    14 Jan 2003.
+    
     [email protected] Nils Sjoholm
 }
 
@@ -270,6 +273,8 @@ FUNCTION StoreLocalItem(iff : pIFFHandle; localItem : pLocalContextItem; positio
 FUNCTION WriteChunkBytes(iff : pIFFHandle; buf : POINTER; numBytes : LONGINT) : LONGINT;
 FUNCTION WriteChunkRecords(iff : pIFFHandle; buf : POINTER; bytesPerRecord : LONGINT; numRecords : LONGINT) : LONGINT;
 
+Function Make_ID(str : String) : LONGINT;
+
 IMPLEMENTATION
 
 uses msgbox;
@@ -801,6 +806,13 @@ BEGIN
   END;
 END;
 
+Function Make_ID(str : String) : LONGINT;
+begin
+	Make_ID := (LONGINT(Ord(Str[1])) shl 24) or
+	          (LONGINT(Ord(Str[2])) shl 16 ) or
+		  (LONGINT(Ord(Str[3])) shl 8 ) or (LONGINT(Ord(Str[4])));
+end;
+
 {$I useautoopenlib.inc}
 {$ifdef use_auto_openlib}
   {$Info Compiling autoopening of iffparse.library}
@@ -848,7 +860,10 @@ END. (* UNIT IFFPARSE *)
 
 {
   $Log$
-  Revision 1.3  2003-01-14 18:46:04  nils
+  Revision 1.4  2003-01-19 14:57:50  nils
+  * added function make_id
+
+  Revision 1.3  2003/01/14 18:46:04  nils
   * added defines use_amia_smartlink and use_auto_openlib
 
   * implemented autoopening of library