04-09-2018 07:21 AM
Thank you! Could somebody please review the another VI ? 🙂
04-09-2018 08:23 AM
Step 2 can be replaced with a simple Search And Replace String. There is an input on the top to "Replace All". Set that to TRUE. And make sure the Replace String is an empty string.
I think we have already beat that Space Generator do death already, so you might want to go ahead and replace that.
04-09-2018 12:30 PM
@AldhairGarza wrote:
Thank you! Could somebody please review the another VI ? 🙂
(Tim already mentioned a few things)
04-10-2018 04:48 AM
Wow how silly I am. I really appreciate your help thank you very much.
The mentioned Step does not eliminate whitespace, it just checks where was the last one so when the "Replace Substring" extracts a line of text, it doesn't cut a word in half.
I did all the rest you said, but are you sure that it is better to replace the Case Structure for a Select ?
Because with the Case Structure it was a bit cleaner, but I'm just nobody, I don't really know.
This was the final result. If you have any further observations, i'd be glad to read them.
04-10-2018 10:31 AM - edited 04-10-2018 10:42 AM
@AldhairGarza wrote:The mentioned Step does not eliminate whitespace, it just checks where was the last one so when the "Replace Substring" extracts a line of text, it doesn't cut a word in half.
Well, I did not really study the code, just looked at the diagram label. Maybe you should rewrite the label and explain better what the loop actually does. 😄
@AldhairGarza wrote:
I did all the rest you said, but are you sure that it is better to replace the Case Structure for a Select ?
Because with the Case Structure it was a bit cleaner, but I'm just nobody, I don't really know.
"Cleaner" is subjective. With the case structure you had to duplicate the "concatenate strings" and operate on several input tunnels. We also cannot immediately tell what's in the other case by looking at the image. The "select" switches exactly one input to the next operation. Also, since it is just a concatenation, I probably would not use a formatting statement.
@AldhairGarza wrote:
This was the final result. If you have any further observations, i'd be glad to read them.
Nothing is ever "final". 😄 I might have a look later.
04-10-2018 10:38 AM
haha yeah that's what I thought, it's a simple VI that you guys can understand without problem.
Thanks for the explanation about the Case Structure and the Select. I get it.
Nothing is ever "final". 😄 I might have a look later.
I'll be waiting!
04-10-2018 10:45 AM
Not sure if I have time today, but I have the feeling that the two FOR loops could be combined into one.
04-10-2018 11:26 AM
Yes it's possible! I was thinking about that while I was creating the VI for the first time but didn't retake the Idea later.
04-10-2018 12:39 PM
Move your space generation to be outside of the loop. That is something that should only need calculated once, so no need to do it every iteration of the loop.
04-10-2018 12:42 PM
When you have a string constant like \n where I would assume that is a new line character and not a backslash "n", then show the display format on the string constant so it is obvious it is in \code mode.