problem with get

problem with get

Postby kajot » Sun Jun 22, 2008 6:20 pm

why the variable cNR in GET is not equal to the variable which return function daj_nr()

DEFINE DIALOG oDlg FROM 0,0 to 180*2.05,200*2.05 PIXEL ;
TITLE If( lAppend, "Nowy", "Modyfikacja" ) FONT oFont


k1:=10
k2:=50
mn:=2.05

@ 10, k1 SAY "&Typ:" OF oDlg PIXEL
@ 10, k2 GET cTyp picture '!' when lAppend valid(eval({|| cNR:=daj_nr(cTYP), cTYP $ 'S_W'})) OF oDlg SIZE 10,12 PIXEL
@ 25, k1 SAY "&Nr:" OF oDlg PIXEL
@ 25, k2 GET cNr picture '99999' when lAppend OF oDlg PIXEL
@ 40, k1 SAY "&Nazwa:" OF oDlg PIXEL
@ 40, k2 GET cNazwa picture replicate('!',40) OF oDlg PIXEL
@ 55, k1 SAY "&Opis:" OF oDlg PIXEL
@ 55, k2 GET cOpis picture replicate('!',40) OF oDlg PIXEL
@ 70, k1 SAY "&Nr ew:" OF oDlg PIXEL
@ 70, k2 GET cNr_ew picture 'XXXXXXXXXXXXXXX' OF oDlg PIXEL
@ 85, k1 SAY "&Nr zak:" OF oDlg PIXEL
@ 85, k2 GET cNr_zak picture '99999' OF oDlg PIXEL
@100, k1 SAY "&Użytkownik:" OF oDlg PIXEL
@100, k2 GET cUZYTKOW picture replicate('!',40) OF oDlg PIXEL
@115, k1 SAY "&Ilość:" OF oDlg PIXEL
@115, k2 GET cIlosc_sk picture '999' OF oDlg PIXEL
@130, k1 SAY "&Cena:" OF oDlg PIXEL
@130, k2 GET cCena picture '999,999,999.99' OF oDlg PIXEL



@160, 60 BUTTON "&Rezygnacja" OF oDlg SIZE 50, 12 PIXEL ACTION oDlg:End()
@160, 120 BUTTON "&Zapis" OF oDlg SIZE 50, 12 PIXEL ACTION ( lSave := .T., oDlg:End() )


ACTIVATE DIALOG oDlg CENTER


//----------------------------------------------------------------------------//
static function daj_nr(cTYP)
local NR_:=0

dbsetorder(1)
dbseek(cTYP,.f.,.t.)
NR_:=nr+1

return NR_
//---------------------------------------------------------------------------//
best regards
kajot
User avatar
kajot
 
Posts: 339
Joined: Thu Nov 02, 2006 6:53 pm
Location: Poland

Postby Detlef Hoefner » Sun Jun 22, 2008 9:26 pm

kajot,

please, try like this
Code: Select all  Expand view  RUN

...
...
@ 10, k2 GET oTyp picture '@!';
         when lAppend;
         valid if( cTyp $ "S_W",;
                  ( cNr := daj_nr( cTYP ), oNr:Refresh(), .t. ),;
                   .f. )
         OF oDlg SIZE 10,12 PIXEL

@ 25, k1 SAY "&Nr:" OF oDlg PIXEL
@ 25, k2 GET oNr VAR cNr picture '99999' when lAppend OF oDlg PIXEL
...
...

regards,
Detlef
User avatar
Detlef Hoefner
 
Posts: 312
Joined: Sat Oct 08, 2005 9:12 am
Location: Germany

Postby kajot » Mon Jun 23, 2008 3:20 pm

Thanks, is OK
best regards
kajot
User avatar
kajot
 
Posts: 339
Joined: Thu Nov 02, 2006 6:53 pm
Location: Poland


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot] and 53 guests