Showing posts with label Conversion. Show all posts
Showing posts with label Conversion. Show all posts

Constants, Data Type Conversion, Visual Basic Built-in Functions

Constants are named storage locations in memory, the value of which does not change during program Execution. They remain the same throughout the program execution. When the user wants to use a value that never changes, a constant can be declared and created. The Const statement is used to create a constant. Constants can be declared in local, form, module or global scope and can be public or private as for variables. Constants can be declared as illustrated below.

Public Const gravityconstant As Single = 9.81

Predefined Visual Basic Constants
The predefined constants can be used anywhere in the code in place of the actual numeric values. This makes the code easier to read and write.   LEARN MORE >>>>>

Math & Conversion Functions

These functions are used for various algebric and trignometric operations:
1. abs()
The function abc() calculates the absolute vlaue of an integer. The argument to this function is an integer. It has a prototype in the header file math.h
2. fabs()
The function fabs() returns the absolute value of an argument. The argument to this function is a number of type float or double. It has a prototype in the header file math.h LEARN MORE>>