The main thread:
open window w_dtopos30 at 2,2 with form "dtenrguia" attribute(border)
call display_msg_dtopos(5)
call dtopos_l_leitura_nro_guia(ordem,"R"
close window w_dtopos30
call display_msg_dtopos(0)
-----------------------------------------------------------
#=========================================
function dtopos_l_leitura_nro_guia(ordem,tipopos)
#=========================================
define ordem smallint,
tipopos char(1) #Tipo de posicao
define tipodes char(9), #Tipo Descricao (E)ntrega, (R)ecolha, (D)evolucao, (A)r
rasto
nro_guia like dtpedido.pe_guia,
serie like dtpedido.pe_serieg,
ckdigit smallint,
posicao smallint, #No. do registo
tipo_ol char(1),
msg char(80)
let tipo_ol =tipopos
let nro_guia=null
let serie =null
let ckdigit =null
let posicao =Linha_c
while true
let tipodes =dtopos_tipodes(tipopos)
let int_flag=false
whenever error continue
input by name tipopos, tipodes, serie, nro_guia, ckdigit without defaults
before field tipopos
if tipo_ol is not null then
next field serie
end if
if nro_guia is not null or serie is not null then
next field serie
end if
after field tipopos
let tipodes=dtopos_tipodes(tipopos)
display by name tipodes
end input
if int_flag then exit while end if
whenever error call prt_error
-----------------------------------------------------------
int_flag is true when the user presses DEL (to cancel). This is when the application crashes.