Scalar types
Base scalar types
ConceptRT redefines many basic types to abstract types that may change of size depending on the target / compiler.
- Example basic types
- Example advanced types
doubleWord = 56;
Int32 value = doubleWord;
Nullable<Float64> userValue;
userValue = 8.567;
{
}
else
TimeSpan
todo example of code
TimeStamp
todo example of code
Real-time string
Realtime String Working with character strings is very common. String literal such as "This is a literal string"
or C-style strings terminated with a null character, literally a '\0'
character, are handled by the type PCChar8. See Literal and C-Like strings operations for more details. To be able to build dynamic message and use String in real-time context String classes brings the required deterministic functionalities.
Many functionalities work with both base types (BaseStaticString and PCChar8) such as Concatenation, Comparison, Conversion, Extraction, Alignment, Format & Trim and Encoding/Decoding.
- String & ToString
-
- String operations
String string =
" Hello world ";
Int32 length =
string.GetLength();
bool contains = string.Contains("Hello");
Int32 world =
string.Find(
"world");
Int32 compare =
string.Compare(
"Good bye world");
string.TrimLeft();
string.TrimRight();
- StaticString and concatenation
StaticString<40> smallString = "Hello ";
StaticString<400> hugeString = "World";
smallString += hugeString;
- Equal
bool compare = hugeString == "Hello World";
bool sameText =
SameText(hugeString,
"hello world");
- Size & Length
Int32 size = hugeString.GetSize();
bool sameLength = hugeString.GetLength() ==
Length(
"hello world");
- Parsing
String completeString =
"true";
Int32 number = numberString.ValInt();
Float64 mark = markString.ValFloat();
bool complete = completeString.ValBool();
- Extracting
String pointsValues =
"10.2, 2.1; 6.321, 546.2;1234.1234,0.9876;";
do
{
points[index][0] = partX.ValFloat();
points[index][1] = partY.ValFloat();
index++;
}
while (!pointsValues.IsEmpty() && index < 10);