Jump to content

SomCompareIds: Difference between revisions

From EDM2
Created page with "==Description== This function determines whether two SOM IDs represent the same string. ==Syntax== <PRE> somId id1; somId id2; int rc; rc = somCompareIds(id1, id..."
 
Ak120 (talk | contribs)
mNo edit summary
 
(4 intermediate revisions by 2 users not shown)
Line 1: Line 1:
==Description==
{{DISPLAYTITLE:somCompareIds}}
This function determines whether two SOM IDs represent the same string.  
This function determines whether two SOM IDs represent the same string.


==Syntax==
==Syntax==
<PRE>
somId    id1;
somId    id1;
somId    id2;
somId    id2;
int      rc;
int      rc;
 
rc = somCompareIds(id1, id2);
rc = somCompareIds(id1, id2);
</PRE>
==Parameters==
;  id1 (somId) : The first SOM ID to be compared.
 
; id2 (somId) : The second SOM ID to be compared.


==Return Code==
===Parameters===
; rc (int) :  
;id1 (somId) : The first SOM ID to be compared.
;id2 (somId) : The second SOM ID to be compared.


* 1  Returns 1 if the two input IDs represent strings that are equal.  
===Return Code===
;rc (int):
* 1  Returns 1 if the two input IDs represent strings that are equal.
* 0  Returns 0 if the two input IDs represent strings that are not equal.
* 0  Returns 0 if the two input IDs represent strings that are not equal.


==Remarks==
==Remarks==
This function returns 1 if the two input IDs represent strings that are equal; otherwise, it returns 0.  
This function returns 1 if the two input IDs represent strings that are equal; otherwise, it returns 0.


==Example Code==
==Example Code==
<PRE>
<PRE>
#include <som.h>
#include <som.h>
Line 44: Line 39:


==Related==
==Related==
===Data Structures===
;Data Structures
* [[somId (sombtype.h)  
*somId (sombtype.h)  
 
;Functions
===Functions===
* [[somCheckId]]
* [[somCheckId]]
* [[somRegisterId]]
* [[somRegisterId]]
Line 58: Line 52:
* [[somEndPersistentIds]]
* [[somEndPersistentIds]]


[[Category:The OS/2 API Project]]
[[Category:SOM Kernel]]
[[Category:SOM Kernel]]

Latest revision as of 18:24, 12 October 2022

This function determines whether two SOM IDs represent the same string.

Syntax

somId    id1;
somId    id2;
int      rc;

rc = somCompareIds(id1, id2);

Parameters

id1 (somId)
The first SOM ID to be compared.
id2 (somId)
The second SOM ID to be compared.

Return Code

rc (int)
  • 1 Returns 1 if the two input IDs represent strings that are equal.
  • 0 Returns 0 if the two input IDs represent strings that are not equal.

Remarks

This function returns 1 if the two input IDs represent strings that are equal; otherwise, it returns 0.

Example Code

#include <som.h>
main()
{
   somId id1, id2, id3;

   somEnvironmentNew();
   id1 = somIdFromString("this");
   id2 = somIdFromString("that");
   id3 = somIdFromString("this");

   SOM_Test(somCompareIds(id1, id3));
   SOM_Test(!somCompareIds(id1, id2));
}

Related

Data Structures
  • somId (sombtype.h)
Functions