|
-
Feb 12th, 2012, 11:50 AM
#1
Thread Starter
New Member
please help
This program is not working in vb6. Could u please check where I am going wrong?. Thanks a lot 
<html>
<head>
<script language=”vbscript”>
dim name, bd, g, age, n
name=inputbox(“enter your name”)
g=inputbox(“enter your gender”)
bd=inputbox(“enter your birthdate in 4 digit year”)
age=year(age)-year(bd)
if age <= 15 then
n=inputbox(“enter your school name”)
elseif age>15 and age<=22 then
n = inputbox(enter your college name”)
elseif age>22 then
n= inputbox (enter your workplace name”)
end if
document. write”<br> name:- “ &name
document. write”<br> gendre;-“ & g
document. write”<br> birth date:-“ &bd
document. write” <br> other info:-“ &n
</script>
</head> </html>
-
Feb 13th, 2012, 04:43 AM
#2
Frenzied Member
Re: please help
This program is not working in vb6. Could u please check where I am going wrong?. Thanks a lot .
you have been trying in vbscript .try in the vb6 and in the following way.Hope this might help
Code:
Option Explicit
Private Sub Form_Load()
Dim bd As Date
Dim Curyear As Date
Dim age As Long
Dim sName As String
Curyear = CDate(InputBox("Please enter Current Year"))
bd = Format(InputBox("Please enter your birthdate"), "DDMMYY")
age = Year(Curyear) - Year(bd)
MsgBox age
If age <= 15 Then
sName = InputBox("Enter school Name")
ElseIf age > 15 And age <= 22 Then
sName = InputBox("Enter CollegeName")
ElseIf age > 22 Then
sName = InputBox("Enter workplace Name")
End If
End Sub
Last edited by firoz.raj; Feb 13th, 2012 at 04:46 AM.
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
|