Page 1 of 1

Para Manuel Mercado - TSBROWSE Valid()

Posted: Mon Mar 17, 2008 12:51 pm
by MGA
Sr. Manuel Mercado:

ADD COLUMN TO oBrw TITLE "Vend" DATA FieldWBlock("codvend",select()) SIZE 50 EDITABLE 3DLOOK FALSE, TRUE, TRUE ALIGN DT_CENTER, DT_CENTER, DT_CENTER PICTURE "999";
COLORS CLR_BLACK, bColor MOVE DT_MOVE_NEXT;
valid {|uvar| TSvalidaVend803(@uVar,obrw)}; <-- @ NO FUNCIONA?!
WHEN IF(!EMPTY(saipro->codpro),.T.,.F.)



uVar teve seu valor alterado pela função TSVALIDAVEND803, como fazer uVar receber o novo valor?

Grato

Posted: Mon Mar 17, 2008 5:03 pm
by MGA
Sr. Manuel, resolvi assim:


ADD COLUMN TO oBrw TITLE "Vend" DATA saipro->codvend SIZE 50 EDITABLE 3DLOOK FALSE, TRUE, TRUE ALIGN DT_CENTER, DT_CENTER, DT_CENTER PICTURE "999";
COLORS CLR_BLACK, bColor MOVE DT_MOVE_NEXT;
valid {|uVar| TSvalidaVend803(uVar,oBrw)};
WHEN IF(!EMPTY(saipro->codpro),.T.,.F.) TOOLTIP "Informe o código do vendedor"

*******************************************
static function TSvalidaVend803(uBuffer,obrw)
*******************************************
if pesquisaven(@uBuffer,.t.)
saipro->perccom := PercComTabpre(arqsai->codfil, saipro->codpro, 1, uBuffer)
saipro->codvend := uBuffer
else
Return(.f.)
endif
obRW:refresh()
obRW:setfocus()
RETURN(.t.)


Porem, é a maneira correta????


Grato Sr. Manuel