Methods that return a value are allowed in tags. They can be used anywhere that uses tags i.e. mimics, logic, OPC. The arguments to the method are server-side expression, so to read a variable cell from a data grid, you could use:

".Data.GetCellValue( "".RowNum.Value"", 1 )"

where RowNum is a variable containing the row number to read from the Data Grid named "Data".

Using two double quotes escapes them, so a single double quote will be passed to the server. The argument expressions in this case will be ".RowNum.Value" and 1. I believe relative tags in this case are relative to the object the method is being called on. So here, the relative reference .RowNum is looking for a location relative to the data grid, not the mimic from which it was called.

Indirect expressions would also work here:

['.Data.GetCellValue(' + STR( ".RowNum.Value" ) + ',1)']

Without the STR, the indirect tag expression contains an error as you can't concatenate strings with numbers. You need to wrap the number in STR(). As a hint, if ever an indirect tag isn't working, try creating a text box with the indirect tag inner expression (without []) on the Value property and see if it gives the tag you are expecting.

Its debatable which is more efficient. The first is probably the best option as then tags aren't removed & added whenever RowNum changes.