PathToStr(sPath) "^" What is the Caret doing?

I have inherited some Citect code and there is a problem with it...

There is some reports on a report server that is triggered by cicode and there is "a problem" that is causing some kind of crash in the report server that is very elusive to discover. I'm turning over the smallest pebbles now, I'm not the first engineer to be asked to fix this one...

I am not so familiar with Citect and I am trying to understand the syntax, as in some locations a caret is used in strings and not in others...

PathToStr("^"\\PCName\Data\_Mill\DailyReport Yesterday.txt^"");

is used in the code and

PathToStr("[data]:test.txt");

is used in the help file...

What are the carets doing???

Parents
  • Hi ,

    This is an extact from the help:

    Using the Caret Escape Sequence Character
    The caret character ( ^ ) signifies a special instruction in Cicode, called an escape sequence, primarily used in the formatting of text strings. Escape sequences include formatting instructions such as new line, form feed, carriage return, backspace, horizontal and vertical tab-spaces, single and double quote characters, the caret character, and hexadecimal numbers.

    Strings are commonly represented in Cicode between double quote characters ( " ) known as delimiters. If you want the string to contain a double quote character itself as part of the string, you need to precede the double quote character with the caret character ( ^" ) so that Cicode doesn't interpret the double quote in the string as the delimiter indicating the end of the string. The caret character is interpreted as a special instruction, and together with the characters immediately following it, are treated as an escape sequence instruction. See the section titled Formatting Text Strings for the list of escape sequences used in Cicode.

    In the following Cicode example, both of these message functions will display the following message.

    Message("Info", "P29 has a ^"thermal overload^".", 0);
    sCurrentAlmText = "Thermal Overload";
    Message("Info", "P29 has a ^""+sCurrentAlmText+"^".", 0);
Reply
  • Hi ,

    This is an extact from the help:

    Using the Caret Escape Sequence Character
    The caret character ( ^ ) signifies a special instruction in Cicode, called an escape sequence, primarily used in the formatting of text strings. Escape sequences include formatting instructions such as new line, form feed, carriage return, backspace, horizontal and vertical tab-spaces, single and double quote characters, the caret character, and hexadecimal numbers.

    Strings are commonly represented in Cicode between double quote characters ( " ) known as delimiters. If you want the string to contain a double quote character itself as part of the string, you need to precede the double quote character with the caret character ( ^" ) so that Cicode doesn't interpret the double quote in the string as the delimiter indicating the end of the string. The caret character is interpreted as a special instruction, and together with the characters immediately following it, are treated as an escape sequence instruction. See the section titled Formatting Text Strings for the list of escape sequences used in Cicode.

    In the following Cicode example, both of these message functions will display the following message.

    Message("Info", "P29 has a ^"thermal overload^".", 0);
    sCurrentAlmText = "Thermal Overload";
    Message("Info", "P29 has a ^""+sCurrentAlmText+"^".", 0);
Children
No Data