| Новости | FAQ | Авторы | Документация | В действии | Библиотека |
| Инструменты | Полезные ссылки | Хостинги | Скачать | Примеры | Форум |
tezro 26.05.2009 12:59
^MAIN:CLASS_PATH.menu{
^if(^exception.comment.pos[$MAIN:CLASS_PATH.path] > 0 && ^MAIN:CLASS_PATH.path.length[] > ^sLocatedPath.length[]){
$sLocatedPath[$MAIN:CLASS_PATH.path]
$sTrimmedPath[^exception.comment.mid(^exception.comment.pos[$MAIN:CLASS_PATH.path])]
^sTrimmedPath.match[(${sLocatedPath}.+)\((\d+)\:(\d+)\).*][g]{
$sExceptionFilePath[$match.1]
$iExceptionLine($match.2)
$iExceptionColumn($match.3)
}
}
}
^try{
# load the needed lines from file as table
$fExceptionFile[^file::load[text;$sExceptionFilePath]]
$tExceptionFile[^fExceptionFile.text.split[^#0A]]
$tNew[^table::create{lineNumber lineValue}]
^tExceptionFile.menu{
^tNew.append{^tExceptionFile.line[] $tExceptionFile.piece}
}
$tExceptionFile[^tNew.select(^tNew.line[] >= $iExceptionLine - 5 && ^tNew.line[] <= $iExceptionLine)]
# define just a file name
$sExceptionFile[^sExceptionFilePath.split[/;rh]]
$sExceptionFile[$sExceptionFile.0]
# print out
<h3>Lines $tExceptionFile.lineNumber&mdash^;^tExceptionFile.offset[set](-1)$tExceptionFile.lineNumber from &ldquo^;$sExceptionFile&rdquo^;</h3>
<table class="data">
^tExceptionFile.menu{
<tr class="^if(^tExceptionFile.offset[] % 2){even}{odd}^if(^tExceptionFile.line[] == ^tExceptionFile.count[]){ nb}">
<td class="number">$tExceptionFile.lineNumber</td>
<td class="center">
$sLine[$tExceptionFile.lineValue]
^sLine.match[\t][g]{<span class="tab">TAB</span>}¶^;
</td>
</tr>
}
</table>
}{
$exception.handled(1)
}