Click here to Skip to main content
15,921,577 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralProblem about Animation Pin
ngjeffy24-Mar-04 22:31
ngjeffy24-Mar-04 22:31 
GeneralRe: Problem about Animation Pin
Nadroj25-Mar-04 18:54
Nadroj25-Mar-04 18:54 
GeneralProblem with RequiredFieldValidator Pin
Aizupis24-Mar-04 21:55
Aizupis24-Mar-04 21:55 
Generalshortening my code Pin
ibok2324-Mar-04 15:08
ibok2324-Mar-04 15:08 
GeneralRe: shortening my code Pin
Nadroj24-Mar-04 17:52
Nadroj24-Mar-04 17:52 
GeneralRe: shortening my code Pin
Dave Kreskowiak25-Mar-04 1:07
mveDave Kreskowiak25-Mar-04 1:07 
GeneralRe: shortening my code Pin
ibok2325-Mar-04 3:21
ibok2325-Mar-04 3:21 
GeneralRe: shortening my code Pin
Wayne Phipps25-Mar-04 4:10
Wayne Phipps25-Mar-04 4:10 
ibok23 wrote:
Private additionalguest as double = ((nudguest.text - 2) * 10) * Val(numberofdays.text)) [I have an error on the last parenthesis - It says end of statement expected.]

You have to many parenthesis here, count the oppening and closing brackets, there should be one closing bracket ")" for each opening bracket "(".

I Think the code should be..
Private additionalguest as double = ((nudguest.text - 2) * 10) * Val(numberofdays.text)

Nadroj wrote:
since you have declared additionalguest as a private variable, it can only be accessed in the method it is defined

Nadroj is quite write, you cannot access the variable outside the code block in which you declared. From the code snipet you posted, we cannot see if you are doing this.

Have you tried declaring it a as class variable?

EG

Public Class myClass<br />
<br />
Private additionalguest as double<br />
<br />
'..other class declarations, methods etc<br />
<br />
Private Sub CalcCharges<br />
    additionalguest = ((nudguest.text - 2) * 10) * Val(numberofdays.text)<br />
<br />
    if nudguest.text > 2 then additionalguestcharge.text = additionalguest<br />
End Sub



Hope this helps


Regards

Wayne Phipps
____________

Time is the greatest teacher... unfortunately, it kills all of its students
LearnVisualStudio.Net

GeneralRe: shortening my code Pin
Dave Kreskowiak25-Mar-04 4:11
mveDave Kreskowiak25-Mar-04 4:11 
GeneralRe: shortening my code Pin
ibok2325-Mar-04 4:25
ibok2325-Mar-04 4:25 
GeneralRe: shortening my code Pin
Dave Kreskowiak25-Mar-04 4:37
mveDave Kreskowiak25-Mar-04 4:37 
GeneralRe: shortening my code Pin
Wayne Phipps25-Mar-04 4:49
Wayne Phipps25-Mar-04 4:49 
GeneralRe: shortening my code Pin
ibok2325-Mar-04 4:59
ibok2325-Mar-04 4:59 
GeneralData Bound ComboBox Formatting Pin
Karsten.Habay@skynet.be24-Mar-04 10:43
Karsten.Habay@skynet.be24-Mar-04 10:43 
GeneralCD Audio Extraction Pin
RobReid24-Mar-04 10:41
RobReid24-Mar-04 10:41 
GeneralRe: CD Audio Extraction Pin
Dave Kreskowiak24-Mar-04 11:05
mveDave Kreskowiak24-Mar-04 11:05 
GeneralRe: CD Audio Extraction Pin
RobReid24-Mar-04 11:33
RobReid24-Mar-04 11:33 
GeneralRe: CD Audio Extraction Pin
Dave Kreskowiak24-Mar-04 12:04
mveDave Kreskowiak24-Mar-04 12:04 
GeneralRe: CD Audio Extraction Pin
RobReid24-Mar-04 12:25
RobReid24-Mar-04 12:25 
QuestionHow to pull a field from a Dataset??? Pin
hounetdev24-Mar-04 9:36
hounetdev24-Mar-04 9:36 
AnswerRe: How to pull a field from a Dataset??? Pin
Pugzley24-Mar-04 17:46
Pugzley24-Mar-04 17:46 
AnswerRe: How to pull a field from a Dataset??? Pin
Pradeep C24-Mar-04 19:11
Pradeep C24-Mar-04 19:11 
GeneralRe: How to pull a field from a Dataset??? Pin
hounetdev25-Mar-04 7:12
hounetdev25-Mar-04 7:12 
GeneralCurrency Pin
ibok2324-Mar-04 6:33
ibok2324-Mar-04 6:33 
GeneralRe: Currency Pin
Steve S24-Mar-04 6:44
Steve S24-Mar-04 6:44 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.