473,414 Members | 1,598 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,414 software developers and data experts.

VB Beginner - Questions

Const Pi as Double

Would you consider Double to be a Variable? And what does Double mean?
What is its purpose?
Jun 27 '08 #1
9 1314
"Euvin" <ju********@us.army.milschrieb:
Const Pi as Double

Would you consider Double to be a Variable? And what does Double mean?
What is its purpose?
'As <type>' specifies the type of the variable/constant. A
variable/constant of a certain type can only contain a value of this type.
In the example above 'Double' is a type, not a variable.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>

Jun 27 '08 #2
On Apr 13, 12:06*am, Euvin <juan.eu...@us.army.milwrote:
Const Pi as Double

Would you consider Double to be a Variable? And what does Double mean?
What is its purpose?
Double is a type and "Pi" is variable in your sample whose value is
usually accepted as "3.14". Purpose of declaring "Pi" As Double based-
on getting pi number with decimal / floating point part. If you
declare it as integer, you won't get any decimals,only you can get 3.
That's the point of double.

Regards,

Onur Güzel
Jun 27 '08 #3
I am having problems posting questions here. i have posted the same
question several times. it says that my posting was succesful, but i
do not see it.
anyone care to tell me what is going on

Jun 27 '08 #4
What is an operator? Could you give me an example of an operator?
Anyone!

Jun 27 '08 #5
Dim FirstNum, SecondNum As String double

I would like to an addition type to this statement, such as <double>
How would I write that? I tried to add a comma, but that didnt work.
Jun 27 '08 #6
Posts don't necessarially appear immediately after you make them. It can
take a while for the news server to update.
"Euvin" <ju********@us.army.milwrote in message
news:5d**********************************@b1g2000h sg.googlegroups.com...
>I am having problems posting questions here. i have posted the same
question several times. it says that my posting was succesful, but i
do not see it.
anyone care to tell me what is going on

Jun 27 '08 #7
An operator is a symbol that tells the compiler what kind of operation you
wish to perform. Operators vary from language to language, but in VB some
of the more common ones are:

+ (mathmatical addition)
- (mathmatical subtraction)
/ (mathmatical division)
* (mathmatical multiplication)
& (String concatenation)
= (assignment or equality test)
< (less than)
(greater than)
<= (less than or equal to)
>= (greater than or equal to)
<(not equal to)

With all due respect, this and your other question are very elementary
questions, and there is nothing wrong with that (you've got to learn this
stuff sometime), but you might find it extremely helpful if you pick up an
introductory book on programming concepts as well as try a Google search on
terms like variable and operator before posting. You may find that you can
get your answer faster that way.

Of course, if you get stuck, feel free to post.

-Scott

"Euvin" <ju********@us.army.milwrote in message
news:9e**********************************@59g2000h sb.googlegroups.com...
What is an operator? Could you give me an example of an operator?
Anyone!

Jun 27 '08 #8
You can't declare variables of different types on one line together. You'll
need a new line for that:

Dim a, b As String
Dim c As Double

-Scott

"Euvin" <ju********@us.army.milwrote in message
news:c6**********************************@a70g2000 hsh.googlegroups.com...
Dim FirstNum, SecondNum As String double

I would like to an addition type to this statement, such as <double>
How would I write that? I tried to add a comma, but that didnt work.

Jun 27 '08 #9
Hello Euvin,

An operators are (same as in math) +, -, *, /, =.
There are some additional operators you might need which are "And",
"Or", "AndAlso", "OrElse" and "&".

Example (math):

Dim Variable As Integer 'Here the value is automatically assigned to 0.
Variable = 1 + 2

"Variable" will contain the value 3.
Example "And":
Dim Variable1 As Boolean = True
Dim Variable2 As Boolean = False
Dim Result As Boolean

Result = Variable1 And Variable2

"Result" will be False. It can only be True if both Variable1 AND
Variable2 are True.

The truth table is like this:
Variable1 Variable2 Result
False False False
True False False
False True False
True True True
Example "Or":
Dim Variable1 As Boolean = True
Dim Variable2 As Boolean = False
Dim Result As Boolean

Result = Variable1 Or Variable2

"Result" will be True, if either Variable1 OR Variable2 is True.

The truth table is like this:
Variable1 Variable2 Result
False False False
True False True
False True True
True True True

"AndAlso" and "OrElse" are also "And" and "Or" operators, but with a
difference:

AndAlso will only check the next value if the first one matched the
criterion. If it does not, the next values will not be evaluated.

Dim Value1 As Integer = 1
Dim Value2 As Integer = 2
If Value1 = 1 AndAlso Value2 = 2 Then
MsgBox ("Match")
'Will be shown.
End If

Dim Value3 As Integer = 3
If Value2 = 3 AndAlso Value3 = 3 Then
MsgBox ("Match")
'Will not be shown
End If

You could replace the AndAlso operator with this:
If Value2 = 3 Then
If Value3 = 3 Then
MsgBox("Match")
End If
End If

OrElse does exactly the opposite: If a value does not match, it will
check the next value.

Dim Value1 As Integer = 1
Dim Value2 As Integer = 2

If Value1 =3 OrElse Value2 = 2 Then
MsgBox("Match")
'Will be shown
End If

Best regards,

Martin

Am 13.04.2008 07:17, schrieb Euvin:
What is an operator? Could you give me an example of an operator?
Anyone!
Jun 27 '08 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Atip Asvanund | last post by:
Dear sirs, I am trying to learn how to use Boehm's garbage collector: http://www.hpl.hp.com/personal/Hans_Boehm/gc/ on a Linux machine. I am a beginner, and I find its documentation inadequate....
7
by: Rensjuh | last post by:
Hello, does someone have / know a good C++ tutorial for beginnners? I would prefer Dutch, but English is also fine. Hoi, heeft / kent iemand nog een goede C++ tutorial voor beginners? Het liefste...
15
by: Pelle Beckman | last post by:
Hi all, I have a few newbie questions: In function declaration what does a 'const' mean inside the parameter list ? That it won't modify the value? void MemberFunction(const int x);
12
by: Sathyaish | last post by:
Please forgive my nescience. I have worked extensively on Win32 but I am only familiar with C and C++. Lately, I have been practicing C from K&R. Here 're a few doubts I have written in the...
27
by: MHoffman | last post by:
I am just learning to program, and hoping someone can help me with the following: for a simple calculator, a string is entered into a text box ... how do I prevent the user from entering a text...
3
by: GoCoogs | last post by:
Is there a beginner VB.NET newsgroup or forum? I don't want to make you all laugh or take up your time with my "two weeks into VB.NET" questions. Thanks a lot -Blake
6
by: Qun Cao | last post by:
Hi Everyone, I am a beginner on cross language development. My problem at hand is to build a python interface for a C++ application built on top of a 3D game engine. The purpose of this python...
1
by: Robert J. Bonn | last post by:
I'm trying to set up a contact list in MS Access 97. I've looked through a reference book and the program's help screens, but the light bulb isn't quite coming on for me. If one of you could take...
10
by: See_Red_Run | last post by:
Hi, I am trying to figure out how to get started with PHP/MySQL. Everything I've read so far says to start with PHP first. I was expecting something like Visual Basic Express or some other type...
22
by: ddg_linux | last post by:
I have been reading about and doing a lot of php code examples from books but now I find myself wanting to do something practical with some of the skills that I have learned. I am a beginner php...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.