Forum > FPC development

"un"def Types

(1/2) > >>


is it possible to "un"def given Types ?
I would try to compile a system.pas unit, and the fpc compiler tells me,
that SmallInt is dupplicated.

Here is the line:
type Smallint = -32768..32767;

How can I "un"def SmallInt, if exists, and when yes, then re-type it.

Thanks for reading

You can't because SmallInt is an internal type provided by the compiler itself.

What is your purpose?

Not for system unit. Elsewhere, you can override it while still referring to the system unit one by fully qualified name. The compiler has internal type definitions (about 8 or so) that cannot be changed without changing the compiler (system unit alone is not enough).

You could redefine the type so that it cannot be used.

--- Code: Pascal  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---type Smallint = record end; var a: Smallint; begin  a := 3; // compile time errorend;


[0] Message Index

[#] Next page

Go to full version