In many programming language is necessary to declare which kind of variable will be used. The examples are:

  • INT = round numbers;
  • DOUBLE = decimal numbers;
  • BOOL = only true or false values;
  • STRING = any type of value understood as a text.

These are the mainly types of variables. Is good for the understanding that others values also can be used. The fact is that, in many cases, a variable already declared cannot simply just receive another type of value.

On the languages inside the plataform .NET for example, all the variables already declared need to receive the values suitable with your kind. Check the example out:

int num = 0;
num = “1”;

On the code above, the compiler won’t be able to read or process this information. It will be necessary to convert the informed value in a round number so the variable won’t have your value altered to 1.

int num = 0;
num = Convert.ToInt32(“1”);

Analyzing the code block above, realize that now the variable won’t be able to receive the round number 1, because the information will be converted by the “Convert” class present firstly on the C# .NET  language. This class, inclusive, offers others conversion methods, not only the round numbers methods.

Even so this is a basic item, errors related to variable conversion are very common and need to be proofread. That’s why it is worthwhile always being attentive to the implemented source code. A language such as PHP and JavaScript does not have this need. Even so, is necessary analyze the code and review any error that can be caused by a error related to the variable.

You might also like…

PROCESAMIENTO AJAX EN SCRIPTCASE

Ajax en los formularios de Scriptcase puede usarse para recargar un campo de tipo de select basado e...

IMPORTAR IMAGENES DE LA BASE DE DATOS Y UTILIZAR CLASES DE BOOSTRAP

Como muchas personas ya saben, Bootstrap es una biblioteca de front-end libre y de código abierto p...

TENDENCIAS DE DESARROLLO WEB PARA 2017

Usted verá en este post tendencias para 2017 en Diseño Web, en el medio digital y en el desarrollo...

Comment this post

Get new posts, resources, offers and more each week.

We will use the information you provide to update you about our Newsletter and Special Offers. You can unsubscribe any time you want by clinck in a link in the footer of any email you receive from us, or by contacting us at sales@scriptcase.net. Learn more about our Privacy Police.