# LGF_CompareString (FC / 1.0.0)

Overview

Author: Siemens Industry Support

## Short description

Compares two strings and returns a number which indicates the result of the comparison.

### Block Interface

| LGF_CompareString (FC) |
--- | --- | ---
|  |  |  |  | Ret_Val |  |  | SInt
String |  |  | left |  |  | String
String |  |  | right |  |  | String

### Output parameter

Identifier | Data type | Description
--- | --- | ---
Ret_Val | SInt | Return values: left < right := -1; left > right := 1; left == right := 0;

### In/Out parameter

Identifier | Data type | Description
--- | --- | ---
left | String | Left / first string to compare
right | String | Right / second string to compare

### Status & Error codes

Code / Value | Identifier / Description
--- | ---
0 | RETURN_STRINGS_ARE_EQUAL Strings are equal
1 | RETURN_STRING_LEFT_GREATER_THAN_RIGHT Left string is greater than right string
-1 | RETURN_STRING_LEFT_LESS_THAN_RIGHT Left string is less than right string

## Change log

Version & Date | Change description
--- | ---
| 1.0.0 | Siemens Industry Support
| 10-06-2022 | First released version