PslTransString.Property

Returns an internal or a custom property of the string.

Syntax

Expression.Property (Name as Variant) as Variant

Expression Object of type PslTransString

Name Name of the property. One of the predefined values below or a custom name. If the macro sets a new value, the property name must be between 10000 and 19999 or start with "M:" (see below)

Predefined values are:

  • pslPropClass (Value = -7): Class of the string
  • pslPropExstyle (Value = -9): Extended style bits.
  • pslPropStyle (Value = -8): Style bits.
  • pslPropMaxLength (Value = -33): Max. length of translation string.
  • pslPropMatchRate (Value = -42): If the string has been translated automatically using fuzzy matches, this is the match rate, otherwise it's 0.
  • pslPropMaxLines (Value = -53): Max. number of lines for translation string

Source

Each translation string contains two sets of custom properties, one from the source string and one "translated" version. The Property returns the "translated" version. To query the source version, use PslTransString.SourceProperty.

Custom Properties

Custom Properties can be defined by parser add-ins, a macro or the user. All properties are in the same list, so they all can be accessed. To distinguish the types, different property names are used. When setting a property the macro is responsible for using the correct name, otherwise the property may be removed when updating string lists.

TypeInteger NameString Name
Add-In properties1 - 9999No prefix
Macro properties10000 - 19999Uses prefix "M:"
User-defined properties20000 - 30000Uses prefix "U:"

Example

Dim i As Long
Dim selcount As Long

Dim trndisp As PslTransDisplay
Set trndisp = PSL.ActiveTransDisplay
If Not trndisp Is Nothing Then
  selcount = trndisp.StringCount(pslSelection)
  For i = 1 To selcount
    t.Property(10001) = "abc"
    t.Property("M:myprop") = "def"
  Next i
End If