Dear All, How to automatically reformat our code in µVision2 ? so that the code will have proper tabs to view it nicely. I have µVision2 V2.20a, but I can not find it. I only find "Go to matching brace" which is very useful too of course. I see this reformat feature in a freeware c editor/compiler such this http://www.cs.virginia.edu/~lcc-win32/ thanks
uVision doesn't have this facility. "I see this reformat feature in a freeware c editor/compiler such this http://www.cs.virginia.edu/~lcc-win32/ " So use that then! Nothing forces you to use uVision or its editor if you prefer something else!
Nothing forces you to use uVision or its editor if you prefer something else! true - to an extent. If you insist on using the IDE (I can not use it for other reasons) you are locked to the Keil attempt at an editor. At a time I used another compiler (product contained a '51 and an XA - did not want to switch compiler back and forth). That compiler allowed inclusion of "your" editor in the IDE. I wonder why Keil never allowed that. (oh well, now it's ARM and who knows what will (not) happen) Erik
"How to automatically reformat our code in µVision2 ? so that the code will have proper tabs to view it nicely." uVision doesn't re-format existing code - you need a 3rd party tool to do that. However, it can auto-indent new code as you write - see the Manual for details. You have read the Getting Started Guide, haven't you...? PS: Avoid TABs - use only spaces. The interpretation of TABs is entirely application-dependant - if you format with TABs in uVision, you have no guarantee whatsoever that it will look right in any other application or printout. But you know where you are with spaces. Avoid TABs.
"If you insist on using the IDE ... you are locked to the Keil attempt at an editor." No, you're not. You can use an external editor - although it won't be "integrated" in the IDE. I frequently edit files in CodeWright, save the file, then hit the 'Compile' button in uVision. I even have an item set up in my uVision 'Tools' menu to "Open the current file in CodeWright" I do the same with Borland...
"If you insist on using the IDE ... you are locked to the Keil attempt at an editor." No, you're not. You can use an external editor - although it won't be "integrated" in the IDE. Ok Andy, I'll restate If you insist on the editor being part of the IDE ... I know very few (evidently you are one of them) that work both outside and inside the IDE. Erik
Avoid TABs - use only spaces. The interpretation of TABs is entirely application-dependant are you saying that the Keil editor does not have the "replace tabs with spaces" feature? Erik
"are you saying that the Keil editor does not have the 'replace tabs with spaces' feature?" I don't think it has a specific function to replace existing TABs with spaces, but it can (and, I say, should) be set to insert spaces when you press the TAB key. (I would use CodeWright to replace existing TABs, if required...)
Yes it has. There are plenty of new features in uVision3. Select the text, right mouse click on it -> Advanced -> Untabify selection. This should replace all tabs with spaces, however it will use the tab settings from Configuration -> Editor -> Tab size. Franc
"There are plenty of new features in uVision3" The OP was asking specifically about uVision-2. I think this feature is not present in UV2? The 8051 tools still ship with UV2, and I seem to remember that adding UV3 was not entirely straightforward... :-(
Wrong Andy; You can download uV3 from the Keil website. Install uV3 and you can still select either uV3 or uV2 to start your project. My last update from Keil included uV3 as an option. Also, you can download CARM or PK166 eval that contains uV3. Either eval will install uV3 and it will be available to PK51. You are right, the advanced edit features of uV3 are not available in uV2.
"You can download uV3 from the Keil website." That was my point: it's not (well, it wasn't) included with the C51 package - you had to download it separately, and then install it separately. Having done that, I think it was some of the Help/Books features that didn't work properly - it was looking in the wrong folders, or something. Maybe it's all fixed now...
"I see this reformat feature in a freeware c editor/compiler such this http://www.cs.virginia.edu/~lcc-win32/ " Sorry, was wrong, it isn't freeware. The software is "free for non-commercial use". Nothing forces you to use uVision or its editor if you prefer something else! Of course. Only prefer the Eye of IDE.
"Only prefer the Eye of IDE." That's the problem with any "all-in-one" solution - whether it's a combined TV+DVD+VCR, an "integrated" Hi-Fi system, or a software IDE - you are stuck with the "integrated" components. Maybe the Eclipse project offers some hope - with an Open Development Environment, so you can easily "integrate" your favourite tools... http://eclipse.org/