Clarion - Ultimo registro

 
Vista:

Ultimo registro

Publicado por Andrade (159 intervenciones) el 06/05/2013 22:38:25
Como me posesiono en el ultimo registro de mi tabla sin tener que recorrer toda la tabla. Gracias
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder

Ultimo registro

Publicado por ricardo net (1 intervención) el 09/05/2013 03:14:26
con el comando PREVIOUS algo asi

para SQL selec MAX(campo)
from archivo

esto es para TPS


GET(archivo,0) ! CLEAR PENDING RECORD
LOOP
CLEAR(arc:RECORD,1) !CLEAR RECORD TO HIGH VALUES
SET(arc:clave) ! POINT TO FIRST RECORD
PREVIOUS(archivo) !READ LAST KEY RECORD
IF ERROR() !IF THERE WAS AN ERROR
CLEAR(arc:RECORD) ! CLEAR THE RECORD
KEYFIELD# = 0 ! INTITIALIZE THE FIELD
IF KEYFIELD# = 0 THEN KEYFIELD# = 1.! IF ITS 0 MAKE IT 1
ELSE !ELSE
KEYFIELD# = arc:interno + 1 ! INCREMENT FIELD
break
. .
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar

Ultimo registro

Publicado por Hector (15 intervenciones) el 08/03/2015 03:39:34
Sera que nos podrias aclarar tu codigo amigo??.. me perdi, jeje..
normalmente hago asi

1
2
3
4
set(Tabla,Clave)
   loop until eof(Tabla)
          next(tabla)
   end

o si lo hago con parametros

1
2
3
4
5
Campo=Dato local o global
set(Tabla,Clave)
   loop until eof(Tabla)
          next(tabla)
   end

Pero es lento.. aveces hasta muy lento,. si hay una forma mas rapida seria genial...
Gracias...
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar