Very strange. I am getting the same in 3.4.26 and don't have an explanation for this, other then this is caused by some automatic data type conversion along the way. I can offer a generic workaround based on prefixing numeric vaues witha non-numeric symbol, for example Dim temp, string, "1, 3" Concat("x", temp, temp) ReplaceAll(temp, " ", "", temp) Mid(temp, 2, 1000000, temp) MessageBox(temp) : This is very similar to "Return values from script libraries" by : Jamie. : We are using version 3.4.24. : We have a script library named replaceall that will replace a repeated : character in a string with another character. We have one script that passes : this library values that look like this: "1, 3" or "1, 2, : 3" or "1, 3, 5". : When I pass in "1, 3" to this library and tell it to replace all : spaces : with nothing,... : ----------------------------------------- : Here is a small calling script for an example: dim temp, string : replaceall("1, 3", " ", "", temp) : messagebox temp : Here is the library's code: // data, find_str, replace_str are all defined as : strings. : Dim find_pos, number : Dim find_len, number : Dim replace_len, number : Length find_str, find_len : Length replace_str, replace_len : Pos data, find_str, 1, find_pos : LoopWhile find_pos, END_LOOP : Replace data, find_pos, find_len, replace_str, data : Add find_pos, replace_len, find_pos : Pos data, find_str, find_pos, find_pos : END_LOOP: Return data <-- At this point the value changes from : "1,3"(which is correct) to "01:03:00" : -------------------------------------- : I get back "01:03:00" in temp. I've tried using your String : function : before the return, but that caused it to do the same thing even before it got : to the return statement. Do you know why this is happening and do : you have any suggestions for correcting it. (Putting a letter in the string : does correct it, but we would like to avoid that if possible.)
|