User Profile
Collapse
-
Next time, say that you need help with the regular expression itself. I assumed that you had a valid re and merely wanted to know how to validate a string with it. The unix forum is a better place for this question.... -
I know nothing of the RegularExpressi onValidator.
I've only used the .NET RegEx object. To validate if a string is accepted by your regular expression, first declare a RegEx object:
RegEx MyRegEx = new RegEx(MyStringR epresentationOf MyRegularExpres sion);
Then, too see if a string is validated:
MyRegEx.IsMatch (StringToBeVali dated);...Leave a comment:
-
Is this for an assignment? If so, do it to your specs. I'm just saying that you never want to reinvent the wheel. The date-time picker gives you a valid date, so you wouldn't have to validate it yourself. If the idea is that the user will be entering so many dates that the dtp would be cumbersome, you may want to look ate date.TryParse() .
BTW, why create the controls at run time? Especially if you're doing this in the load event,...Leave a comment:
-
Well, you can split the input by newline, then use a for each loop to validate each one. Although, I'd wonder if you shouldn't just use a date-time picker to populate a listbox-- then you wouldn't need to validate it yourself because the date-time picker returns a date data type....Leave a comment:
-
I used to like to put in a scanf at the very end, so that it would stay until I hit ctrl+c. :-)...Leave a comment:
-
Just free the entire string at the end, if you don't need the data.
The process you describe seems to be re-reading substrings while the method I gave you reads one char at a time....Leave a comment:
-
If you had the string MyString then, you'd do something like
[Code=c]
for(int i = 0; i < MyString.Size; i++)
MyIntArray[i] = MyString[i] - 48;
[/Code]...Leave a comment:
-
Are you allowed to assume that this will run on an ASCII system? If so, I would just use the fact that there is a direct relation between chars and ints. E.G. the char '0' is equivalent to the int 48 . Then you can just go element by element and fill the int array with the char array's equivalent....Leave a comment:
-
-
The subscript you're using in the atoi call is derefferencing the pointer. You should use pointer arithmetic in order to pass the actual pointer.
e.g.
ar[i] is a value while (ar + i) is a pointer....Leave a comment:
-
Interesting. Are wstrings used to accomodate foreign chars or something? Maybe I'll just google it :-)...Leave a comment:
-
What's a wstring? If you just mean a C++ string, then you can convert the int to a string and use concatonation.. . More info, please....Leave a comment:
-
You'll have to follow the website I gave you. VB stopped supporting VarPtr in VB6, and now there's no such thing as a pointer in VB .NET. But, as the article points out, you can still invoke the HeapAlloc API function and then use the memory reading/writing functions the author mentions....Leave a comment:
-
As unbelievable as it sounds, you can just open the dll in a different VS, put a breakpoint at wherever you want to step through, start both projects (F5), then when the code calls the method, it will allow you to step through the DLL's code... or at least that's what I remember. Confirmation, anyone?...Leave a comment:
-
-
I believe that every time you build a project (F5), its EXE gets saved to the bin/Debug folder of your project. That is the current copy. You never need to "make" the exe as you had to in vb6....Leave a comment:
-
Reinventing the wheel, eh? You're in for more than you bargained for. This technology is not easy to write by yourself. Considering the lack of theoretical importance, why do you want to do this?...Leave a comment:
-
You can do bare-bones C programming in both gcc and msvc. You can supply gcc the command argument -ANSI (or something similar) to make sure it's compliant. I usually don't bother cuz that means you can't use // to comment (very annoying)...Leave a comment:
-
What graphics library are you using? This is something you should be able to look up in documentation, right?...Leave a comment:
-
Use the FormClosing eventargs
[Code=vbnet]
If MessageBox.Show ("Are you sure?", "Close?", MessageBoxButto ns.YesNo) = Windows.Forms.D ialogResult.No Then
e.Cancel = True
Else
e.Cancel = False
End If
[/code]...Leave a comment:
No activity results to display
Show More
Leave a comment: