Skip to content

StringListCompact function #1639

@KVonGit

Description

@KVonGit

Currently, we have ListCompact and ObjectListCompact. After using ListCompact on a string list, it becomes a list with no assigned type.

This is what I've been using:

  <function name="StringListCompact" parameters="lst" type="stringlist">
    typ = TypeOf(lst)
    if (not typ = "stringlist") {
      error ("StringListCompact: invalid list type (" + typ + ")")
    }
    l = NewStringList()
    foreach (o, lst) {
      if (not Equal(o, null)) {
        if (IndexOf(l, o) = -1) {
          list add (l, o)
        }
      }
    }
    return (l)
  </function>

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions