By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,587 Members | 1,079 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,587 IT Pros & Developers. It's quick & easy.

How to manage VB code

P: 62
Hello All.
I was looking for some means to manage VB code. A few of us in my team collectively work on VB 6.0 and it gets increasingly difficult to:
1) Communicate with one another where does the latest version of code reside [we started using ClearCase for this].
2) Communicate with users that a new compiled executable should now be downloaded.

Is the App.Major, App.Minor and App.Revision (or a combination) the only way to determine the version ? Will it be advisable to manually modify some XML file each time that has the latest version and make the executable download and parse the XML so it knows whether user has older version or the latest one ?

How do people generally manage VB code ? Is the "Auto increment" feature in the Make tab of Project properties menu useful in this context ?

Thanks in advance for your responses.
Jan 6 '08 #1
Share this Question
Share on Google+
12 Replies


Dököll
Expert 100+
P: 2,364
Hello All.
I was looking for some means to manage VB code. A few of us in my team collectively work on VB 6.0 and it gets increasingly difficult to:
1) Communicate with one another where does the latest version of code reside [we started using ClearCase for this].
2) Communicate with users that a new compiled executable should now be downloaded.

Is the App.Major, App.Minor and App.Revision (or a combination) the only way to determine the version ? Will it be advisable to manually modify some XML file each time that has the latest version and make the executable download and parse the XML so it knows whether user has older version or the latest one ?

How do people generally manage VB code ? Is the "Auto increment" feature in the Make tab of Project properties menu useful in this context ?

Thanks in advance for your responses.
Hello, paragpdoke!

The Auto increment sounds like it should do the job. I do not see why you'd need to modify App.Major, App.Minor and App.Revision if the needs to reflect current version of the XML. If the XML is getting generated by automatically by your VB application you can then manualy modify the version.

For instance, when you:

Expand|Select|Wrap|Line Numbers
  1. Open .... for Output as #FileName
  2.  
  3. Print #FileName, "<?xml version=" & Chr(34) & "1.0" & Chr(34) & "?>"
  4.  
  5.  
You'd need to Auto Increment within that line of code, or create a function that would look at that line and work it, which could create your XML version.

Have not worked with Auto increment, but this is something you can use to add the version of the file upon building it.

Try that, and sorry for your troubles:-)

In a bit!
Jan 6 '08 #2

Expert 5K+
P: 8,434
I was under the impression that something like this was built into the Enterprise Edition (I've only got Professional, and work alone anyway).

But perhaps you should consider getting "real" version control. I believe there are a number of packages which handle this kind of cooperative development, such as... um... SVN? And there's one from MS, I forget the name.
Jan 7 '08 #3

P: 62
Hello Dokol.
Thanks for your reply.
Yes....I understand what you are saying. I do have code in place that write the version descriptor xml file using MS XML6 object library. But there is an additional step involved here, let's call it "deploy". When the deploy action is triggered:
- The code should gather its own version (using App.*) properties.
- It should create the XML file using DOM methods (modify if one exists).
- Upload the XML to the server (I plan using ftp).

Though technically there is no problem here, I was looking for some information if this can be integrated into the IDE or something.

Ummm....but looks like I'm unclear myself on what I'm looking for :-).

Hello Killer.
I'm not sure what SVN stands for (I will search the web to find what this is) but we are trying ClearCase for managing the code.

Thanks anyways for the responses.
Regards,
Parag
Jan 7 '08 #4

Expert 5K+
P: 8,434
...Though technically there is no problem here, I was looking for some information if this can be integrated into the IDE or something.
That might be possible. Although I haven't used them, there are features in VB6 which allow you to build extensions to the IDE.
Jan 8 '08 #5

Dököll
Expert 100+
P: 2,364
Hiya!

I Googled for ya and could only find this bit of code. You'd need to make it work to meet your needs, it helps increment to different values

Expand|Select|Wrap|Line Numbers
  1. Function IncrementString(ByVal strString As String) As String
  2. '
  3. ' Increments a string counter
  4. ' e.g.  "a" -> "b"
  5. '       "az" -> "ba"
  6. '       "zzz" -> "aaaa"
  7. '
  8. ' strString is the string to increment, assumed to be lower-case alphabetic
  9. ' Return value is the incremented string
  10. '
  11.  
  12.   Dim lngLenString As Long
  13.   Dim strChar As String
  14.   Dim lngI As Long
  15.  
  16.   lngLenString = Len(strString)
  17.  
  18.   ' Start at far right
  19.   For lngI = lngLenString To 0 Step -1
  20.  
  21.     ' If we reach the far left then add an A and exit
  22.     If lngI = 0 Then
  23.       strString = "a" & strString
  24.       Exit For
  25.     End If
  26.  
  27.     ' Consider next character
  28.     strChar = Mid(strString, lngI, 1)
  29.     If strChar = "z" Then
  30.       ' If we find Z then increment this to A
  31.       ' and increment the character after this (in next loop iteration)
  32.       strString = Left$(strString, lngI - 1) & "a" & Mid(strString, lngI + 1, lngLenString)
  33.     Else
  34.       ' Increment this non-Z and exit
  35.       strString = Left$(strString, lngI - 1) & Chr(Asc(strChar) + 1) & Mid(strString, lngI + 1, lngLenString)
  36.       Exit For
  37.     End If
  38.  
  39.   Next lngI
  40.  
  41.   IncrementString = strString
  42.   Exit Function
  43.  
  44. End Function
  45.  
Jan 8 '08 #6

P: 62
Hello Killer.
Yes...I happened to find a wonderful plugin mztools (http://www.mztools.com) that allows external applications to be triggered from the IDE. Is there a way to provide the version information to the VB compiler using command line ?
By version information I mean runtime output of App.Major, App.Minor and App.Revision. The vb6.exe seems to accept a few name=value pairs....but couldn't figure out how to pass version information using the command line compiler.

Hello Dokol.
Many thanks for finding the Increment code for me ! I think I will be able to get it to run with this.

Best regards,
Parag P. Doke
Jan 8 '08 #7

Expert 5K+
P: 8,434
... Is there a way to provide the version information to the VB compiler using command line ?
My guess is that info goes in the VBP file.
Jan 9 '08 #8

P: 62
Oh...yes. Thanks for the information. Fortunately the vbp file is plain text.
I was looking on the lines of what arguments could I pass to link.exe...something like:
"%PROGRAMFILES%\<path to vb98>\link.exe" /EDIT /VERSION:4.3.2.1 "<path to exe>"

If something like that isn't possible, I will go for editing the vbp file.
Jan 9 '08 #9

Expert 5K+
P: 8,434
I'll be quite surprised if this info can be specified on the command line. If you have a look in the VBP file, you'll see a whole bunch of entries which obviously specify build/make options. For example...
MajorVer=1
MinorVer=0
RevisionVer=0
AutoIncrementVer=0
ServerSupportFiles=0
CompilationType=0
OptimizationType=0
FavorPentiumPro(tm)=0
CodeViewDebugInfo=0
Jan 10 '08 #10

Dököll
Expert 100+
P: 2,364
I'll be quite surprised if this info can be specified on the command line. If you have a look in the VBP file, you'll see a whole bunch of entries which obviously specify build/make options. For example...
MajorVer=1
MinorVer=0
RevisionVer=0
AutoIncrementVer=0
ServerSupportFiles=0
CompilationType=0
OptimizationType=0
FavorPentiumPro(tm)=0
CodeViewDebugInfo=0
You know too much, you scare me..

How'd you find this out?

Enjoy your week-end:-)
Jan 11 '08 #11

Dököll
Expert 100+
P: 2,364
Hello Dokol.
Many thanks for finding the Increment code for me ! I think I will be able to get it to run with this.

Best regards,
Parag P. Doke
That's excellent, we're all here to help...Good luck!
Jan 11 '08 #12

Expert 5K+
P: 8,434
You know too much, you scare me..

How'd you find this out?
Well, while that's probably true :) in this case I just looked in the file. (I think I've had to edit things in them once or twice before, because paths were pointing to the wrong place.)
Jan 11 '08 #13

Post your reply

Sign in to post your reply or Sign up for a free account.