corsasport.co.uk
 

Corsa Sport » Message Board » Off Day » short VB code help....


New Topic

New Poll
  Subscribe | Add to Favourites

You are not logged in and may not post or reply to messages. Please log in or create a new account or mail us about fixing an existing one - register@corsasport.co.uk

There are also many more features available when you are logged in such as private messages, buddy list, location services, post search and more.


Author short VB code help....
M2RTY
Member

Registered: 25th May 01
User status: Offline
12th Jun 04 at 10:27   View User's Profile U2U Member Reply With Quote

Cnst Max = 5
Dim First number as integer
Dim Secondnumber as integer

Private Sub cmdAdding click ()
Dim Total as single
Dim result as integer

For I = 1 to 8 do
Firstnumber = Inputbox("Please Enter a whole number")
Secondnumber = Inputbox("Please Enter another whole number")
Total = Firstnumber + Secondnumber
If Total < 50 then
Thitdnumber - Inputbox ("please enter another number")
Result = total / Thirdnumber
Msgbox "Your numbers were too small" & result

Else
Msgbox "thank you" & total
End
End sub



need to find 4 errors in this

any help??

off an exam paper

cheers
Dom
Member

Registered: 13th Sep 03
User status: Offline
12th Jun 04 at 10:32   View User's Profile U2U Member Reply With Quote

Dim First number as integer = Dim Firstnumber as integer

Private Sub cmdAdding click () = Private Sub cmdAdding click()

For I = 1 to 8 do = For I = 1 to 8

Theres no End If before the End Sub


Dom
Member

Registered: 13th Sep 03
User status: Offline
12th Jun 04 at 10:33   View User's Profile U2U Member Reply With Quote

also

Thitdnumber - Inputbox ("please enter another number") should be Thitdnumber = Inputbox ("please enter another number")
Dom
Member

Registered: 13th Sep 03
User status: Offline
12th Jun 04 at 10:36   View User's Profile U2U Member Reply With Quote

and

Dim Total as single = Dim Total as integer

Cnst Max = 5 should be Const Max = 5

also, wtf does this function do? and where does the Max const come in? Its just a load of bollocks which doesnt do alot by the looks of it lol
chris_uk
Premium Member

Avatar

Registered: 8th Jul 03
User status: Offline
12th Jun 04 at 10:37   View Garage View User's Profile U2U Member Reply With Quote

wtf

[Edited on 12-06-2004 by chris_uk]
M2RTY
Member

Registered: 25th May 01
User status: Offline
12th Jun 04 at 10:47   View User's Profile U2U Member Reply With Quote

quote:
Originally posted by VisibleMan
also

Thitdnumber - Inputbox ("please enter another number") should be Thitdnumber = Inputbox ("please enter another number")


sorry that was a typo lol
M2RTY
Member

Registered: 25th May 01
User status: Offline
12th Jun 04 at 10:49   View User's Profile U2U Member Reply With Quote

quote:
Originally posted by VisibleMan
and

Dim Total as single = Dim Total as integer cheers, got this 1

Cnst Max = 5 should be Const Max = 5 cheers, got this 1

also, wtf does this function do? and where does the Max const come in? Its just a load of bollocks which doesnt do alot by the looks of it lol
M2RTY
Member

Registered: 25th May 01
User status: Offline
12th Jun 04 at 10:50   View User's Profile U2U Member Reply With Quote

quote:
Originally posted by VisibleMan
Dim First number as integer = Dim Firstnumber as integer cheers, got this 1

Private Sub cmdAdding click () = Private Sub cmdAdding click() same thing?????????????????????????

For I = 1 to 8 do = For I = 1 to 8 cheers, got this 1


Theres no End If before the End Sub



Paul_J
Member

Registered: 6th Jun 02
Location: London
User status: Offline
12th Jun 04 at 12:06   View User's Profile U2U Member Reply With Quote

quote:
Thitdnumber - Inputbox ("please enter another number")
Result = total / Thirdnumber


Surely its Thirdnumber and not Thitnumber??

Also where has Thirdnumber been declared and initialised?? I see Dim First and Dim second but no third.
M2RTY
Member

Registered: 25th May 01
User status: Offline
12th Jun 04 at 12:08   View User's Profile U2U Member Reply With Quote

quote:
Originally posted by Paul_J
quote:
Thitdnumber - Inputbox ("please enter another number")
Result = total / Thirdnumber


Surely its Thirdnumber and not Thitnumber??

Also where has Thirdnumber been declared and initialised?? I see Dim First and Dim second but no third.


yep i need 2 declare it

do all the declared bits need to go BEFORE the private sub starts or AFTER? at the mo it has 2 before and 2 after

 
New Topic

New Poll

Corsa Sport » Message Board » Off Day » short VB code help.... 22 database queries in 0.0131700 seconds