I figured it out. GetDCIValueByName is able to return table objects, so it's quite simple:
sub main()
{
table = GetDCIValueByName($node, $event->parameters[1]);
if (table == null)
{
return "[GetDCIValueByName(" . $node->name . ", " . $event->parameters[1] . ") failed.]";
}
colNum = 1;
alertMsg = table->get($event->parameters[4], colNum);
if (alertMsg == null)
{
return "[table->get(" . $event->parameters[4] . ", " . colNum . ") failed.]";
}
return alertMsg;
}