Community
Inventor Forum
Welcome to Autodesk’s Inventor Forums. Share your knowledge, ask questions, and explore popular Inventor topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

iLogic code

1 REPLY 1
SOLVED
Reply
Message 1 of 2
cadlad
1782 Views, 1 Reply

iLogic code

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 &?

Dell Precision T3610 - Windows 7 SP1, 64x, 16GB RAM, NVIDIA Quadro K4000 (driver 9.18.13.5306), Inventor 2013 SP2 Update 6 - *Autodesk Inventor Professional Certified*, AutoCAD 2014 SP1, Vault Professional 2014 SP1, 3DConnexion SpaceNavigator
1 REPLY 1
Message 2 of 2
cwhetten
in reply to: cadlad

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:

 

iLogic Line Continue.png

 

The vbCrLf and vbNewLine constants create a line break in a string of text.  See the examples below:

 

iLogic String Line Returns.png

 

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

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report