Autor Thema: declare variables  (Gelesen 5679 mal)

0 Mitglieder und 1 Gast betrachten dieses Thema.

Offline shooter

  • Jr. Member
  • **
  • Beiträge: 70
  • Shooting Fuzzy temperatures
    • ICQ Messenger - 60155180
    • Profil anzeigen
    • E-Mail
declare variables
« am: 20. Februar 2011, 19:50:50 »
i would like to opt for declare variables for some as i see a lot of 0.0 and 1.0 in the lib.
o would like to put them as
zero : real:=0.0;
one : real:=1.0;
hundred :real:=100.0;
etc

inside a function declare them, this to avoid calc errors with int and real all over the place.
or global

the place where is a discussion i would like to have here.
so just vote for local inside a function or function block or global.

Offline hugo

  • Global Moderator
  • *****
  • Beiträge: 2 150
    • Profil anzeigen
Re:declare variables
« Antwort #1 am: 20. Februar 2011, 21:43:09 »
why would you expect calculation errors if we declare the variables differently? using number constants is leading to exactly the same result, while the compiler is doing the job.