AXForum  
Вернуться   AXForum > Microsoft Dynamics AX > DAX: Программирование
All
Забыли пароль?
Зарегистрироваться Правила Справка Пользователи Сообщения за день Поиск

 
 
Опции темы Поиск в этой теме Опции просмотра
Старый 07.08.2008, 14:34   #1  
kashperuk is offline
kashperuk
Участник
Аватар для kashperuk
MCBMSS
Соотечественники
Сотрудники Microsoft Dynamics
Лучший по профессии 2017
Лучший по профессии 2015
Лучший по профессии 2014
Лучший по профессии 2011
Лучший по профессии 2009
 
4,361 / 2084 (78) +++++++++
Регистрация: 30.05.2004
Адрес: Atlanta, GA, USA
Поправочка (спасибо mbelugin)
Map реализован как C++ container:
http://en.wikipedia.org/wiki/Map_(C%2B%2B_container)
Старый 07.08.2008, 14:53   #2  
MikeR is offline
MikeR
MCT
Аватар для MikeR
MCBMSS
Лучший по профессии 2015
Лучший по профессии 2014
 
1,628 / 627 (24) +++++++
Регистрация: 28.11.2005
Адрес: просто землянин
Цитата:
Сообщение от kashperuk Посмотреть сообщение
Поправочка (спасибо mbelugin)
Map реализован как C++ container:
http://en.wikipedia.org/wiki/Map_(C%2B%2B_container)
Хм прикольно.
То есть что то типа этого?
X++:
#include <iostream>
#include <map>
using namespace std;
 
int main()
{
        typedef map<char, int> mapType;
        mapType myMap;
 
        // insert elements using insert function
        myMap.insert(pair<char, int>('a', 1));
        myMap.insert(pair<char, int>('b', 2));
        myMap.insert(pair<char, int>('c', 3));
        myMap.insert(pair<char, int>('d', 4));
        myMap.insert(pair<char, int>('e', 5));
 
        // erase the first element using the erase function
        mapType::iterator iter = myMap.begin();
        myMap.erase(iter);
 
        // output the size of the map
        cout << "Size of myMap: " << myMap.size() << endl;
 
        cout << "Enter a key to search for: ";
        char c;
        cin >> c;
 
        // find will return an iterator to the matching element if it is found
        // or to the end of the map if the key is not found
        iter = myMap.find(c);
        if( iter != myMap.end() ) 
                cout << "Value is: " << iter->second << endl;
        else
                cout << "Key is not in myMap" << endl;
 
        // clear the entries in the map
        myMap.clear();
}
 

Похожие темы
Тема Автор Раздел Ответов Посл. сообщение
Denis Fedotenko: Себестоимость и закрытие склада Blog bot DAX: База знаний и проекты 44 29.03.2010 14:54
Kashperuk Ivan: List panels in Dynaics AX - a short description of SysListPanel class Blog bot DAX Blogs 1 21.10.2007 22:51
Kashperuk Ivan: Description of ClassBuild class:Today I want to ... Blog bot DAX Blogs 0 26.01.2007 05:51
Говорят вышел SP2 для Axapta 3. Кто нибуть что знает на эту тему? soin DAX: Прочие вопросы 10 13.10.2003 10:43

Ваши права в разделе
Вы не можете создавать новые темы
Вы не можете отвечать в темах
Вы не можете прикреплять вложения
Вы не можете редактировать свои сообщения

BB коды Вкл.
Смайлы Вкл.
[IMG] код Вкл.
HTML код Выкл.
Быстрый переход

Рейтинг@Mail.ru
Часовой пояс GMT +3, время: 15:04.
Powered by vBulletin® v3.8.5. Перевод: zCarot
Контактная информация, Реклама.