![]() |
|
||||||||||
|
|||||||
|
|
« Предыдущая тема | Следующая тема » |
| Опции темы | Опции просмотра |
|
![]() |
|
|||||
|
Не могу сообразить как правильно описать подобную структуру:
function TRecordSet(fields)
{
this.fields = fields;
this.fieldCount = this.fields.length;
this.recordCount = 0;
this.records = [];
}
TRecordSet.prototype.AddRecord = function(records)
{
for(var i = 0; i < this.fieldCount; i++)
{
this.records[this.recordCount][this.fields[i] ] = records[i];
}
this.recordCount++;
}
rs = new TRecordSet(["name", "city"])
rs.AddRecord("Oleg","Dnepropetrovsk");
trace(rs[0].name);
trace(rs[0].city);
trace(rs[0].name); trace(rs[0].city); получаю undefined undefined А как бы мне вот так вот, чтобы все-таки trace(rs[0].name); trace(rs[0].city); и получалось Oleg Dnepropetrovsk Большое спасибо.
__________________
Я не любопытный и хитрый, а любознательный и сообразительный! |
![]() |
Часовой пояс GMT +4, время: 17:56. |
|
|
« Предыдущая тема | Следующая тема » |
|
|