Hi,
Please,how I can make this ?
I have in Clipper source field and header definitions in arrays, in eXpress I can only use headers, but fields break with error.
My source here:
SELECT 1
use datax index datax
* prku is names of database fields
* hrku is names of header columns
PUBLIC prku[3],hrku[3]
*DECLARE prku[3],hrku[3]
prku[1]="POR"
prku[2]="N_KATUZ"
prku[3]="K_KATUZ"
hrku[1]="Por.č."
hrku[2]="Názov k.ú."
hrku[3]="Kód k.ú."
@ 1,1 DCBROWSE oBrowse ;
SIZE 77,11.8 ;
CURSORMODE XBPBRW_CURSOR_ROW ;
ITEMSELECTED {||DC_ReadGuiEvent(DCGUI_EXIT_OK,GetList)}
DCBROWSECOL FIELD 1->POR ;
HEADER hrku[1] PARENT oBrowse
DCBROWSECOL FIELD 1->N_KATUZ ;
HEADER hrku[2] PARENT oBrowse
etc...
but I Want write some like this (in CA Clipper it run normally)
DCBROWSECOL FIELD 1->prku[1] ;
HEADER hrku[1] PARENT oBrowse
DCBROWSECOL FIELD 1->prku[2] ;
HEADER hrku[2] PARENT oBrowse
etc...
error is BASE/8027 Unknown symbor for database field...
I tryed @, &, before array name, but same error...
DCBROWSE field definitions in array
-
- Posts: 42
- Joined: Mon Dec 23, 2013 2:10 pm
- Contact:
Re: DCBROWSE field definitions in array
Hi,
Trying to use the following syntax :
DCBROWSECOL DATA {|| prku[1]}
HEADER hrku[1] PARENT oBrowse
Best regards,
Messaoud Mohamed Lazhar
Trying to use the following syntax :
DCBROWSECOL DATA {|| prku[1]}
HEADER hrku[1] PARENT oBrowse
Best regards,
Messaoud Mohamed Lazhar
Re: DCBROWSE field definitions in array
You also need to use the ALIAS parameter of dcbrowse.
Re: DCBROWSE field definitions in array
The below code is a sample program that will show you how to use array definitions for browsing a database.
Compile and run the program to see how it works.
Compile and run the program to see how it works.
Code: Select all
#INCLUDE "dcdialog.CH"
FUNCTION Main()
LOCAL GetList[0], GetOptions, oBrowse, aFields, i, cAlias
USE \exp19\data\Xtest
cAlias := Alias()
aFields := XTEST->(dbStruct())
@ 1,0 DCBROWSE oBrowse ALIAS cAlias SIZE 100, 20 ;
PRESENTATION DC_BrowPres() ;
FONT '9.Lucida Console'
FOR i := 1 TO Len(aFields)
DCBROWSECOL DATA DC_FieldWBlock(aFields[i,1],cAlias) ;
PARENT oBrowse HEADER aFields[i,1]
NEXT
DCREAD GUI FIT TITLE 'Browsing Database'
RETURN nil
PROC appsys ; RETURN
The eXpress train is coming - and it has more cars.
Re: DCBROWSE field definitions in array
Thanks ,
this running fine :
DCBROWSECOL DATA DC_FieldWBlock(pic[1],"1") WIDTH 10;
HEADER hic[1] PARENT oBrowse
where "1" is my "alias" of table, because I am using SELECT 1, SELECT 2,... numbers are aliases.
I do not like write names of field and headers anywhere, but I have it in header of function, where I have it on one place and with several function for example :
piv[1]="KN_PCS"
piv[2]="tucpopis(KN_TUC)"
piv[3]="substr(KN_VLA,1,50)"
...
Roger, I do not want browse every fields from table (table has many fields, but user do not need view all), I want browse only several important fields which user can see in one of dialogs.
this running fine :
DCBROWSECOL DATA DC_FieldWBlock(pic[1],"1") WIDTH 10;
HEADER hic[1] PARENT oBrowse
where "1" is my "alias" of table, because I am using SELECT 1, SELECT 2,... numbers are aliases.
I do not like write names of field and headers anywhere, but I have it in header of function, where I have it on one place and with several function for example :
piv[1]="KN_PCS"
piv[2]="tucpopis(KN_TUC)"
piv[3]="substr(KN_VLA,1,50)"
...
Roger, I do not want browse every fields from table (table has many fields, but user do not need view all), I want browse only several important fields which user can see in one of dialogs.
Re: DCBROWSE field definitions in array
It will only browse those which are in the array.Roger, I do not want browse every fields from table (table has many fields, but user do not need view all), I want browse only several important fields which user can see in one of dialogs.
The eXpress train is coming - and it has more cars.
-
- Posts: 147
- Joined: Thu Jan 28, 2010 9:24 am
- Location: Nitra, Slovakia
- Contact:
Re: DCBROWSE field definitions in array
Hi,
in one of the messages that I sent to your private e-mail in last weeks, also includes such examples
just carefully see attached examples there and try play with examples in demo and in eXpress’s help
aBrowse := { ;
{ 'PSČ', { || OBCE->PSC } }, ;
{ 'Obec', { || OBCE->OBEC } }, ;
{ 'Okres', { || OBCE->OKRES } }, ;
{ 'Kraj', { || OBCE->KRAJ } } ;
nMax := Len( aBrowse )
For ix := 1 To nMax
DCBROWSECOL DATA aBrowse[ ix, 2 ] HEADER aBrowse[ ix, 1 ] PARENT oBrowse
Next
Zdeno
in one of the messages that I sent to your private e-mail in last weeks, also includes such examples
just carefully see attached examples there and try play with examples in demo and in eXpress’s help
aBrowse := { ;
{ 'PSČ', { || OBCE->PSC } }, ;
{ 'Obec', { || OBCE->OBEC } }, ;
{ 'Okres', { || OBCE->OKRES } }, ;
{ 'Kraj', { || OBCE->KRAJ } } ;
nMax := Len( aBrowse )
For ix := 1 To nMax
DCBROWSECOL DATA aBrowse[ ix, 2 ] HEADER aBrowse[ ix, 1 ] PARENT oBrowse
Next
Zdeno
- Eugene Lutsenko
- Posts: 1649
- Joined: Sat Feb 04, 2012 2:23 am
- Location: Russia, Southern federal district, city of Krasnodar
- Contact:
Re: DCBROWSE field definitions in array
Or maybe choose a array of information only those fields that you want to display?