|
So look for the last space character in the string. Everything after that should be the date. Use Date.TryParse to try and convert it to a DateTime object and you're done.
|
|
|
|
|
Hi,
I'm facing a problem about how to zip the folder by using vb6. I hope that can get help from all of you.
Thank you.
|
|
|
|
|
wsun87 wrote: I'm facing a problem about how to zip the folder by using vb6.
Execute an external app to do the zipping. It's strongly advised not to write any new code in VB6. The language is no longer sold nor supported.
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
Hi all,
Take a look at:
http://www.codeguru.com/vb/gen/vb_graphics/fileformats/article.php/c6743/Zip-and-Unzip-Using-VB5-or-VB6.htm
It looks great anyway.
(sorry about then link in text mode, i still did'nt find how it works)
See you
|
|
|
|
|
Hi.
Does anyone know of a way to throw errors in vb.Net based on the error number? I need to build a list of just that since, as unnbeleivable as it sounds, MS apparently can't provide a table of error codes matched to their descriptions like they did in vb6. If that means they are too numerous to list, then if they can't stand the heat, get out of the kitchen, right?
Anyway, the Throw() method seems to be based on the user providing the error description so that the error can be thrown, and THEN you can query the Err structure to get the corresponding number. But I don't see a way of going in reverse...Providing an error number and having the exception thrown, so you can get at the description.
In that same regard, I could go back and use the error codes from vb6.....IF they matched up with the ones in vb.Net. That's one hell of an assumption!
Best regards!
modified 25-Apr-13 18:14pm.
|
|
|
|
|
Maybe you've already seen this but you can create your own exception handler by inheriting from the system defined exception classes.
Perhaps you could simulate the old vb error codes that way (if you must).
"It's true that hard work never killed anyone. But I figure, why take the chance." - Ronald Reagan
That's what machines are for.
Got a problem?
Sleep on it.
|
|
|
|
|
Hm...Seems crazy to go through all that for a simple list.
|
|
|
|
|
>"Hm...Seems crazy to go through all that for a simple list.
It's not what I would want to bother with, but the I'm not the OP. Only he can weigh the pro and cons of maintaining their legacy code.
"It's true that hard work never killed anyone. But I figure, why take the chance." - Ronald Reagan
That's what machines are for.
Got a problem?
Sleep on it.
|
|
|
|
|
The exceptions don't really have error numbers. The Err object is a hold over from the VB6 days. It's not used in VB.NET code. It's only there for backwards compatibility in old VB6 projects that were converted to VB.NET.
|
|
|
|
|
Well, my predicament is that I am finishing up a port-over of a vb6 project, with old style "On Error Resume and Goto" statements. So I need all possible errors that can be raised at certain spots. And since .net supports backward compatability, then the least they can do is show a table of vb6 error codes vs. descriptions. BUT then again, if this is TRUE backwards compatability, then the code numbers would not have changed. I hate making assumptions like that, though.
|
|
|
|
|
Details like that are left up to the VB6 documentation, not VB.NET. They have nothing to do with VB.NET.
|
|
|
|
|
Still...Would be nice if they would put some of the old stuff in the net documentation, so you don't have to leave the net IDE to go look for a legacy feature that net supports. In that sense, it really IS part of net...Just not its new framework. I guess I'm just nitpicking.
|
|
|
|
|
Again. It has nothing to do with .NET at all. It's legacy junk that's only there for backwards compatibility. It offers nothing to .NET development and why would you duplicate documentation that is already out there and redocument language features that have been unsupported for years now?
|
|
|
|
|
It really is NOT part of .NET. What you see in a converted application are methods and hacks that look and work like old VB6 code. It's just a bunch of adaptations cobbled together to make .NET code look and work like old VB6 functionality.
|
|
|
|
|
how can I increase the textbox depth, so to obtain a shadow effect?
|
|
|
|
|
You need to set the multilline property to true. Then it will allow you to change the depth of the textbox.
Every day, thousands of innocent plants are killed by vegetarians.
Help end the violence EAT BACON
|
|
|
|
|
what's the next step after setting textbox.multiline=true
|
|
|
|
|
|
Member 9941343 wrote: how can I increase the textbox depth, so to obtain a shadow effect?
It's a 2D-object, it's not in 3D. If you want a shadow, you'll have to paint it.
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
Hi Folks,
I am having difficulty sorting a custom class based collection on two fields and am wondering if anyone can assist me. I have a class that looks like so:
Class myClass
private ID as String
private Name as String
private TK as String
private Di as String
private M as String
End Class
Using this class i add to a Collection a number of items, e.g.
Private colClass As Collection
Private clsTheClass As myClass
Set colClass = New Collection
Set clsTheClass = New myClass
clsTheClass.Name = "A"
clsTheClass.TKs = "100"
clsTheClass.Di = "5"
clsTheClass.ID = "1"
clsTheClass.M = "9"
colClass.Add clsTheClass
What i end up with it is a collection that looks like so after adding all the items:
ID |Name |TK |Di |M
1 A 100 5 9
2 B 100 3 9
3 C 10 5 9
4 D 10 7 9
5 E 10 1 9
6 F 400 9 5
7 F 400 4 5
I need to sort the collection On TK, and then DI. That should make the collection look like this:
ID |Name |TK |Di |M
6 F 400 9 5
7 F 400 4 5
1 A 100 5 9
2 B 100 3 9
4 D 10 7 9
3 C 10 5 9
5 E 10 1 9
I am currently using this method to sort on TK, but i cannot get it to work how i need the output:
Public Sub SortCollection(ColVar As Collection)
Dim oCol As Collection
Dim i As Integer
Dim i2 As Integer
Dim iBefore As Integer
If Not (ColVar Is Nothing) Then
If ColVar.Count > 0 Then
Set oCol = New Collection
For i = 1 To ColVar.Count
If oCol.Count = 0 Then
oCol.Add ColVar(i)
Else
iBefore = 0
For i2 = oCol.Count To 1 Step -1
If CLng(ColVar(i).TK) < CLng(oCol(i2).TK) Then
iBefore = i2
Else
Exit For
End If
Next
If iBefore = 0 Then
oCol.Add ColVar(i)
Else
oCol.Add ColVar(i), , iBefore
End If
End If
Next
Dim MyNewCol As New Collection
Dim obj As Object
For Each obj In oCol
If MyNewCol.Count > 0 Then
MyNewCol.Add Item:=obj, before:=1
Else
MyNewCol.Add Item:=obj
End If
Next
Set ColVar = MyNewCol
Set oCol = Nothing
End If
End If
End Sub
Anyone got any pointers as to what i need to change in the sort routine?
Thanks In Advance
|
|
|
|
|
Hi Keith
Is it known how many elements are added to the collection or is that defined at runtime?
|
|
|
|
|
Whenever I sort, I find the largest, or the least first and set the value to "x". From there I work up, or down assigning to a temp object, collection or array, and replacing "x" as the largest each time.
For example,
x = 0
for each item in collection
if item > x then
x = item
end if
next
This gets the largest to begin.
tempCollection.add(x)
while tempcollection.count isnot collection.count
for each item in collection
set x if the item is less than the last in tempcollection and is not less than x
next
tempcollection.add(x)
loop
That is a level one sort, but you should be able to expand to code easily enough. Sorry that I lack any time, or I would have done it for you!
|
|
|
|
|
You could implement the IComparable interface in your class, and then define the CompareTo function. Put your comparison logic in this CompareTo function. Then all you would need to do is call the Sort method on your collection.
MyNewCol.Sort()
Roy.
|
|
|
|
|
I need to hide window when application starts. I use VB 2008 on Windows CE 5.0.
|
|
|
|
|
Take a look in Form properties WindowState
"It's true that hard work never killed anyone. But I figure, why take the chance." - Ronald Reagan
That's what machines are for.
Got a problem?
Sleep on it.
|
|
|
|