Forum > FPC development

Case with string in Delphi mode

(1/2) > >>

Okoba:
I can not find any option or switch to activate this option in Delphi mode. Is there one or can be one? I am using some Delphi only options (like the lighter generic syntax) so I prefer to remain with the Delphi mode for now.

--- 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";}};} ---program Project1; {$MODE Delphi} var  V: String;begin  V := 'A';  case V of    'A': ;    'B': ;  end;end.    

Jonas Maebe:
No, it cannot be enabled in Delphi mode (nor in TP or MacPas modes).

Okoba:
Pity.
Thanks.

wp:
The {$MODE} directive is per unit. So, if you somehow can concentrate all your "case string of" stuff in a separate unit you can use {$MODE objfpc}{$H+} there and {$MODE Delphi} elsewhere.

Okoba:
Yes, but the problem of being in two modes keeps getting bigger and bigger.
Not having 'operator' in Delphi mode, or keep forcing them to write generic/specialize everywhere.
To be clear, I am not writing Delphi compatible code, but I like to have the lighter syntax of generics in the FPC mode, as in a heavy-generic code, generic/specialize makes everything seem more complicated than it really is. Also, in the coming of implicit generics, it would be much better to utilize generics in a light syntax.

Navigation

[0] Message Index

[#] Next page

Go to full version