tabnr

Hey

trying to use tabnr() in the textport to get the number of rows in a table. I keep getting this response. What am I doing wrong?

touch → tabnr(“/project1/cues/select2”)
Textport (line 0 - ): Unknown command: tabnr
touch →
touch → `tabnr(“/project1/cues/select2”)
Textport (line 0 - ): Unknown command: 5
touch →

Cheers,
Adam

Since tabnr is an expression you need to use backticks like you are in you’re second rowline. However in that line it’s trying to execute the returned value from that expression(‘5’), so you want to use ‘echo’ infront of the expression to print out it’s value.
That’s the difference between a command and an expression. A command does an action and possibly prints something out to the textport. An expression only ever returns a value. It’ll never print anything on it’s own and it’ll never change anything to do with the state of the file. It’s always just a query.

Thanks Malcom. I got it to work with

tabnr(“dats/egTable”)

in a constant CHOP… I feel like I already tried that exact thing already… It was late at night so perhaps that had something to do with it :slight_smile:

Right, when you are putting an expression into a parameter that expects a number, you don’t need backticks. When it’s going into a parameter that expects a string, then you need backticks.