PRAAT create string array and search in that array

138 Views Asked by At

It seems like an easy task (and is easy in other languages), but Im having trouble finding a solution.

Is it possible to create an array of strings? I'm looking for a PRAAT equivalent of the following python code

options=["a","b","cd"]

The ultimate goal is to do something like

Input=["ab","cd","ef"]
for InputEle in Input
    if InputEle is in options
        do blah
    endif
endfor
1

There are 1 best solutions below

0
matfra On

You could use a string vector:

options$# = {"a", "b", "cd"}
for i from 1 to 3
   appendInfoLine: options$# [i]
endfor

Check out section 8 at https://www.fon.hum.uva.nl/praat/manual/Scripting_5_7__Vectors_and_matrices.html