Page 9 of 10
Re: Questions of zero level
Posted: Wed Jul 11, 2012 12:56 pm
by Eugene Lutsenko
You couldn't prompt how to make, that color of the text in one field depended on value of other field? From the text provided below a fragment clearly that I wanted to make, but this option works incorrectly (why - that irrespective of value of the field Korr the field Histogram is always displayed by dark blue color).
Code: Select all
/* Create browse-2: БД Rsp1k.dbf, связанная отношением "Один ко многим" с БД Rso_Zag.dbf*/
DCSETPARENT TO
@2, 33 DCBROWSE oBrowKor ALIAS 'Rsp1k' SIZE 100,12.0 ;
PRESENTATION DC_BrowPres() ; // Только просмотр БД
NOSOFTTRACK ;
SCOPE ;
ITEMMARKED bItems
DCSETPARENT oBrowKor
DCBROWSECOL FIELD Rsp1k->Kod_Cls HEADER 'Код' WIDTH 5
DCBROWSECOL FIELD Rsp1k->Name_cls HEADER 'Наименование класса' WIDTH 25
DCBROWSECOL FIELD Rsp1k->Korr HEADER 'Сходство' WIDTH 6
DCBROWSECOL FIELD Rsp1k->Fakt HEADER 'Факт' WIDTH 1
DO CASE
CASE Rsp1k->Korr > 0
DCBROWSECOL FIELD Rsp1k->Histogram HEADER 'Сходство' WIDTH 21 COLOR GRA_CLR_RED
CASE Rsp1k->Korr = 0
DCBROWSECOL FIELD Rsp1k->Histogram HEADER 'Сходство' WIDTH 21 COLOR GRA_CLR_BLACK
CASE Rsp1k->Korr < 0
DCBROWSECOL FIELD Rsp1k->Histogram HEADER 'Сходство' WIDTH 21 COLOR GRA_CLR_BLUE
ENDCASE
DCBROWSECOL FIELD Rsp1k->Date HEADER 'Дата' WIDTH 10
DCBROWSECOL FIELD Rsp1k->Time HEADER 'Время' WIDTH 8
/* Create browse-3: БД Rsp1i.dbf, связанная отношением "Один ко многим" с БД Rso_Zag.dbf*/
Re: Questions of zero level
Posted: Wed Jul 11, 2012 11:54 pm
by Wolfgang Ciriack
Hi,
if you do it in this way, the color has the value at creation time.
Change it to a colorblock, which change the color at runtime.
Code: Select all
local bColorBlock:={|| iif(Rsp1k->Korr>0,{GRA_CLR_RED,nil},iif(Rsp1k->Korr=0,{GRA_CLR_BLACK,nil},{GRA_CLR_BLUE,nil})) }
DCBROWSECOL FIELD Rsp1k->Fakt HEADER 'Факт' WIDTH 1
DCBROWSECOL FIELD Rsp1k->Histogram HEADER 'Сходство' WIDTH 21 COLOR bColorBlock
DCBROWSECOL FIELD Rsp1k->Date HEADER 'Дата' WIDTH 10
Re: Questions of zero level
Posted: Thu Jul 12, 2012 2:41 am
by Eugene Lutsenko
Many thanks! You very much help me. I tried to make it in the different ways, but it turned out nothing, and your decision earned at once how it is necessary, as was conceived.
![Image](http://lc.kubagro.ru/Dima/p4132.jpg)
I like the tool more and more and it is pleasant what the result turns out. In general I on these tools simply enjoy development and I was very lucky that it still is necessary and for work (teaching and scientific work)
Re: Questions of zero level
Posted: Thu Jul 12, 2012 6:59 am
by Cliff Wiernik
Also, it is more complex, but you can do similar things with DCGETs. But in this case, you need to be concerned about focus colors/out of focus colors and whether or not you use the COLORGETS DCGETOPTIONS clause.
We have used this extensively. The key is using codeblocks.
I have examples of how we do it.
Re: Questions of zero level
Posted: Fri Jul 13, 2012 5:15 am
by Eugene Lutsenko
No, I didn't reach yet before about what you speak but when I will reach - if I will not understand itself, I will surely ask. It is very good that there are sympathetic people, and it is even better that they not simply sympathetic, but professionals. I am very grateful to you and placed information on gratitude for your support in the section "About system" big system developed by me.
By the way, whether there is a possibility to display in DCBROWSECOL pseudo-graphic ASCII symbols, for example CHR (177) or CHR (219)? And that was necessary to display histograms a symbol "|".
Re: Questions of zero level
Posted: Fri Jul 13, 2012 8:04 pm
by Eugene Lutsenko
Somebody couldn't prompt how to correct the mistake of execution arising in attempt of creation of a database:
Code: Select all
FUNCTION GenDbfDostMod()
********* Создать БД Dost_mod.dbf и ее индексные массивы
cFileName := "Dost_mod"
aStructure := { { "Type_model ", "С", 40, 0 }, ;
{ "Int_krit ", "С", 30, 0 }, ;
{ "Dost_ident ", "N", 19, 7 }, ;
{ "Dost_neident", "N", 19, 7 }, ;
{ "Dost_avr ", "N", 19, 7 }, ;
{ "Date ", "C", 10, 0 }, ;
{ "Time ", "C", 8, 0 } }
DbCreate( cFileName, aStructure, "DBFNTX" )
RETURN NIL
Thus the old checked CLIPPER-way works absolutely normally:
Code: Select all
****** Создаем файл структуры базы данных ****************
CREATE Struc
APPEND BLANK
REPLACE Field_name WITH "Type_model",;
Field_type WITH "C",;
Field_len WITH 40,;
Field_dec WITH 0
APPEND BLANK
REPLACE Field_name WITH "Int_krit",;
Field_type WITH "C",;
Field_len WITH 30,;
Field_dec WITH 0
APPEND BLANK
REPLACE Field_name WITH "Dost_ident",;
Field_type WITH "N",;
Field_len WITH 19,;
Field_dec WITH 7
APPEND BLANK
REPLACE Field_name WITH "Dost_neident",;
Field_type WITH "N",;
Field_len WITH 19,;
Field_dec WITH 7
APPEND BLANK
REPLACE Field_name WITH "Dost_avr",;
Field_type WITH "N",;
Field_len WITH 19,;
Field_dec WITH 7
APPEND BLANK
REPLACE Field_name WITH "Date",;
Field_type WITH "C",;
Field_len WITH 10,;
Field_dec WITH 0
APPEND BLANK
REPLACE Field_name WITH "Time",;
Field_type WITH "C",;
Field_len WITH 8,;
Field_dec WITH 0
****** Создаем базу данных **********************
CREATE Dost_mod FROM Struc
CLOSE ALL
ERASE Struc.dbf
But I would like to write programs more compactly and visually and to use possibility of creation of databases at a task of their structures in the form of two-dimensional massifs.
Re: Questions of zero level
Posted: Sat Jul 14, 2012 12:54 am
by hz_scotty
Code: Select all
DbCreate( cFileName, aStructure, "DBFNTX" )
first:
DbCreate( (cFileName), aStructure, "DBFNTX" )
second:
permissions ??
Re: Questions of zero level
Posted: Sat Jul 14, 2012 1:58 am
by skiman
Hi,
Sure the file doesn't exist by a previous test? Always check before dbcreate.
Re: Questions of zero level
Posted: Sat Jul 14, 2012 2:32 am
by Eugene Lutsenko
The created file before creation isn't present in the folder. But by experience I know that if it and is - that is recreated. And what permissions? Strange that other databases are quietly created by that program which I gave as an example, and this concrete base - No. I tried to change names of fields, to do them without gaps before quotes and so forth, it turns out nothing. And the old way with this base too doesn't work.
I thank.
Re: Questions of zero level
Posted: Sat Jul 14, 2012 3:35 am
by hz_scotty
hi
i make a copy of your source to my programm with "copy and paste"
the fieldtype of "type_model" and "Int_krit" was after paste "?" not "C" !!!!
please overwrite this two characters with "C" an test again
by me- the function create the DBF correct
![Clap :clap:](./images/smilies/eusa/clap.gif)