Making editors for cricket games

RoboRocks said:
I keep getting this error

Drewska said:
Heres some.. started: Project: start Configuration: Debug ------
Performing main compilation...


c:\Documents and Settings\Owner\My Documents\SharpDevelop Projects\start\MainForm.cs(226,3): error CS0116: A namespace does not directly contain members such as fields or methods

Build complete -- 1 errors, 0 warnings

Do you think (Roborocks) that you could post the source code (highlight everything you typed in) and explain what you were trying to do? I don't think Drewskas error was fixed, so we don't know :help

Well done for having a go anyway mate.
 
This is what I typed in:
Public Class Form1

Private Sub cmddisplay_Click(ByVal senderAs system.Object, ByVale As System.EventArgs) Handles cmddisplay
Dim result As string
Select Case cbohowout.Text
Case "Bowled"
result = txtbatsmen.Text & " b " & txtbowler.Text & " " & txtruns.Text
Case "Caught"
result = txtbatsmen.Text & " c " & txtfielder.Text & " b " & txtbowler.Text & " " & txtruns.Text
Case "Caught and Bowled"
result = txtbatsmen.Text & " c & b " & txtbowler.Text & " " & txtruns.Text
Case "lbw"
result = txtbatsmen.Text & " lbw b " & txtbowler.Text & " " & txtruns.Text
Case "runout"
result = txtbatsmen.Text & " runout " & txtruns.Text
Case "stumped"
result = txtbatsmen.Text & " st " & txtfielder.Text & " b " & txtbowler.Text & " " & txtruns.Text
End Select
Messagebox.Show(Robs XI Scorecard)
End Sub

End Class
 
RoboRocks said:
This is what I typed in:

Thats strange. I have a suspicion that the two languages are different
Has anyone else had this problem with SharpDevelop? I would try this code myself, btu I don't have SharpDevelop, and I could really do without another development enviroment (already got 3).
Please? Anyone?
 
RoboRocks said:
I did the scorecard on express but nothing comes up when I run the form.

Have you put the codes in the proper places? They need to be in the clicked event of your button if you are trying to click on something to get scorecard.Unless you put the codes here or explain the problem we cant catch the exact problems.
 
Hi, I need some help. While doing someonline tuts, I come across a few exercised, problem is I dont know what to do :( , can you please help me?

Exercise

Put two textboxes on your form. The first box asks users to enter a start position for a For Loop; the second textbox asks user to enter an end position for the For loop. When a button is clicked, the programme will add up the numbers between the start position and the end position. Display the answer in a message box. You can use this For Loop code

For i = startNumber To endNumber

answer = answer + i

Next i

Get the startNumber and endNumber from the textboxes.


Exercise

Amend your code to check that the user has entered numbers in the textboxes. You will need an If statement to do this. If there's nothing in the textboxes, you can halt the programme with this code

Exit Sub

For this exercise, you will be passing whatever is in the textboxes to integer variables. It is these variables you are checking with your If Statement. Because numbers will be entered into the textboxes, remember to convert the text to a value with Val( ).

But the Text property will return a zero if the box is empty. So your If statement will need to check the variables for a value of zero. If it finds a zero, Then you can use the Exit Sub code. The If statement should come first, before the For Loop code.
 
abhishek_rox said:
Hi, I need some help. While doing someonline tuts, I come across a few exercised, problem is I dont know what to do :( , can you please help me?

Exercise

Put two textboxes on your form. The first box asks users to enter a start position for a For Loop; the second textbox asks user to enter an end position for the For loop. When a button is clicked, the programme will add up the numbers between the start position and the end position. Display the answer in a message box. You can use this For Loop code

For i = startNumber To endNumber

answer = answer + i

Next i

Get the startNumber and endNumber from the textboxes.

This one is already done for you,just put the two textboxes and enter the code for the clicked event.


abhishek_rox said:
Exercise

Amend your code to check that the user has entered numbers in the textboxes. You will need an If statement to do this. If there's nothing in the textboxes, you can halt the programme with this code

If Im write you need to just add this code(I might be wrong as I cant think properly atm and I havent touched vb.net for months)

Code:
if(startNumber)  //Does Vb.net even support braces,I forgot :p
{
For i = startNumber To endNumber

answer = answer + i

Next i
}
else 
ExitSub


I'll try the last one later,incase nobody replies.Prakash should be able to do this easily though.
 
Put two textboxes on your form. The first box asks users to enter a start position for a For Loop; the second textbox asks user to enter an end position for the For loop. When a button is clicked, the programme will add up the numbers between the start position and the end position. Display the answer in a message box. You can use this For Loop code

For i = startNumber To endNumber

answer = answer + i

Next i

Get the startNumber and endNumber from the textboxes.

The bolded part is what thats really confusing me, other if we just have to get the text, then its simple

Thanx for the help

For the second one, what should I write in front of 'If', to check whether something is written
 
Last edited:
abhishek_rox said:
Put two textboxes on your form. The first box asks users to enter a start position for a For Loop; the second textbox asks user to enter an end position for the For loop. When a button is clicked, the programme will add up the numbers between the start position and the end position. Display the answer in a message box. You can use this For Loop code

For i = startNumber To endNumber

answer = answer + i

Next i

Get the startNumber and endNumber from the textboxes.

The bolded part is what thats really confusing me, other if we just have to get the text, then its simple

Thanx for the help

Nothing too difficult to understand there.The start box has a number(say 1) and the End box has another(say 10).So the program adds the numbers up from 1 to 10(1+2+...+10) and stores the answer in the answer variable which is to be displayed in a MsgBox.
 
Oh i though it was between start number and end number like if numbers were 1 and 6 then 2+3+4+5

Thanx for your help, what about second exercise
 

Users who are viewing this thread

Top