Var-string checking

 

Type                   Switch

Syntax               {$V+} or {$V-}

{$VARSTRINGCHECKS ON} or {$VARSTRINGCHECKS OFF}

Default               {$V+}

{$VARSTRINGCHECKS ON}

Scope                Local

 

Remarks

The $V directive is meaningful only for code that uses short strings (see Long strings compiler directive), and is provided for backwards compatibility with earlier versions of Delphi and Borland Pascal.

The $V directive controls type checking on short strings passed as variable parameters. In the {$V+} state, strict type checking is performed, requiring the formal and actual parameters to be of identical string types. In the {$V-} (relaxed) state, any short string type variable is allowed as an actual parameter, even if the declared maximum length is not the same as that of the formal parameter.

 

Compiler directives (list)