formatting strings
Submitted by pdickens on Mon, 02/27/2012 - 04:06
Is there any way to format strings in VisSim? Specifically, I would like to take the output from the timeOfDay block (i.e. integers representing the year/month/day/hour...) and produce a formatted string from the integers to represent the time (e.g. 10:34:21 am). The timeStamp block can output a string, but I need to process and/or store the values before display, so timeStamp won't work.
Answers
-
Submitted by a_a on Mon, 02/27/2012 - 22:28.
Try to convert the values into strings and then use the summingJunction to make the representation you need. The attached diagram will give you the hint.
0 -
Submitted by pdickens on Mon, 03/12/2012 - 08:35.
Thanks a_a, I hadn't thought of using the summing block to concatenate strings - but it makes sense. Just had to add some logic to pad with zeros when the h, m or s variable is less than 10.
0