Must be placed in getsys?
How
#include "hbclass.ch"
METHOD Pos( nPos ) CLASS TGetList


-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Szakáts Viktor
Sent: Monday, June 23, 2008 7:33 PM
To: Harbour Project Main Developer List.
Subject: Re: [Harbour] SCOPE VIOLATION PROTECTED HBGETLIST:_NPOS

I misread your first mail, sorry.

As for HBGetList() (as opposed to TGet()),
such feature is not implemented in Harbour.

Untested code:
--
// To be called from a VALID or WHEN block.
FUNCTION hb_getSetPos( xPos )
    LOCAL oGetList := __GetListActive()
    IF oGetList != NIL
       DO CASE
       CASE ISNUMBER( xPos )
          IF xPos >= 1 .AND. xPos <= Len( oGetList:aGetList )
             oGetList:Pos( xPos )
          ENDIF
       CASE ISCHARACTER( xPos )
          xPos := Upper( xPos )
          xPos := AScan( oGetList:aGetList, {| oGet |  
hb_getReadVar( oGet ) == xPos } )
          IF xPos > 0
             oGetList:Pos( xPos )
          ENDIF
       OTHERWISE
          oGetList:Pos()
       ENDCASE
    ENDIF
    RETURN

METHOD Pos( nPos ) CLASS TGetList

    ::nPos := nPos

    RETURN NIL
--

This way code in VALID/WHEN can call hb_getSetPos( x ) and
Settle() will try to go to x on the next move. But I didn't
try so the above may not work at all.

Brgds,
Viktor

On 2008.06.23., at 18:14, Massimo Belgrano wrote:

> Instead OGetList:nPos := 2  I have used ReadNJump(oGetList,2  )   
> from oasys
> But give me bound error in function settle probably because it is  
> written for clipper5.2 class
> Which modification must I do to run in harbour?
>
> FUNCTION ReadNJump( getlist,nReadPos )
>  LOCAL nKey:= 0,lUpdated:= .F.,nGetPos
>  DEFAULT nReadPos TO 1
>  WHILE nReadPos > 0 .and. nKey <> K_ESC
>    lUpdated:= ReadModal( getlist,nReadPos )
>    nKey:= Lastkey()
>    // if we had a jump, do it.
>    IF (nGetPos:= Ascan( getlist,{|e| e:JUMP2POS > 0} )) > 0
>       // reset for another entry.
>       nReadPos:= getlist[nGetPos]:JUMP2POS
>       getlist[nGetPos]:JUMP2POS:= 0
>    ENDIF
>  ENDDO
> RETURN lUpdated
>
> -----Original Message-----
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 
> ] On Behalf Of Massimo Belgrano
> Sent: Wednesday, June 18, 2008 7:36 PM
> To: Harbour Project Main Developer List.
> Subject: RE: [Harbour] SCOPE VIOLATION PROTECTED HBGETLIST:_NPOS
>
> Can I do something of similar in harbour for goto fields by pos?
>
>
> -----Original Message-----
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 
> ] On Behalf Of Szakáts Viktor
> Sent: Wednesday, June 18, 2008 7:31 PM
> To: Harbour Project Main Developer List.
> Subject: Re: [Harbour] SCOPE VIOLATION PROTECTED HBGETLIST:_NPOS
>
> oGetList:pos := 2
>
> like in Clipper.
>
> Brgds,
> Viktor
>
> On 2008.06.18., at 19:00, Massimo Belgrano wrote:
>
>> Goto second field in get but return error
>> In xharbour I do
>>  OGetList := __GetListActive()
>>  OGetList:nPos := 2
>> How can Do in harbour?
>>
>> Massimo Belgrano
>>
>> _______________________________________________
>> Harbour mailing list
>> Harbour@harbour-project.org
>> http://lists.harbour-project.org/mailman/listinfo/harbour
>
> _______________________________________________
> Harbour mailing list
> Harbour@harbour-project.org
> http://lists.harbour-project.org/mailman/listinfo/harbour
> _______________________________________________
> Harbour mailing list
> Harbour@harbour-project.org
> http://lists.harbour-project.org/mailman/listinfo/harbour
> _______________________________________________
> Harbour mailing list
> Harbour@harbour-project.org
> http://lists.harbour-project.org/mailman/listinfo/harbour

_______________________________________________
Harbour mailing list
Harbour@harbour-project.org
http://lists.harbour-project.org/mailman/listinfo/harbour
_______________________________________________
Harbour mailing list
Harbour@harbour-project.org
http://lists.harbour-project.org/mailman/listinfo/harbour

Reply via email to