RAD Studio (Common)
ContentsIndex
PreviousUpNext
Var-string checking (Delphi)
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 Delphi code that uses short strings, and is provided for backwards compatibility with early versions of Delphi and CodeGear 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.

Copyright(C) 2008 CodeGear(TM). All Rights Reserved.
What do you think about this topic? Send feedback!