|
-
Apr 25th, 2010, 09:00 AM
#1
Thread Starter
New Member
[vb6] help a newbie with the basics.

If i wanted my program to calculate the period difference between two dates, how can i derive the code from what they have provided in the bottom boxxed up field?
thanks.
- what does this statement mean?
Call SaveSetting("Name Of Your Program", "Login", "Username", txtUsername.Text)
if you're just saving the settings of the username (txtUsername.Text), why would you need the first part, i.e. [Name Of Your Program", "Login", "Username"]
- Private Sub Form_Load()
chkSave.Value = GetSetting("Name Of Your Program", "Login", "Save Login Information", Checked)
If chkSave.Value = Checked Then
txtUsername.Text = GetSetting("Name Of Your Program", "Login", "Username")
txtPassword.Text = GetSetting("Name Of Your Program", " Login", "Password")
End If
End Sub
why do you need the line in red? Why not when the form loads, just check whether the chkSave.Value is checked, and work from there on?
-
Apr 25th, 2010, 10:02 AM
#2
Re: [vb6] help a newbie with the basics.
Welcome to VBForums 
To start with, is there a particular reason that you are just starting to learn VB6 (aka VB1998), rather than a more modern version (such as the free 2010 Express edition http://www.microsoft.com/express ) ?
1. Deriving it from there isn't easy unless you have a decent amount of experience... you would be far better off typing DateDiff into a code window, then click on it and press F1 to see the help for it - which contains explanations and examples.
2. You should read the help for that too.
You need the first part because the Registry is not program specific - so without specifying the program, how would you differentiate between the Login value for the program you are writing and the Login value for another program (including another one you write later)?
3. The value of chkSave.Value will not be automatically remembered (it will default to whatever you set it to in the design window), so that line loads it from the Registry when the program starts (the SaveSetting line saves it to the Registry).
-
Apr 25th, 2010, 10:16 AM
#3
Thread Starter
New Member
Re: [vb6] help a newbie with the basics.
hello si_the_geek,
I'm honoured to have such a high ranking member helping me out with my newbie problems thanks.
with regards to the first question, i dont really know i've just heard of many vb6 mentions by programmers on the forums i'm on, and i've come to think that is the most popular programming tool around, so i decided to pick it up.
would you be able to give me a short comparison between vb6 and the more modern versions available?
when i press f1, it says that the MSDN collection does not exist. Please reinstall MSDN. how can i do this?
-
Apr 25th, 2010, 10:43 AM
#4
Re: [vb6] help a newbie with the basics.
VB6 was very popular in its day, but it is now "out ranked" by the later versions (known as VB.Net). Many people still use VB6, but generally because they were already using it and don't want to re-learn (or in some cases can't move away from it because their job demands it).
Due to the age of VB6, it is missing many features for things that are useful and/or are now considered standard (such as icons in menus, automatically resizing/moving the items on your forms when the form size changes, using .png files, allowing icons with alphablending, etc etc). Those things can generally be added with quite a lot of effort, but in VB.Net those things are built in and take almost no effort at all.
An important point is that VB6 is no longer supported, so we have no idea if VB6 programs will work on any future versions of Windows.
There is a bit more info in the article Where can I get VB6? Is starting to learn VB6 a good idea? from our Classic VB FAQs (in the FAQ forum)
when i press f1, it says that the MSDN collection does not exist. Please reinstall MSDN. how can i do this?
Insert the MSDN Library CD, and the installation/maintenance process should automatically start.
If you don't have the CD for some reason, you might be able to buy it via eBay etc.. there is another article in the "General" section of the FAQs which explains which versions you can use etc.
Attempting to learn a programming language without the help files is not a wise move, as it makes things much harder.
The help files for the VB.Net Express edition can be downloaded along with the program itself (and may be included with the main download).
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|