SE_SUBD;Subdivisoes do Estoque;sys_tbbrow; 8;5;18;75;padrao;;
:SKEL
VARIAVEL bNomeDivisao := {|cSubd| nCodDiv:=Val(Left(cSubd,2)), Se_Divis->(DbGoto(nCodDiv),dDesc) }
VARIAVEL zFgDivOpen:= select('se_divis')>0
COMANDO ANTES znil:=if(!zFgDivOpen,(abra_arq('se_divis'),DbSelectArea('se_subd')),'')
COMANDO SAIDA znil:=if(!zFgDivOpen.and.select('se_divis')>0,se_divis->(DbCloseArea()),'')
//T;abrev;C;x;  1;;
:TBFI
Div;Left(SDCOD,2);C;xx; 3;;
Divisao;eVal(bNomeDivisao,SdCod);C;@S20;20;;
Subd;SDCOD;C;xxxx;  4;;
Subdivisao;SDDESC;C;@s30;30;;