Mr. Arne Bergmann 27 Report post Posted December 4, 2012 The editor for the Create Function of a feature has some (so far) undocumented (which will change in 3.0) possibilities that can come in handy. So, here's a list of things that you may not be aware of:Copy/Cut whole linesIf you press the keyboard shortcut for copy or cut (i.e. Ctrl+c and Ctrl+x) without having any text selected, the whole line will be copied/cut. If you then paste it, it will be inserted as a whole lineSelect wordsSelect words works by double clicking on them. Nothing new? Do the same by single clicking an pressing CTRL.Find next occurenceWhen using the text search (Ctrl+f) you can press F3 to find the next occurence of the search stringHelpBy pressing F1 (or using the question mark button in the toolbar) the documentation browser will open the documentation (if available) of the type/command that is currently under the cursor.Debugging shortcutsThe debugger can also be controlled by keyboard shortcuts:F5 : start debuggingF9 : toggle breakpoint in the current lineF10 : execute next lineShift + F5 : stop debuggingMore shortcutsAdditional shortcuts:F7 : Evaluate the feature (same as the "Evaluate" button on the lower left)Ctrl+F7 : Apply the changes to the feature (same as the "Apply" button on the lower right)Collapse codeYou may have already noticed that parts of the code can be collapsed by pressing on the little arrow on the left of the code (in between the code and the line numbers). This applies to "block"-statements (e.g. if, while) and can help to get a clearer view of the code as parts that you are currently not interested in can be hidden. What you probably do not know is the ##region/##endregion functionality. This way you can define collapsable regions yourself, e.g.: ##region myRegion // this is some code point p() line c() ##endregionThe identifier behind the ##region directive allows you to give a name to the region, so you see what's inside when collapsing it.So the example can be collapsed to ##region myRegion { . . . }Of course, this only works if collapsing is enabled in the editor settings.Column selectWhen using the mouse to select text it is not only possible to select lines, but you can also create a selection that only spans part of a line but expands to other lines. To do so, hold Ctrl+Alt while selecting with the mouse. This can come in handy when you want to change the type or name of multiple objects, for example. These screenshots should illustrate it a little better:feature defining 4 points:Select using Ctrl+Alt:Type fvector3:That's about it for now, however here's a little teaser about the news in the next release:Auto close blocksThe editor automagically adds the corresponding keyword when starting a new block statement (e.g. if/while).New language featuresThe feature language has been expanded a little further. The biggest news are:foreach -> iterate over objectlists and entitygroups in a very convenient way. Forget about all those castTo commands and counter variables!You probably know code like this: unsigned i(0) while(i < myObjectList.getcount()) f3dpoint p (myObjectList.at(i).castTo(F3dpoint)) if (!(!p)) p.setx(5) endif i += 1 endwhileNow, you can just write this: foreach(f3dpoint p in myObjectList) p.setX(5) endforswitch -> getting lost in all those if/elseif cascades? The new switch statement should solve that. unsigned i(2) switch (i) case 1 echo("i is 1") case 2 echo("i is 2") case 3,4,5 echo("i is 3, 4 or 5") default echo("i is larger than 5) endswitchfunction -> writing the same code inside your feature over and over again? Put it in a function and just call it!Example: function calculatePlusTwo(double d) : fdouble return(d + 2) endfunction echo(""+calculatePlusTwo(1)) echo(""+calculatePlusTwo(2)) echo(""+calculatePlusTwo(3))You can even reimplement existing commands inside your feature: function echo(string text) ::echo("My Feature" + text) endfunction echo(" wants to say hello")will output: "My Feature wants to say hello" on the console Share this post Link to post Share on other sites
Mr. David Bendl 0 Report post Posted December 13, 2012 Great news!Can't wait to use the new functionality. David Share this post Link to post Share on other sites
Karsten Wenzke 12 Report post Posted November 6, 2013 I've got some more useful shortcuts for feature programming:You can use these shortcuts instead of using the buttons in the top bar. Comment:comment a row or multiple rows at once use CTRL+KSelect rows you want to commentPress CTRL+KUncomment:uncomment a row or multiple rows at once use CTRL+SHIFT+KSelect rows you want to uncommentPress CTRL+SHIFT+K Best RegardsKarsten Share this post Link to post Share on other sites
Karsten Wenzke 12 Report post Posted April 17, 2015 Hey folks, here is a video introduction to features or you can watch the video in our video section on our website. I can also recommend the feature documentation in CAESES. To access it click on the question mark button in the top right corner of the feature definition editor. (or go to create function and press F1 on you keyboard). Cheers, Karsten Share this post Link to post Share on other sites
Jörg 29 Report post Posted December 16, 2015 Check out this blog post which comes with a great summary (PDF) for the feature programming language (contains all the little details that are important)... Share this post Link to post Share on other sites
Ms. shiv kumar singh 0 Report post Posted June 18, 2019 Feature programming is like Python, JavaScript, Artificial intelligence, Ruby on Rail, etc, Python is one of the most preferred languages out there. Its brevity and high readability makes it so popular among all programmers. Share this post Link to post Share on other sites