08-24-2020 01:57 AM - edited 08-24-2020 01:58 AM
Hello folks
I am currently stuck with a task, where I must convert a HEX output to a decimal value.
In example I receive this string from my function, which I save as a local variable:
locals.SoftwareVersion = step.result.string
I now need to convert this hex value to the decimal value 0.05.26 with DOTS, and print it to the report. What is the procedure?
Thank you in advance!
Solved! Go to Solution.
08-24-2020 05:02 AM
I don't think you can do this change in a single step because most of the TestStand functions don't work with arrays. What you can do is:
1-Use the function Split() to separate the three numbers in an array of strings
2-Use a For Each structure to go through each string, change it to decimal and concatenate the result with dots between them
3-Remove the last unneeded dot.
08-24-2020 06:13 AM
Hello
I do not seem to be able to get this working.
What I did;
Please elaborate further, thank you!
08-24-2020 07:15 AM
Here you have an example.
08-24-2020 09:06 AM
Hello once again
Thank you very much for that good example! Helped me out a lot! Huge kudos to you!
However, when running it with my function, it would yield; "00.05.26" and only run with #noValidation
I therefore also removed the first character as so;
#NoValidation,
Locals.FW_PSKey=Left(Locals.FW_PSKey,Len(Locals.FW_PSKey)-1),
Locals.FW_PSKey=Right(Locals.FW_PSKey,Len(Locals.FW_PSKey)-1),
For this it yields "0.05.26" as I want.
Thank you very much, have a splendid day kind sir!!