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

 
 
Опции темы Поиск в этой теме Опции просмотра
Старый 22.11.2004, 12:25   #1  
Greggy_imported is offline
Greggy_imported
Участник
Аватар для Greggy_imported
 
291 / 10 (1) +
Регистрация: 24.09.2004
Здравствуйте!
Подскажите - есть ли в Навижн стандартные средства - нужно окно со строкой ввода.
Старый 22.11.2004, 12:31   #2  
Dzemon is offline
Dzemon
Moderator
 
1,247 / 12 (3) ++
Регистрация: 09.09.2004
Переменная типа Dialog
d.INPUT
Use this function to read what a user enters into a field in a window. The system returns the input in a variable. This function also returns a number which identifies the next input field in the window.

NewControlID := d.INPUT([ControlID] [,Variable])
Старый 22.11.2004, 12:36   #3  
rootadmin is offline
rootadmin
Участник
Аватар для rootadmin
 
224 / 10 (1) +
Регистрация: 25.03.2003
Адрес: Москва
Dialog использовать можно, но какой-то кривоватый он. Кстати, попутно вопрос - у меня не получилось просто или действительно там нет кнопки ОК?
Если бы не эта досадная мелочь - отсутствие кнопок Да, Нет, Ок и т.д. в различных сочетаниях - то можно использовать
__________________
С уваженем,
rootadmin
Старый 22.11.2004, 13:06   #4  
Dzemon is offline
Dzemon
Moderator
 
1,247 / 12 (3) ++
Регистрация: 09.09.2004
В диалоге действительно нет кнопки Ок ;-) Но у него есть одна полезная кнопка "Отмена", которая реально прерывает выполнение модуля.

Для кнопок ДА/НЕТ есть
CONFIRM
Use this function to create a dialog box which prompts the user for a yes or no answer. The system centers the dialog box on the screen for you.

Ok := CONFIRM(String [, Default] [, Value1] ,...)

Для вариантов выбора есть
STRMENU
Use this function to create a menu window that displays a series of options.

OptionNumber := STRMENU(OptionString [, DefaultNumber])
Старый 22.11.2004, 13:19   #5  
Greggy_imported is offline
Greggy_imported
Участник
Аватар для Greggy_imported
 
291 / 10 (1) +
Регистрация: 24.09.2004
Странно - что то наверное я не так делаю - мне выдает
The dialog window is not open.
Старый 22.11.2004, 13:49   #6  
Dzemon is offline
Dzemon
Moderator
 
1,247 / 12 (3) ++
Регистрация: 09.09.2004
Сначала его нужно открыть: d.OPEN('Введите штоньть #1########');
Потом запросить ввод: d.INPUT(1,Var);
А потом закрыть d.CLOSE (если надо)
Старый 22.11.2004, 13:54   #7  
Greggy_imported is offline
Greggy_imported
Участник
Аватар для Greggy_imported
 
291 / 10 (1) +
Регистрация: 24.09.2004
на счет того что открыть - я понял но вот какой номер контрола задавать и как его узнать у меня на любые номера выдает
The form does not recognize the control 1.
Старый 22.11.2004, 13:56   #8  
Dzemon is offline
Dzemon
Moderator
 
1,247 / 12 (3) ++
Регистрация: 09.09.2004
А вот #1######## и есть обозначение Контрола с номером. Читайте хелп или документацию ;-)
Старый 22.11.2004, 13:59   #9  
Greggy_imported is offline
Greggy_imported
Участник
Аватар для Greggy_imported
 
291 / 10 (1) +
Регистрация: 24.09.2004
Мне на самом деле стыдно перед Вами - но я прочитал две книжки Объекты и спесификацию языка CAL но в них таких тонкостей нет насколько я помню - где взять то документацию
Старый 22.11.2004, 14:28   #10  
Dzemon is offline
Dzemon
Moderator
 
1,247 / 12 (3) ++
Регистрация: 09.09.2004
Дык хелп родной:
d.OPEN
Use this function to open a dialog window.

d.OPEN(String [, Variable1], ...)
d

Data type: dialog

Once you define this variable, you can open the dialog and then use other dialog functions.

String

Data type: text constant or code

This string contains the text you want the system to display in the window. Use a back slash (\) to start a new line. Use pound signs (#) to insert variable values into the string, Place the pound signs where you want the system to substitute the variable value.

If you use @ characters instead of #, the string can be used as an indicator. In this case, use @ characters only for the string, and let the variable be an integer. The limits of the indicator are 0 and 9999 - meaning that the integer you use for updating the indicator should have a value within this range.

Place a number in the part of the string where a variable value will be substituted (as, for example, #1####) in order to be able to reference this field for updating.

You can update the fields using the d.UPDATE or d.INPUT functions or by letting the user edit the values.

Variable1

Data type: any

Use these optional parameters to specify variables for field1, field2, and so on.

Comments
Dialog windows opened by an object are closed when the object terminates.

Dialog windows are automatically sized to hold the longest line of text and the total number of lines.

Example
This example shows how to use the d.OPEN function.

AccountInfo := Text000 +
Text001;
AccNo := 5634;
TotSum := 1000;
d.OPEN(AccountInfo, AccNo, TotSum);
// Opens a window with '#'-fields for Account no. and Total
d.UPDATE(); // Update the fields
d.CLOSE()

Create the following text constants in the C/AL Globals window:

Text Constant
ENU Value

Text000
'Account no. #1######,\'

Text001
'shows a total of $ #2######'


The system will open the dialog window and show this text:

Account no. 5634
shows a total of $ 1000

This shows that the system has formatted the values of the variables AccNo and TotSum into the '#'-fields.
Старый 18.01.2005, 16:30   #11  
барбудас is offline
барбудас
Участник
 
55 / 10 (1) +
Регистрация: 30.09.2004
опять же, чтобы не создавать новую тему )))
а то кое-где отправляютЪ "в поиск" )))


из хелпа:
begin

CONFIRM
Use this function to create a dialog box which prompts the user for a yes or no answer. The system centers the dialog box on the screen for you.

Ok := CONFIRM(String [, Default] [, Value1] ,...)
Ok

Data type: boolean

This return parameter reflects the user's selection.

Ok will be...
If you entered...

TRUE
Yes

FALSE
No


String

Data type: code or text constant

The system displays this string in the dialog box. Use a back slash (\) to indicate a new line. The string can be a multilanguage enabled text constant.

Default

Data type: boolean

Describes what the computer should use as the default button. If you do not specify a default, the system uses No.

Comments
The system sizes the message window for you. The height of the window corresponds to the number of lines and the width corresponds to the length of the longest line.

Examples
In the following example, the dialog.CONFIRM function prompts the user for a Yes or No answer:

Question := Text000;

Answer := dialog.CONFIRM(Question, TRUE);

MESSAGE(Text001, Answer);

Create the following text constants in the C/AL Globals window:

Text Constant
ENU Value

Text000
'Leave without saving changes?'

Text001
'You selected %1.'

end




и ничего про [, Value1] ,... ....
кто сможет объяснить ЧТО ЭТО И ЗАЧЕМ?
__________________
извиняюсь если вопрос ТУП - спрашиваю исключительно потому, что не знаю. спасибо, что не послали
Старый 18.01.2005, 16:47   #12  
Likefire is offline
Likefire
Заноза в заднице
Аватар для Likefire
MCBMSS
Лучший по профессии 2009
 
547 / 50 (3) ++++
Регистрация: 22.10.2007
Адрес: Москва
Записей в блоге: 1
Value1..ValueN - текущие значения переменных, которые могут упоминаться в текстовой строке в виде: "%1..%N". Как в MESSAGE.
Типа: CONFIRM('Хотите ли перенести значение %1 в поле, содержащее значение %2, чтобы значение %3 не стало равным значению %4', TRUE, Item."Unit Cost", "Sales Line"."Unit Cost", "Purchase Line"."Unit Cost", "Value Entry"."Unit Cost");
Наглядно получилось?
__________________
Лень мудрого человека - это необходимое средство нейтрализации кипучей активности руководящих им дураков!
Старый 19.01.2005, 10:37   #13  
барбудас is offline
барбудас
Участник
 
55 / 10 (1) +
Регистрация: 30.09.2004
Наглядно ))) Спасибо )))
Я так и думал, но после сообщения

Цитата:
В диалоге действительно нет кнопки Ок ;-) Но у него есть одна полезная кнопка "Отмена", которая реально прерывает выполнение модуля.

Для кнопок ДА/НЕТ есть
CONFIRM
Use this function to create a dialog box which prompts the user for a yes or no answer. The system centers the dialog box on the screen for you.

Ok := CONFIRM(String [, Default] [, Value1] ,...)

питал какие-то нелепые иллюзии )))

Спасибо )))
__________________
извиняюсь если вопрос ТУП - спрашиваю исключительно потому, что не знаю. спасибо, что не послали
Старый 13.04.2007, 13:22   #14  
samonenko is offline
samonenko
Участник
 
21 / 10 (1) +
Регистрация: 19.06.2006
А есть ли стандартные диалоги для открытия окон для выбора имени файла? Нужно обеспечить пользователю удобный выбор имени файла для импорта.
Старый 13.04.2007, 13:43   #15  
apanko is offline
apanko
MCTS
MCBMSS
Лучший по профессии 2009
 
1,164 / 139 (7) +++++
Регистрация: 24.02.2005
Используйте Codeunit 412 Common Dialog Management

Функция OpenFile(Наименование Окна, Имя файла по умолчанию, Тип файла: ' ,Text,Excel,Word,Custom', Строка фильтра,Действие:Открыть, Сохранить)
Старый 13.04.2007, 13:48   #16  
samonenko is offline
samonenko
Участник
 
21 / 10 (1) +
Регистрация: 19.06.2006
Спасибо!
Старый 24.12.2007, 16:49   #17  
valek_imported is offline
valek_imported
Участник
 
3 / 10 (1) +
Регистрация: 24.12.2007
у меня нет 412 Codeunit
 

Опции темы Поиск в этой теме
Поиск в этой теме:

Расширенный поиск
Опции просмотра

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

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

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