Page 1 of 1

Stage 100-108: Character datatype removed (for now)

Posted: Thu Jun 15, 2023 6:12 am
by frank
Due to lack of time I have not been able to work on the compiler for some time, but I intend to continue as planned.

In this stage, the character datatype has been (temporarily) removed because of too much complexity in conjunction with the string datatype. Since SharpBASIC has fixed length strings, this shouldn't be much of a miss.

A bug has been removed with string concatenation.

A random number generator function (rnd) has been added. Unlike other BASIC languages, it generates a dword integer, or with argument an unsigned integer between 0 and max:

Code: Select all

incl "lib/sys.sbi";

dim n: int;
dim m: uint;

main do

  ' random integer
  n = rnd();
  print(n);

  ' random unsigned integer 1-9
  m = rnd(8)+1;
  print(m);

end