Page 1 of 1

help to make a condition

Posted: Sat Oct 12, 2024 9:41 pm
by Silvio.Falconi
Insert a code block

I have
sample nLastRecords:= 2000

IF nLastRecords > 0
nInit:=olotto:lastrec()-nLastRecords
nEnd:= olotto:lastrec()
ENDIF


and I must insert this on a codeblock

bFor:= { || recno() <= nInit .and. recno() >= nEnd }

but make error

Re: help to make a condition

Posted: Sun Oct 13, 2024 2:05 am
by nageswaragunupudi
This is working for me here

Code: Select all | Expand

#include "fivewin.ch"

REQUEST DBFCDX

function Main()

   local bFor, aData
   local nStart, nLast

   USE CUSTOMER NEW SHARED VIA "DBFCDX"

   nStart   := 100
   nLast    := 110

   bFor  := { || RECNO() >= nStart .AND. RECNO() <= nLast }
   aData := FW_DbfToArray( "ID,FIRST,SALARY", bFor )
   XBROWSER aData

return nil
 

Re: help to make a condition

Posted: Mon Oct 14, 2024 6:03 am
by Silvio.Falconi
nageswaragunupudi wrote:This is working for me here

Code: Select all | Expand

#include "fivewin.ch"

REQUEST DBFCDX

function Main()

   local bFor, aData
   local nStart, nLast

   USE CUSTOMER NEW SHARED VIA "DBFCDX"

   nStart   := 100
   nLast    := 110

   bFor  := { || RECNO() >= nStart .AND. RECNO() <= nLast }
   aData := FW_DbfToArray( "ID,FIRST,SALARY", bFor )
   XBROWSER aData

return nil
 
Thanks