Val Function Returns 0 When the Input String Contains Empty Spaces in TestStandPrimary Software: TestStandPrimary Software Version: 4.0 Primary Software Fixed Version: N/A Secondary Software: N/A
Problem: I am using the Val function in a TestStand expression to convert a string to a number. This function normally ignores empty spaces in the string, but sometimes it returns 0. Why is this happening and how can I fix it?Solution: The Val function ignores empty spaces in the input string; however, since TestStand cannot handle extended ASCII characters, those characters will appear as empty spaces as well. The attached sample sequence demonstrates this situation. To correct it, make sure that the input string does not contain invalid characters by using the second parameter. The second parameter indicates if the input string represents a valid number. Related Links: KnowledgeBase 2K48A0Y6: How Can I Get the Character Representation of an ASCII Number in TestStand? Attachments:
Report Date: 12/12/2007 Last Updated: 12/14/2007 Document ID: 4GBG9AM6 |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
