IsSameStruct
See Also: Struct, Structured Types
Purpose
Used to determine if two structs are the same in all but name.
Return Type
Syntax
(IsSameStruct({Struct1Id}, {Struct2Id}))
Parameters
- {Struct1Id}: The id of the first struct to compare.
- {Struct2Id}: The id of the second struct to compare.
What it Does
Returns True if the two structs are the same. They are considered the same if they are of the same type and contain the same content.
Examples
Example 1
This example shows that two structs of the same type are the same after just being instantiated. At this point, the two structs' types and content (they are both empty) are the same.
Struct tCustomer
Integer iId
String sName
End_Struct
Procedure Test
tCustomer Cust1 Cust2
If (IsSameStruct(Cust1, Cust2)) Begin
Send Info_Box "Both structs are the Same"
End
Else Begin
Send Info_Box "Both structs are NOT the Same"
End
End_Procedure
Example 2
This example shows that two structs of the same type are no longer the same after data was moved to one, but not the other.
Struct tCustomer
Integer iId
String sName
End_Struct
Procedure Test
tCustomer Cust1 Cust2
Move 1 to Cust1.iId
Move "Smith" to Cust1.sName
If (IsSameStruct(Cust1, Cust2)) Begin
Send Info_Box "Both structs are the Same"
End
Else Begin
Send Info_Box "Both structs are NOT the Same"
End
End_Procedure