Sign in Join
FPDoc Onlineexperiment

strpas function

In unit Strings

Convert a null-terminated string to a shortstring.

Declaration

pascal
function strpas(p: PAnsiChar): shortstring

Description

Converts a null terminated string in P to a Pascal string, and returns this string. The string is truncated at 255 characters.

Errors

None.

See also

Example: ex3

pascal
Program Example3;

Uses strings;

{ Program to demonstrate the StrPas function. }

Const P : PChar = 'This is a PCHAR string';

var S : string;

begin
  S:=StrPas (P);
  Writeln ('S : ',S);
end.

An experiment, built from development snapshots. Not the official Free Pascal or Lazarus documentation.