Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Custom type for ShortString #4

Open
plicease opened this issue Jan 30, 2015 · 1 comment
Open

Custom type for ShortString #4

plicease opened this issue Jan 30, 2015 · 1 comment

Comments

@plicease
Copy link
Member

http://stackoverflow.com/questions/20177412/long-strings-in-pascal

@plicease
Copy link
Member Author

plicease commented Feb 8, 2015

consider:

Program Foo;

Function MyFunction(I:Integer):ShortString;
Begin
  MyFunction := 'hi there';
End;

Var
  MyString : ShortString;

Begin
  MyString := MyFunction(2);
  MyString[0] := #2;
  WriteLn(MyString);
End.

When you return a ShortString ... who free's the memory for it? Or is it static? or something else?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

1 participant