I am pushing through Mastering Inventor 2013, chapter 20 - Creating iLogic Parameters, Rules, and Forms. I have a couple questions on code I've come across.
The instructions explain where to find particular snippets from the Function Catgory list. However, on page 874 it says to enter & vbCrLn & without saying where to find it. Is this not a predefined snippet?
The description also given on page 874 says that this entry creates a second line in the input line. Why would someone choose to use this entry when entering a space followed by an underscore does the same thing? Or is there a nuance here I am missing?
Doing a search online for what & vbCrLn & does I came across a website programming forum thread that suggested the use of & vbNewLine & instead because it is better descriptive for its function. Will & vbNewLine & perform the same function in iLogic as & vbCrLn &, or should I stick with & vbCrLn &?
Solved! Go to Solution.
Solved by cwhetten. Go to Solution.
That is not an iLogic snippet, but rather a constant defined in Visual Basic that creates a carriage return and line feed. Click here to see the MSDN article describing it.
The effect is not the same as using a space followed by an underscore. A space followed by an underscore allows you to continue writing code on the next line without VB realizing that that there is a line break. It is used like so:
The vbCrLf and vbNewLine constants create a line break in a string of text. See the examples below:
I can't speak to why you would use vbCrLf or vbNewLine. In fact, I have been successfully using vbLf. I don't really understand the difference between them.
Cameron Whetten
Inventor 2014