powered by simpleCommunicator - 2.0.61     © 2026 Programmizd 02
Целевая тема:
Создать новую тему:
Автор:
Закрыть
Цитировать
Форумы / FoxPro, Visual FoxPro [игнор отключен] [закрыт для гостей] / объясните про .Null.
7 сообщений из 7, страница 1 из 1
объясните про .Null.
    #34670094
k_a_t_e
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Гость
Код: plaintext
1.
2.
SET NULLDISPLAY TO ''
THISFORM.Grid1.COlumn4.ControlSource = "STR(abonent.ndom,3) + abonent.cdom"
Если abonent.cdom имеет некоторое значение, то получаем результат типа 4А. А если он NULL строка пуста. Необходимо чтобы в этой строке отображался abonent.ndom
...
Рейтинг: 0 / 0
объясните про .Null.
    #34670108
Фотография Aleksey-K
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Участник
THISFORM.Grid1.COlumn4.ControlSource = [STR(abonent.ndom,3) + NVL(abonent.cdom, '')]

С уважением, Алексей
...
Рейтинг: 0 / 0
объясните про .Null.
    #34670170
k_a_t_e
Код: plaintext
1.
2.
SET NULLDISPLAY TO ''
THISFORM.Grid1.COlumn4.ControlSource = "STR(abonent.ndom,3) + abonent.cdom"
Если abonent.cdom имеет некоторое значение, то получаем результат типа 4А. А если он NULL строка пуста. Необходимо чтобы в этой строке отображался abonent.ndom
FoxPro Help
SET NULLDISPLAY Command
See Also

Specifies the text displayed for null values.

Syntax

SET NULLDISPLAY TO [cNullText]

Arguments

cNullText

Specifies the text that is displayed for null values. If cNullText is omitted, the default null value text, .NULL., is restored and displayed for null values.

Remarks

By default, Visual FoxPro displays .NULL. for null values in objects, Browse windows, DISPLAY output, LIST output, and so on. Use SET NULLDISPLAY to change the default null value text to a different character string. SET NULLDISPLAY changes the default null value text for all objects for which the NullDisplay property is the empty string.

Use the NullDisplay property to change the default null value text to a different character string for an individual object.

Таким образом, эта команда ником образом не влияет на содержимое полей, только на вывод их на экран. По-моему, надо использовать:
FoxPro Help
NVL( ) Function
Example See Also

Returns a non-null value from two expressions.

Syntax

NVL(eExpression1, eExpression2)

Returns

Character, Date, DateTime, Numeric, Currency, Logical, or the null value

Arguments

eExpression1, eExpression2

NVL( ) returns eExpression2 if eExpression1 evaluates to a null value. NVL( ) returns eExpression1 if eExpression1 is not a null value. eExpression1 and eExpression2 may be any data type. NVL( ) returns .NULL. if both eExpression1 and eExpression2 both evaluate to the null value.

Remarks

Use NVL( ) to remove null values from calculations or operations where null values are not supported or are not relevant.

Ваш фрагмент надо будет написать:
Код: plaintext
1.
2.
* SET NULLDISPLAY TO ''
THISFORM.Grid1.COlumn4.ControlSource = "STR(abonent.ndom,3) + NVL(abonent.cdom,'')"
...
Рейтинг: 0 / 0
объясните про .Null.
    #34670211
k_a_t_e
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Гость
Следущий текст выдает ошибку sintax error:
Код: plaintext
1.
2.
3.
4.
5.
6.
7.
thisform.Grid1.RecordSource = 'SElect Distinct abonent.clic_schet,abonent.cfio,ulitsa.ctext,STR(abonent.ndom,3)+ NVL(abonent.cdom,'') , '+;
							'abonent.nkvartira,domtip.ctext,normativ.ctext,isschet.ctext1 '+;
							"FROM abonent LEFT JOIN ulitsa ON abonent.nulitsaid = ulitsa.nulitsaid"+;
							"LEFT JOIN domtip ON abonent.ndomtip = domtip.ndomtip "+;
							"LEFT JOIN normativ ON abonent.ndomtip = normativ.ndomtip "+;
							"LEFT JOIN isschet ON abonent.n_nal_sch=isschet.isschet "+;
							"INTO CURSOR  me NOFILTER order by abonent.clic_schet"
может ошибку не вижу, помогите плиз
...
Рейтинг: 0 / 0
объясните про .Null.
    #34670280
k_a_t_e
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Гость
Спасибо всем, сама нашла ошибку (одинаковые скобки) - все заработало.
...
Рейтинг: 0 / 0
объясните про .Null.
    #34670281
k_a_t_eСледущий текст выдает ошибку sintax error:
Код: plaintext
1.
2.
3.
4.
5.
6.
7.
thisform.Grid1.RecordSource = 'SElect Distinct abonent.clic_schet,abonent.cfio,ulitsa.ctext,STR(abonent.ndom,3)+ NVL(abonent.cdom,'') , '+;
							'abonent.nkvartira,domtip.ctext,normativ.ctext,isschet.ctext1 '+;
							"FROM abonent LEFT JOIN ulitsa ON abonent.nulitsaid = ulitsa.nulitsaid"+;
							"LEFT JOIN domtip ON abonent.ndomtip = domtip.ndomtip "+;
							"LEFT JOIN normativ ON abonent.ndomtip = normativ.ndomtip "+;
							"LEFT JOIN isschet ON abonent.n_nal_sch=isschet.isschet "+;
							"INTO CURSOR  me NOFILTER order by abonent.clic_schet"
может ошибку не вижу, помогите плиз
Легко...
Конкретно ошибка в строке:
'SElect Distinct abonent.clic_schet,abonent.cfio,ulitsa.ctext,STR(abonent.ndom,3)+ NVL(abonent.cdom,'') , '+;
Интерпретатор ее распознает как:
'SElect Distinct abonent.clic_schet,abonent.cfio,ulitsa.ctext,STR(abonent.ndom,3)+ NVL(abonent.cdom,'
и ') , '
Надо использовать разные "кавычки" обрамляющие строку (пусть будут одинарные) и "внутренние" (те которые внутри функции NVL, можно сделать их двойными).
...
Рейтинг: 0 / 0
объясните про .Null.
    #34670889
прошелмимо
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Участник
2 k_a_t_e

делать нужно так, а то глазки сломаете

Код: plaintext
1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
12.
text to thisform.Grid1.RecordSource noshow textmerge pretext  15 
	SElect Distinct a.clic_schet, a.cfio,u.ctext, STR(a.ndom, 3 )+ NVL(a.cdom,'') , 
		a.nkvartira, d.ctext, n.ctext, i.ctext1 
		FROM abonent a
			LEFT JOIN ulitsa u ON a.nulitsaid = u.nulitsaid
			LEFT JOIN domtip  d ON a.ndomtip = d.ndomtip 
			LEFT JOIN normativ n ON a.ndomtip = n.ndomtip
			LEFT JOIN isschet i ON a.n_nal_sch=i.isschet
		INTO CURSOR  me 
		NOFILTER 
		order by abonent.clic_schet
endtext
...
Рейтинг: 0 / 0
7 сообщений из 7, страница 1 из 1
Форумы / FoxPro, Visual FoxPro [игнор отключен] [закрыт для гостей] / объясните про .Null.
Найденые пользователи ...
Разблокировать пользователей ...
Читали форум (0):
Пользователи онлайн (0):
x
x
Закрыть


Просмотр
0 / 0
Close
Debug Console [Select Text]