#Inline static lookup table/array

1 messages · Page 1 of 1 (latest)

dull topaz
#

If you create a global array that is not placed, then it is accessible everywhere and it wont show on the pattern data window.. You can define constant variables, but not arrays of them afaik. For example:

u8 Array[10];

Array[0] = 10;
Array[1] = 21;
.
.
.
dull topaz
#

by inline do you mean something like this?

Array[10] = {10,20,....};

If so, I don't know of any way. There is no syntax for arrays of literals.

  You can define constant variables, but not arrays of them afaik.
#

constant variables are read only

#

for example:

import std.io;

const u8 a;
a=2;
a=3; // Runtime Error! cant assign to const

std::print("{}",a);

const u8 A[2];
A[0] = 2;
A[0] = 3; // No error
std::print("{}",A);