WackoWolf
Active member
Why is it when I try to make it a Const it gives me the error that "Expression Expected" when I try to muply? Here is my code, I am trying to do this the right way but am have problems. I can do it without useing a Const and it works, but I want to set things as Const. I get the error on the * part only. Please could someone explain what I am doing wrong and the right way to do it, I also want to do it to "Children.
Thank You
WackoWolf
Thank You
WackoWolf
VB.NET:
[SIZE=2][COLOR=#0000ff]Const[/COLOR][/SIZE][SIZE=2] Adult [/SIZE][SIZE=2][COLOR=#0000ff]As [/COLOR][/SIZE][SIZE=2][COLOR=#0000ff]Integer[/COLOR][/SIZE][SIZE=2] = 30
[/SIZE][SIZE=2][COLOR=#008000]
[/COLOR][/SIZE][SIZE=2][COLOR=#0000ff]Dim[/COLOR][/SIZE][SIZE=2] Children [/SIZE][SIZE=2][COLOR=#0000ff]As [/COLOR][/SIZE][SIZE=2][COLOR=#0000ff]Integer[/COLOR][/SIZE][SIZE=2] = 10
[/SIZE][SIZE=2][COLOR=#0000ff]Dim[/COLOR][/SIZE][SIZE=2] Night [/SIZE][SIZE=2][COLOR=#0000ff]As [/COLOR][/SIZE][SIZE=2][COLOR=#0000ff]Double
[/COLOR][/SIZE][SIZE=2][COLOR=#0000ff]Dim[/COLOR][/SIZE][SIZE=2] NightlyRate [/SIZE][SIZE=2][COLOR=#0000ff]As [/COLOR][/SIZE][SIZE=2][COLOR=#0000ff]Decimal
[/COLOR][/SIZE][SIZE=2][COLOR=#0000ff]Dim[/COLOR][/SIZE][SIZE=2] Total [/SIZE][SIZE=2][COLOR=#0000ff]As [/COLOR][/SIZE][SIZE=2][COLOR=#0000ff]Decimal[/COLOR][/SIZE]
[SIZE=2][COLOR=#0000ff]
[/COLOR][/SIZE][SIZE=2]TextAdult.Text * Adult
Children = (TextChildren.Text * Children)
Night = (Val(TextNight.Text))
NightlyRate = (Adult + Children) * Night
Total = (NightlyRate * 0.05) + NightlyRate
TextTotal.Text = FormatCurrency(Total)
[/SIZE]