Files
MBS/PROYECTOS/otrodir - 21102021/cuentasContables.4gl
T

53 lines
1.2 KiB
Plaintext

GLOBALS
DEFINE criterio_cta,selec_cta STRING,
idx_cta,curr1_cta INT
DEFINE cuentas1 DYNAMIC ARRAY OF RECORD
cuenta_no VARCHAR(14),
descripcion VARCHAR(14),
nivel SMALLINT
END RECORD
END GLOBALS
FUNCTION busca_cuenta()
OPEN WINDOW cons_cuenta AT 10,5 WITH FORM "cgfmwd004" ATTRIBUTE
(BORDER,FORM LINE FIRST + 1,COMMENT LINE LAST)
CONSTRUCT BY NAME criterio_cta ON descripcion
IF int_flag THEN
CALL msg(2)
RETURN
END IF
LET selec_cta =
"SELECT cuenta_no,descripcion,nivel FROM cgtb00001 ",
"WHERE ",criterio_cta clipped," AND status_t is null ORDER BY 1"
PREPARE comando FROM selec_cta
DECLARE busca2 CURSOR FOR comando
OPEN busca2
LET idx_cta = 1
WHILE STATUS != NOTFOUND
FETCH busca2 INTO cuentas1[idx_cta].*
IF status = notfound THEN
EXIT WHILE
END IF
LET idx_cta = idx_cta + 1
END WHILE
IF int_flag THEN
CALL msg(2)
RETURN
END IF
CALL set_count (idx_cta - 1)
DISPLAY ARRAY cuentas1 TO s_cuentas.*
LET curr1_cta = arr_curr()
IF int_flag THEN
CALL msg(2)
RETURN
END IF
CLOSE WINDOW cons_cuenta
END FUNCTION