| Новости | FAQ | Авторы | Документация | В действии | Библиотека |
| Инструменты | Полезные ссылки | Хостинги | Скачать | Примеры | Форум |
MadCow 06.08.2007 18:04
В файле FeedAbstract.p есть метод###########################################################################
@getType[uValue]
^if($uValue is "string"){
$result[string]
}{
^if($uValue is "date"){
$result[date]
}{
^if($uValue is "int"){
$result[int]
}{
^if($uValue is "double"){
$result[double]
}{
^if($uValue is "bool"){
$result[bool]
}{
^if($uValue is "hash"){
$result[hash]
}{
^if($uValue is "table"){
$result[table]
}{
^if($uValue is "ArrayList"){
$result[ArrayList]
}{
$result[]
}
}
}
}
}
}
}
}
#end @getType[]мне кажется, что тут "традиционнее" использовать ^switch[] или ^return[] чтобы не было вложенностей$result[^switch(true){
^case($uValue is "string"){string}
^case($uValue is "date"){date}
^case($uValue is "int"){int}
...
^case[DEFAULT]{}
}]