Questions of zero level

This forum is for eXpress++ general support.
Message
Author
User avatar
Eugene Lutsenko
Posts: 1649
Joined: Sat Feb 04, 2012 2:23 am
Location: Russia, Southern federal district, city of Krasnodar
Contact:

Re: Questions of zero level

#81 Post 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*/

Wolfgang Ciriack
Posts: 479
Joined: Wed Jan 27, 2010 10:25 pm
Location: Berlin Germany

Re: Questions of zero level

#82 Post 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
_______________________
Best Regards
Wolfgang

User avatar
Eugene Lutsenko
Posts: 1649
Joined: Sat Feb 04, 2012 2:23 am
Location: Russia, Southern federal district, city of Krasnodar
Contact:

Re: Questions of zero level

#83 Post 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
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)

Cliff Wiernik
Posts: 605
Joined: Thu Jan 28, 2010 9:11 pm
Location: Steven Point, Wisconsin USA
Contact:

Re: Questions of zero level

#84 Post 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.

User avatar
Eugene Lutsenko
Posts: 1649
Joined: Sat Feb 04, 2012 2:23 am
Location: Russia, Southern federal district, city of Krasnodar
Contact:

Re: Questions of zero level

#85 Post 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 "|".

User avatar
Eugene Lutsenko
Posts: 1649
Joined: Sat Feb 04, 2012 2:23 am
Location: Russia, Southern federal district, city of Krasnodar
Contact:

Re: Questions of zero level

#86 Post by Eugene Lutsenko »

Somebody couldn't prompt how to correct the mistake of execution arising in attempt of creation of a database:
Image

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.

User avatar
hz_scotty
Posts: 107
Joined: Thu Jan 28, 2010 8:20 am
Location: Wr.Neustadt / Österreich

Re: Questions of zero level

#87 Post by hz_scotty »

Code: Select all

DbCreate( cFileName, aStructure, "DBFNTX" )
first:
DbCreate( (cFileName), aStructure, "DBFNTX" )

second:
permissions ??
best regards
Hans

skiman
Posts: 1185
Joined: Thu Jan 28, 2010 1:22 am
Location: Sijsele, Belgium
Contact:

Re: Questions of zero level

#88 Post by skiman »

Hi,

Sure the file doesn't exist by a previous test? Always check before dbcreate.
Best regards,

Chris.
www.aboservice.be

User avatar
Eugene Lutsenko
Posts: 1649
Joined: Sat Feb 04, 2012 2:23 am
Location: Russia, Southern federal district, city of Krasnodar
Contact:

Re: Questions of zero level

#89 Post 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.

User avatar
hz_scotty
Posts: 107
Joined: Thu Jan 28, 2010 8:20 am
Location: Wr.Neustadt / Österreich

Re: Questions of zero level

#90 Post 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" !!!! :naughty:
please overwrite this two characters with "C" an test again

by me- the function create the DBF correct :clap:
Last edited by hz_scotty on Sat Jul 14, 2012 7:44 am, edited 1 time in total.
best regards
Hans

Post Reply