BuildDateBuildDateBuildDateBuildDeferredMessageNLSFunction used to build a NLS message (a message in a given language) by finding it in a CATXXX.CATNls file depending on the NLS client on a target machine. Its role is to store the information to build a message (could be error, warning or info) from catalog, key and inputs arguments. See also BuildDeferredMessageNLS on the server side. SignatureBuildDeferredMessageNLS(MessageCatalog : String, MessageKey : String [, argument : Literal, ..]) : NLSMessage Arguments
The output is a structure composed of Catalog, Key and List of arguments, that will be affected to Parameters. Note:
The BuildMessageNLS on the client is replaced by a BuildDeferredMessageNLS on the server. .CATNls files are to be used on the client. The format must be as follows:
// Name of the catalog: Catalog1.CATNls Message1.Request = ""; Message1.Diagnostic = "No description for (/p1)"; Message1.Advice = "You should add a description for (/p1)";.properties files are to be used on the server. The format must be as follows: # Name of the catalog: Catalog1.properties Message1 = "No description for ({0})"; ReturnTypeNLSMessage ExampleParameters.NLSMessage = BuildDeferredMessageNLS("Catalog1", "Message1", "MyObject") BuildMessageNLSEnables you to send messages or ask questions through the Message and Question functions in the language of your choice. The BuildMessageNLS function can build a NLS message (a message in a given language) by finding it in a CATXXX.CATNls file. SignatureBuildMessageNLS(MessageCatalog : String, MessageKey : String [, argument : Literal, ..]) : String Arguments
ReturnTypeString ExampleThe KwrCATCatalog.CATNls file contains the following text: Zero = "Zero"; One = "One /P1"; Two = "Two /P1 /P2"; Zero, One and Two are the messages. The first message has no arguments, the second has 1 argument, the third, 2 arguments. To display those messages in a Engineering Rules Capture rule for example, enter the following rule body:
ConvertColorHEXtoRGBConvertColorRGBtoHEXCountOccurrencesDateFormatEnables you to retrieve a date as a string. SignatureDateFormat(format : String [, date : Date]) : String %a Abbreviated weekday name %A Full weekday name %b Abbreviated month name %B Full month name %c Date and time representation appropriate for locale %d Day of month as decimal number (01 -31) %H Hour in 24-hour format (00 - 23) %I Hour in 12-hour format (01 - 12) %j Day of year as decimal number (001 - 366) %m Month as decimal number (01 - 12) %M Minute as decimal number (00 - 59) %p Current locale's A.M/P.M indicator for 12-hour clock %S Second as decimal number (00-59) %U Week or year as decimal number, with Sunday as first day of the week (00-53) %w weekday as decimal number (0-6; Sunday is 0) %W Week of year as decimal number, without Monday as first day of the week (00-53) %x Date representation for current locale %X Time representation for cullrent locale %y Year without century, as decimal number (00-99) %Y Year with century, as decimal number %z, %Z Either the time zone name or the time zone abbreviation, depending on the registry settings; no characters if the time zone is unknown. %% Percent sign ReturnTypeString DimToStringFormatNumberFormats a digit according to a format defined by the user (for example decimal or scientific). Arguments
ReturnTypeString ExampleLet R (Real) Let S (String) R = 9.589 S = FormatNumber(R, “scientific”, 2) // now S contains “9.59e+000” S = FormatNumber(R, “scientific”) // now S contains “1e+001” S = FormatNumber(R, “decimal”, 5) // now S contains “9.58900” S = FormatNumber(R, “integer”) // now S contains “10” GetEnvVariableValueGetPLMOwnerEnables you to retrieve the PLM Owner of any kind of object.
Note:
Note that no particular license is required in case you run
this
function.
SignatureGetPLMOwner(Object : ObjectType) : UndefinedType Arguments
ReturnTypeUndefinedType Examplelet x(VPMRepReference) x = GetPLMOwner (Point) /* Point is the point in the model */ x.V_Description = "Hello" RepeatRepeats a string as many times as defined by the user. Arguments
ReturnTypeString ExampleLet Si, So (String) Si = “hello” So = Repeat(Si, 3) // now So contains “hellohellohello” ReplaceAllLets you replace occurrences of a string by another one in a given string. ReturnTypeString Example
ReplaceSubTextEnables you to replace the first occurrence of string with another string and returns the result. Arguments
ReturnTypeString SplitStringArguments
ReturnTypeList Examplelet strToSplit(String) let str2(String) let strF(String) strToSplit = “abc1de23fgh4ij” str2 = “1234” let listResSplitFalse(List) let listResSplitTrue(List) set listResSplitFalse = SplitString(strToSplit, str2) // argument 3: false is default value set listResSplitTrue = SplitString(strToSplit, str2, true) for strF inside listResSplitFalse { Message(strF) } // previous loop displays successively the values: “abc”, “de”, fgh”, “ij” for strF inside listResSplitTrue { Message(strF) } // previous loop displays successively the values: “abc”, “de”, “”, fgh”, “ij” ToLowerToStringToUpperString.Search()Searches for the first occurrence of a sub string in a String type parameter. It returns the index (o or 1) of the start of the substring. It returns -1 if the substring specified is not found. Arguments
ReturnTypeInteger ExampleString.Extract()Returns the sub string starting at a given position with a specified length. ReturnTypeString Examplelet Responsible = "Cilas Evans Evans"
Message ("#",Responsible.Extract(2,2))
String.Length()String.ToReal()RepeatFormatNumber |