Remove Dead Commented Out Code
Mar 10, 2010
I'm working with an inherited code base which contains thousands of lines of commented out code. I know the previous coder meant to save all his hard work for posterity rather than simply deleting it but: I will never read it and it just gets in the way. One problem example is that when I perform text searches for certain code segments I gets dozens of "false" hits in the commented code. Is there a quick/easy way to detect large blocks of commented out code? A clever RegEx perhaps? I happen to be working in VB.NET at this time and comment character is a single apostrophe.
View 7 Replies
ADVERTISEMENT
Oct 13, 2009
I am a Java developer. I have the task of converting a VB class to Java.Can some VB developer comment the following VB code so that I can write its Java equivalent?
Public Class RmaValidationCode
' Values for test type
Public Const SOFTWARE_TEST_TYPE = 0
[code].....
View 2 Replies
Mar 1, 2011
Vb.net For each currentFarm in ......
If urlQueue.Count > 0 Then
Debug.Assert(currentFarm.isBusy = False)
Debug.Assert(currentFarm.WebClient.IsBusy = False)
[CODE]...
The commented code won't work. That's because by the time the thread start, the variable currentFarm have changed. So I create a new function and cache the currentFarm in the function parameter. No there will be a cache of currentFarm address (object is always a pointer) on a stack and that address is the one being passed to the System.Threading.Thread constructor.
View 5 Replies
Oct 14, 2011
I have a folder which consists of 13 files. I want if a file contains human readable code than count the number of commented lines, line of code, and otherwise ignore the file.
View 4 Replies
Mar 19, 2011
I can download the vb.net 10 Language Specification from Microsoft here 600+ Pages is a lot to print out. So I want to know is there a Dead Tree version (A book)? If so, where can it purchased?
View 2 Replies
Jul 6, 2011
I ran into this problem while trying to write a Pan/Tilt/Zoom controller program. I found some very complicated examples, but managed to put the pieces together into this simple test program.I first import System.IO.Portsthen I define a new serial port and give it the required parametersI open the com port when the form loadsI have two working buttons, one to pan left, one to stop panning. The hex commands are pre-configured.The one for Stop is A0 00 00 00 00 00 AF 0FThe one for Pan Left is A0 00 00 04 14 00 AF 1FI declare a byte array to contain the command bytes and put them into the correct position.
Code below:
Imports System.IO.Ports
Public Class Form1
[code].....
View 13 Replies
May 7, 2010
The DevExpress download link for CodeRush Xpress (found here CodeRush Xpress for C# and Visual Basic inside Visual Studio 2010), Download CodeRush Xpress seems to lead to a dead download. The page is there but when the auto-download kicks off or you manually try to Start download, we're gettting a 404 error. The download worked fine last night... There's no obvious way to ping the MSDN VB Dev Center nor DevExpress to let them know about this issue...
View 3 Replies
Jun 25, 2010
I just had this throw a compilation error while refactoring some legacy (hence VB.NET) unit tests, where I wanted to just comment out one of the sample inputs to MBUnit:
<RowTest> _
'<Row("Something")> _
<Row("SomethingElse")> _
[Code]....
Is it actually treating the whitespace/commented-out line as an actual line? Generally, when I gripe about VB.NET, I preface it with, "Now, I wouldn't want to be the guy writing their grammar, but..." This seems like one of those cases where I don't know the answer, if I'm right.
View 1 Replies
Dec 13, 2009
I have this string just down loaded of a Unix server. I would like to remove the box (0x0A) Unix end line code; then replace it with CR+LF normal ASCII code. Also, I would like to do the replace before I save the data, while it in memory.
View 14 Replies
Apr 23, 2009
I need to remove all the unused code in my companies project. There is about 1.5 million lines of code, therefore I need a tool to help track it all down. I was wondering if anyone could recommend a tool. I found Project Analyzer but I need good justification on why we need to use this software because the verndor is foreign based.
View 2 Replies
Oct 20, 2010
I can access any setting using my.settings. But If I want to add/Remove settings from my code is it possible. for example I have three settings for myappname,myappstartdate,myapploginuser. now I want to add loginUserPassword setting using code is it possible.
View 6 Replies
Mar 1, 2009
Is there any equivallance code for c# or vb.net to StringUtils.remove?
Note: one is able to use StringUtils.remove in Java.
View 2 Replies
Feb 1, 2011
This is a simplified version of a class that I have in my project. Since the Bonus is figured the exact same way in each function I want to remove the obvious code duplication that appears here and make the three different functions into one. However I am not sure how to provide the argument that this new function would require.
For instance I am currently just passing the argument like this from code
lblVolumeBonus.Content = TestClass.VolumeBonusAmountStore(bonus).
I think I have to basically turn this logic around and call it with something like
lblVolumeBonus.Content = TestClass.VolumeBonusAmountStore(BonusTrackerBO.StoreBonus)
but I am not sure of the correct syntax or whether I am on the right track at all.
Public Class TestClass
Public Shared Function StoreBonus(ByVal bonus As BonusTrackerBO.StoreBonus) As Double
[Code]....
Edit: It may not make a difference but I should have made clear that there are other factors in the equation (I was just trying to keep it simple). So is the answer the same when there are other callbacks to the bonus like bonus.MaximumAmount, bonus.MinimumAmount? There are 5 callbacks to the bonus object and the amounts are different depending on whether it is a Store, District or Company asking.
View 2 Replies
Nov 2, 2010
I have a code that uses WPF Interoperability where I have WPF Item that is being added as user control in windows forms. I use the WPF for 3D view where I add a sphere dynamically and it works fine, all I do is just send x, y and radius from the form to WPF and it draws the sphere.
Now here it is the problem I made a loop that reads list of coords and draws them in WPF control, it works perfectly if I add a blank MsgBox but if I remove the MsgBox it only shows the last sphere in the list, Eg For Each obj As Sphere in LstSpheres. MsgBox("") 'If I remove this the code doesn't work. CreateSphere(obj.x, obj.y, obj.radius, Brushes.Red) 'This Sub adds the Sphere in WPF Control Next
How is that possible, and how can it be fixed?
UPDATE:
CreateSphere
CODE:
View 2 Replies
Apr 1, 2010
Is there a macro in the Visual Studio editor to remove all comments from a VB.NET source file?
View 2 Replies
Apr 3, 2012
I'm wondering about a feature in Visual Studio. Personally it bugs me when I open a solution someone else has been working on and it's full of Controls with Ids like "label27" "textbox3" etc. One of the first things I do is either rename them or remove them if they are never referenced in code behind (as is usually the case with the labels).
[Code]...
View 2 Replies
May 3, 2011
I have the following on my interface / webform: <div id="mydiv" class="forceHeight" runat="server" />
now I have a dondition in my code behind where if a certain situation is true I need to remove the forceHeight class from this control. I know in C# you can use:
mydiv.CssClass.Replace("forceHeight", ""); I'm not so sure how you do this using VB? Intellisense doesn't offer me this option?
View 1 Replies
Jan 20, 2010
I use to use .Trim() code to remove spaces tell I found that It only remove spaces before and after the text only not between word
for example:
" a b c d " ---after .Trim() --> "a b c d"
so, is there any code like .Trim() but to remove spaces between letters and words?
View 2 Replies
Sep 16, 2010
how to remove a backgroundimage in the code whenever I activate colordialog :
[Code]...
I have a backgroundimage on the Me.(form1), I want it to be replace by the color choosen by the user with colordialog, right now it only changes every other form because the : me.backcolor = colordialog1.color has a backgroundimage.
View 2 Replies
Jul 21, 2011
How can I avoid a first chance exception here. I need to use the cancel button to jump around the remove at code. The exception is caught and the bail out goto works, it is just the first chance I'd like to get rid of.
[Code]...
View 8 Replies
Aug 20, 2010
This is my
If CheckedListBox1.SelectedItem IsNot Nothing Then
MsgBox("Your favourites have been saved")
ListBox7.Items.AddRange(CheckedListBox1.CheckedItems)
End If
End Sub
What i want it to do is to add the selected items from checkedlistbox1 to listbox7 (but not remove them all together)
This is my error: Overload resolution failed because no accessible 'AddRange' can be called with these arguments:
'Public Sub AddRange(items() As Object)': Value of type 'System.Windows.Forms.CheckedListBox.CheckedItemCollection' cannot be converted to '1-dimensional array of Object'.
[CODE]...
View 4 Replies
Jan 11, 2011
Just had to remove remove statics and use Delegates refering to class. i have got a little problem in one of my project.I need help to resolve it.My application Connect several FTP server with the same Class.I'm using TCPclient for few specifics Commands.The problem : All threads call the same TCPclient wich can't connect several server at once.I would like to create a New TCPclient for each thread.
[Code]...
View 8 Replies
Oct 10, 2011
I'm trying to remove individual nodes from their parent, I tried the Remove method but it doesn't seem to be working. How is this done? Is this a bug or what?
Sub Main()
Dim xml =
<?xml version="1.0" encoding="utf-8"?>
[Code].....
View 1 Replies
Jul 18, 2012
How can i remove an array item by selecting an item from listobx and press remove/delete button?for an example, if i want remove index 2 from listbox, so the array should remove index 2 item and move the item of index 3 to index 2 and so on.
View 7 Replies
Feb 22, 2009
I'm trying to get a ComboBox to remove the 6th string in the ComboBox or an index of (5) but it doesn't remove it here is the function I am using:
if ComboBox1.items.count = 6 then
ComboBox1.Items.RemoveAt(5)
End If
View 3 Replies
Jun 21, 2010
why the code...
Form1.Controls.Remove(myCustomControl) ...does not remove the control.
Because whenever I remove a control and add it again, it does not Load but rather just changes its visibility from false to true and all the variables are not reloaded.
I tried to use .Dispose() but VB.net tells me thatit can't access a disposed object whenever I try to add the control again.
View 6 Replies
Dec 8, 2011
I have some code to execute code at runtime...
Here is the main
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Try
If TextBox1.Text.Trim <> "" Then
If TextBox2.Text.Trim <> "" Then
[code]....
When the button is pressed, it all works and the following files are created: yahoo.dll and yahoo.pdb My question is this: What is the code to load the already compiled yahoo files to execute the code again, without having to recompile the code?
View 1 Replies
Jul 19, 2011
This code was posted in Chit Chat and everyone is saying how great it is. I just have Visual Studio 2010 and no familiarity with VB6 so I thought it would be good to convert the code to Visual Basic 2010.
[Code]...
View 39 Replies
Sep 9, 2011
this code was not done by me originally and there are some thigns here i dont quite understand i have altered it a bit from my coworkers code to suit my data and it works. but too slow. and when i have 4000+kb excel files it might freeze altogether. ( I have checked tho that when and after this transposer runs it will still be within the excel row limit, i had done calculations before and made a macro to automatically split excel files based on number of columns and rows to make sure this is so ). This code seems to start out fast then goes slower the longer it runs. at least this is what it seems liek to me.
[Code]....
View 2 Replies
May 26, 2010
i recorded the following macro in excel 2007:
[Code]...
View 3 Replies