DataType

# PString

<div class="rst-class">

forsearch

</div>

DataType

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

## Description

A "Pascal" string, typically used only with Mac OS 9. The first byte is the length of the string; as a result, it is limited to 255 characters. You can pass a regular `String</api/data_types/string>` to it and it will be converted to a <span class="title-ref">PString</span> automatically. Also, <span class="title-ref">PString</span> does an implicit type conversion to `String</api/data_types/string>` when you assign a <span class="title-ref">PString</span> to a `String</api/data_types/string>` variable.

## Notes

There may be legacy macOS APIs that make use of this data type, but otherwise it should be avoided.

## Compatibility

|                       |     |
|-----------------------|-----|
| **Project Types**     | All |
| **Operating Systems** | All |

<div class="seealso">

`Declare</api/language/declare>` statement

</div>
