String Parameters

When you declare routines that take short-string parameters, you cannot include length specifiers in the parameter declarations. That is, the declaration procedure Check(S: string[20]); // syntax error causes a compilation error. But type TString20 = string[20]; procedure Check(S: TString20);

is valid. The special identifier OpenString can be used to declare routines that take short-string parameters of varying length:

procedure Check(S: OpenString);

When the {$h} and {$p+} compiler directives are both in effect, the reserved word string is equivalent to OpenString in parameter declarations.

Short strings, OpenString, $h, and $p are supported for backward compatibility only. In new code, you can avoid these considerations by using long strings.

Project Management Made Easy

Project Management Made Easy

What you need to know about… Project Management Made Easy! Project management consists of more than just a large building project and can encompass small projects as well. No matter what the size of your project, you need to have some sort of project management. How you manage your project has everything to do with its outcome.

Get My Free Ebook


Post a comment