t-edson / P65Pas

CPU 6502 Pascal Compiler/IDE/Debugger
GNU General Public License v3.0
120 stars 27 forks source link

init variables from an unit #20

Closed mvdhoning closed 4 years ago

mvdhoning commented 4 years ago

i have a unit called LibScreen where i define a list of colors like so

var
  Black      : byte = 0;
  White     : byte = 1;
//etc

but that gives a compile error: Cannot initialize absolutie variable "Black" in this location when compiling the main application

using a const and not specifying the type gives an application that crashes at runtime.

so what is a neat way to keep declarations like these in a unit and not in the main application

thanks for your answer in advance

mvdhoning commented 4 years ago

nevermind using const works fine with version 0.7.3 (it did not with 0.7.1)