Files
harbour-core/harbour/tests/brwpos.prg
Viktor Szakats 6ef2986f43 2009-06-02 19:22 UTC+0200 Viktor Szakats (harbour.01 syenar hu)
* contrib/xhb/Makefile
  + contrib/xhb/bkgtsks.c
    + Added background tasks functions. My only current goal
      was to make it compile under Harbour, plus did some
      optimizations along the way.
      (borrowed from xhb, work of Francesco Saverio Giudice)
    ; TODO: Adapt to Harbour: MT mode, Set() replacement,
            attach it to VM possibly without modifying
            the VM itself.

  * source/rtl/mlcfunc.c
    + Reenabled for default builds the parameter extension
      in memo functions (now guarded with HB_C52_STRICT).
      This breaks our effort to not introduce such extensions,
      but since was no better idea I've made an exception,
      but I personally still don't like it and this practice
      stays forbidden.
      Talking about the last parameter of these functions:
      MEMOLINE(), MLCOUNT(), MLPOS(), MLCTOPOS(), MPOSTOLC()

  * source/codepage/cphr437.c
  * source/codepage/cphr852.c
  * source/codepage/cphrwin.c
    * Fixed wrongly ordered accented chars.
    * Fixed missing accented chars in Windows CP.
    ; Submitted by Vladimir Miholic on sf.net.

  * contrib/xhb/xhb.h
    + Added hb_seconds() compatibility macro.

  * tests/speedtst.prg
    + Added SET DATE ANSI and SET CENTURY ON.

  * tests/Makefile
  + tests/brwpos.prg
    + Added TBrowse() :rowPos test submitted by Xavi to the list.

  * utils/hbmk2/hbmk2.hbp
  * utils/hbrun/hbrun.hbp
    % Minor opt to prev.

  * tests/rto_tb.prg
    + Added hb_SToD() compatibility function to make it link
      with xhb.
    + Added forced define of HB_COMPAT_C53 in xhb mode, but 
      commented because it makes it RTE.

  * INSTALL
    ! Term changed to be consistent with rest of doc.

  * include/hbapi.h
    ! Typo in comment.
2009-06-02 17:24:02 +00:00

71 lines
1.9 KiB
Plaintext

/*
* $Id$
*/
/********************************************************
* TEST BROWSE ROWPOS FOR COMPILER IN CLIPPER AND HARBOUR
*********************************************************/
static s_nRecNo := 1
static s_nLastRec := 100
static s_lFixPos := .F.
Procedure Main()
Local nRow := 1
Cls
@ 0,4 say 'Is current RecNo but not repositioned until FixPos .T. <F2> Change FixPos'
@ MaxRow(),1 say 'Please press <Intro> to select or <Esc> to exit and <F2> to FixPos is '
while( LastKey() != 27 )
@ 0,0 say s_nRecNo picture '###'
@ MaxRow(),68 say iif(s_lFixPos, '.T.','.F.')
nRow := TestBrw( nRow )
enddo
return
Function TestBrw( nRowIni )
Local nKey, oBrw := TBrowseNew( 1, 0, MaxRow() - 1, MaxCol() )
oBrw:SkipBlock := { | n | n := iif( n < 0, max( n, 1 - s_nRecNo ), ;
min( s_nLastRec - s_nRecNo, n ) ), ;
s_nRecNo += n, n }
oBrw:GoTopBlock := { || s_nRecNo := 1 }
oBrw:GoBottomBlock := { || s_nRecNo := s_nLastRec }
oBrw:AddColumn( TBColumnNew( 'RecNo #', {|| s_nRecNo } ) )
if( s_lFixPos .and. nRowIni > 1 )
Eval( oBrw:skipBlock, 1 - nRowIni )
endif
oBrw:rowPos := nRowIni
while( .T. )
while( !oBrw:stabilize() )
enddo
nKey := Inkey( 0 )
if( nKey == 27 .or. nKey == 13 )
exit
elseif( nKey == -1 )
s_lFixPos := iif(s_lFixPos, .F., .T.)
exit
elseif( nKey == 24 )
oBrw:Down()
elseif( nKey == 05 )
oBrw:Up()
elseif( nKey == 03 )
oBrw:pageDown()
elseif( nKey == 18 )
oBrw:pageUp()
elseif( nKey == 29 ).or.( nKey == 31 )
oBrw:goTop()
elseif( nKey == 23 ).or.( nKey == 30 )
oBrw:goBottom()
elseif( nKey == 01 )
oBrw:rowPos := 1
elseif( nKey == 06 )
oBrw:rowPos := s_nLastRec
endif
enddo
return oBrw:rowPos
/*****
* END
******/