Browsing arrays

Browsing arrays

Postby claudio.driussi » Fri Nov 11, 2005 5:07 pm

Is possible to browse arrays?

Best Regards.
Claudio
User avatar
claudio.driussi
 
Posts: 18
Joined: Fri Nov 11, 2005 4:46 pm

Re: Browsing arrays

Postby Enrico Maria Giordano » Fri Nov 11, 2005 9:02 pm

Hi Claudio, I'm happy to see you here! This is a working sample:

Code: Select all  Expand view
#include "Fwce.ch"


FUNCTION MAIN()

    LOCAL oWnd, oBrw

    LOCAL aArray := { "Test1", "Test2", "Test3" }

    LOCAL nCur := 1

    DEFINE WINDOW oWnd;
           TITLE "Browsing array"

    @ 0, 0 LISTBOX oBrw FIELDS aArray[ nCur ];
           HEADERS "Test data"

    oBrw:bLogicLen = { || Len( aArray ) }
    oBrw:bGoTop    = { || nCur := 1 }
    oBrw:bGoBottom = { || nCur := Len( aArray ) }
    oBrw:bSkip     = { | nSkip | Skipper( aArray, @nCur, nSkip ) }
    oBrw:cAlias    = "ARRAY"

    oBrw:SetFocus()

    ACTIVATE WINDOW oWnd

    RETURN NIL


STATIC FUNCTION SKIPPER( aArray, nCur, nSkip )

    LOCAL nOld := nCur

    nCur += nSkip

    IF nCur > LEN( aArray ); nCur = LEN( aArray ); ENDIF
    IF nCur < 1; nCur = 1; ENDIF

    RETURN nCur - nOld


EMG
User avatar
Enrico Maria Giordano
 
Posts: 8715
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Re: Browsing arrays

Postby claudio.driussi » Sun Nov 13, 2005 4:43 pm

EnricoMaria wrote:Hi Claudio, I'm happy to see you here! This is a working sample:

[snip]

EMG


Thanks, i try immediatly.
I'm here because our frend Andrea convinced me :) , i'm happy too.

Claudio.
User avatar
claudio.driussi
 
Posts: 18
Joined: Fri Nov 11, 2005 4:46 pm


Return to FiveWin for Pocket PC

Who is online

Users browsing this forum: No registered users and 5 guests