1,857 Posted Topics
Re: The first thing I see, declaring i in the do/while loop resets the value of i, each time the loop iterates. Also Console doesn't normally work in a form. When you say navigate you'll have to be more specific. Your code doesn't really do anything. Do you want to be … | |
Re: You start a timer routine, that will fire the class event every 10 seconds, your code can interrupt this if needed, by turning the timer off then on. Your class may need a method to allow this, perhaps `PerformEvent()`. Then this routine can call it with something like this, `MyClass.PerformEvent();` … | |
Re: Reading the text file is actually fairly simple if you use the File class. Something like this works: I assumed the last part should have a '-' instead of a space 4 - 2 ^ 3 Imports System.IO Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click … | |
![]() | Re: I'm pretty sure that won't work you might need to change it to this: Dim insSub As Integer = 0 Do Until intSub = strGrades.Length If strGrades(intSub) = strSearchFor Then intCount += 1 End If intSub += 1 Loop |
Re: Take a look at [std::find_if](http://www.cplusplus.com/reference/algorithm/find_if/) | |
Re: Try this [reference](http://www.cplusplus.com/reference/cstring/strtok/) | |
Re: If I understand what you're trying to do, there are several things that need changing in your code. Try this: #include <iostream> using namespace std; double box_area(int l, int w); double box_vol(int d, int l, int w); int main() { int l,w,d; double a,v; cout<<"length : "; cin>>l; cout << … | |
Re: Here's an [example](http://www.daniweb.com/software-development/csharp/code/217212/bubbe-sort-and-selection-sort-in-c) for you. | |
Re: From your examples I assume if the new item equals the last item in the list then add the value to the last item, otherwise add the new item to the list. Something like this might work: Dim Itm As MSComctlLib.ListItem Dim Dbl1 As Double Dim Dbl2 As Double Set … | |
Re: Redirecting the standard error output, and maybe enabling the `CreateNoWindow` property, both available through the [ProcessStartInfo Class](http://msdn.microsoft.com/en-us/library/vstudio/system.diagnostics.processstartinfo%28v=vs.100%29.aspx), should solve your problem. | |
Re: > "NullReferenceException was Unhandled" Try this `Dim strLine As String = ""`. It's usally a good habit to initialize every variable when you declare it. > send the number of "intIndex" to the Imediate box Debug.WriteLine(intIndex). Also you could set up a breakpoint, when your code stops, show the locals … | |
Re: What code have you tried that isn't working? The `.ShowDialog` method should work. | |
Re: Word is probably using it's default behaviour, when you try to close a document without saving it. Try this, `wordDoc.Close(WdSaveOptions.wdDoNotSaveChanges);`. | |
Re: Show us the code, the error, and the line highlighted when the error shows up. | |
Re: Pictures of the form don't mean much without the code that produced it. If you're unsure on how to add your code, in the edit window click 'Code', then paste your code in there, and click `Insert Code Snippet` | |
Re: Something like this should work: Dim Itm As MSComctlLib.ListItem Dim X As Double Dim Dbl1 As Double Dim Dbl2 As Double Set Itm = ListView1.FindItem(txtCode.Text,0) If Itm Is Nothing Then Set Itm = ListView1.ListItems.Add(, , txtCode.Text) Itm.SubItems(1) = txtproductname.Text Itm.SubItems(2) = txtqty.Text Itm.SubItems(3) = txtprice.Text Itm.SubItems(4) = lbltotal.Text Else 'Qty … | |
Re: make the module public and declare any sub, function or variable as public, and they will be accessible to the whole project. | |
Re: Something like this might work: Public Class Call10Input Private _User As String = "" Private _Password As String = "" Public Property User() As String Get Return _User End Get Set(ByVal Value) _User = Value End Set Public Property Password() As String Get Return _Password End Get Set(ByVal Value) _Password … | |
Re: Something like this might work: Private Sub BtnTest_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BtnTest.Click Dim IPmsg As String Dim NetshArgs As String IPmsg = Microsoft.VisualBasic.InputBox("Enter IP information", "Enter IP subnet and gateway with a sigle space between each.", "", 500, 700) Dim NewProcess As New ProcessStartInfo 'Change … | |
Re: You might want to consider using one multi-line textbox. One item on each line. Your code would then be greatly simplified Imports Syatem.IO 'to fill the textbox TextBox1.Lines = File.ReadAllLines("C:\Test2.txt") 'to save the data in the textbox, if you use the same filename it will get overwritten. File.WriteAllLines("C:\Test2.txt", TextBox1.Lines) If … | |
Re: btw in line 10 I think you mean `Close #1` | |
Re: A couple of things. First port is an integer it should be initialized to 0 not "". Second both server and port must have actual valuesfor it to work right. host Type: System.String A String that contains the name or IP address of the host used for SMTP transactions. port … | |
Re: I'm pretty sure that the headphone jack is hardwired to disconnect the speaker jack when a cable is plugged in, all of the ones I've seen are set up that way. You might need a speaker switch. | |
Re: `ReadLine` is for reading input not writing to the output. You need `WriteLine` for that, `Console.WriteLine(answer[i]);` | |
Re: This might work for you: float random_integer; float lowest=-100.00, highest=100.00; float range=(highest-lowest)+1; float sum = 0; float average; float minimum = highest, maximum=lowest; for(float index=0; index<100; index++) { random_integer = lowest+float(range*rand()/(RAND_MAX + 1.0)); if (random_integer > maximum) maximum=random_integer; if (random_integer < minimum) minimum = random_integer; sum += random_integer; cout << … | |
Re: Use a conditional statement, If Form1.TextBox1.Text = "" Then 'Do something End If | |
Re: use a boolean variable. In the handler code, have 2 sets of code, run a set based on the condition of the boolean. | |
Re: One fairly easy to understand, online, reference, is [cplusplus.com](http://www.cplusplus.com/reference/). It includes a pretty good search engine that will search the forum and the reference. | |
Re: You could use a third array as a temproary holding space. temparray = array1 array1 = array2 array2 = temparray this will swap the arrays. To swap the other way change around array1 and array2 | |
Re: I think a lot will depend on the interface to the robot, and how that interface connects to you computer. | |
Re: Make sure the `RighToLeft` property is false. | |
Re: It would help to know which line was referenced in the error. If I'm not mistaken, generally that error is from not initializing an object when it is declared, then trying to give it a value. In your code `SQL1`, `Dset`, `searchacquisition`, `OleA` might fall in that category. `SQL1` is … | |
Re: Your description is kind of vague. Perhaps uploading the code you're using will make it clearer. | |
Re: Probably the easiest is to, use a text file. Have each row on one line of a file with the values, converted to string, comma delimited. Use a `.csv` extension and the receiver should be able to load it into a spreadsheet. For readability maybe make the first line with … | |
Re: Copy the code you're using to the clipboard. Then click `Code` on the post menu. In the overlay paste your code. Correct any tab issues to make it more readable. Click `Insert Code Snippet` Now your code is formatted in the message field, and you can add any comments that … | |
Re: Here's a pretty good [starting point](http://msdn.microsoft.com/en-us/library/bb387100%28v=VS.100%29.aspx) Here's more [good info](http://msdn.microsoft.com/en-us/library/vstudio/gg145036%28v=vs.100%29.aspx) Of course a search of the posts here should turn up plenty of posts about XML | |
Re: > thanx bro but i have to create a dynamic array not static array A [vector](http://www.cplusplus.com/reference/vector/vector/) might be what you're looking for | |
Re: for a textbox this should work: For b As Integer = 0 To c z = x.Date.AddDays(b) TextBox1.Text = String.Concat(TextBox1.Text, b, vbNewLine) Next | |
Re: The simplest is probably the bubble sort, just as your instructor suggested. There's even a code snippets posted here for that type of sort. | |
Re: if you loop through the items in the listview, possibly a For Each loop, you can compare the subitem to a date. You might have to parse it into a datetime type to do the comparison. If the date qualifies save the whole item in a separate list. This way … | |
Re: could you use a multidimensional array? string person[n][3] for (int i = 0; i < n; i++) { for (int j = 0; j < 3; j++) { inputfile >> person[i][j]; } } this way the sample from NathanOliver would look something like this // load the array with data … | |
Re: if that is your goal then yes your code is backwards. your variables(xcode,xsprice, etc.) should be on the left side of the '=' and the subitems(?).text on the right side of the '='. By the same token it looks like you've repeated that mistake further on in your code. the … | |
Re: You could try something like this: #include "stdafx.h" #include <cstdlib> #include <iostream> #include <iomanip> using namespace std; int ValidateInput(string Message); int main() { int choice = 0; //to hold a menu choice double charges = 0; // to hold the monthly charges //const for air const double AIR = 1100.0, … | |
Re: What could do is, in StrHTML12() check each element for an empty 'alt' attribute. Then process it from there. BTW, StrHTML12() is declared as a function but it doesn't return anything. | |
Re: Use the Split function to put the sentences from the paragraphs into 2 arrays. Then loop through the arrays to find common sentences. | |
![]() | Re: I think you've come to the wrong place. This is a place to help people with specific problems, mostly in code that they've already written. You need a site where you can hire a professional to do this. This is one such [site](http://www.codehire.com/). Unless of course you do have some … |
Re: These might help: [Click Here](http://www.extremeoptimization.com/QuickStart/CSharp/NumericalDifferentiation.aspx) [Click Here](http://www.codeproject.com/Articles/3370/Complex-math-library-for-C-and-VB-NET) | |
Re: Try this `~LinkedList(){}` at line 28. |
The End.