JoséQuintas wrote:Let's simplify, forgot my class.
I want to show numbers from 1 to 10, no array, no recordset, no ADO, no my class
I want to use xbrowse and codeblocks only
- Code: Select all Expand view RUN
@ nRow, nCol XBROWSE xControl ;
SIZE nWidth, nHeight PIXEL ;
OBJECT Nil ;
OF xParent
ADD oCol TO xControl ;
DATA { || xControl:nArrayAt } ;
HEADER "NUM"
xControl:nArrayAt := 1
xControl:bGoTop := { || xControl:nArrayAt := 1 }
xControl:bGoBottom := { || xControl:nArrayAt := 10 }
??????
Same problem on reduced sample.
Is there exists a solution to do this ?
xbrowse and codeblocks only.
It is a standard feature of xbrowse: to define codeblocks.
It is a simple task: show numbers from 1 to 10
And cancel any automatic detection of value used on XBROWSE OBJECT.
Sample on this post use numbers from 1 to 10.
It is a proof about to be possible to define codeblocks.
Can't use multithread... bad but ok
Can't use DBF like on multithread... bad... need change another application to MySQL
My ADOClass ???
It is the remaining one thing that I could use on fivewin.
Showing numbers from 1 to 10. No array, no Ado and no any known database.
This is a sample:
- Code: Select all Expand view RUN
- #include "fivewin.ch"
function Main()
local oDlg, oBrw
local nValue := 1 // used for browse
DEFINE DIALOG oDlg SIZE 400,500 PIXEL TRUEPIXEL RESIZABLE
@ 20,20 XBROWSE oBrw SIZE -20,-20 PIXEL OF oDlg ;
CELL LINES NOBORDER
WITH OBJECT oBrw
:nDataType := DATATYPE_USER
// Create and add a column, the simplest way
oBrw:Number := { || nValue }
// Navigation Blocks of XBrowse
// All Required
:bGoTop := { || nValue := 1 }
:bGoBottom := { || nValue := 10 }
:bKeyCount := { || 10 } // Use this instead of bLogicLen
:bBof := { || nValue < 1 }
:bEof := { || nValue > 10 }
:bSkip := { |n,nSave| nSave := nValue, ;
nValue := Max( 1, Min( 10, nValue + IfNil(n,1) ) ), ;
nValue - nSave } // return number of rows actually skipped
:bBookMark := ;
:bKeyNo := { |n| If( n == nil, nValue, nValue := n ) }
//
:CreateFromCode()
END
ACTIVATE DIALOG oDlg CENTERED
return nil
Different ways of Creating and adding new columns to Browse
- Code: Select all Expand view RUN
- oBrw:<header> := <codeblock-to-access-value>
OR (compatible with TC browse)
- Code: Select all Expand view RUN
- ADD TO oBrw DATA { || nValue } HEADER "Number"
OR
- Code: Select all Expand view RUN
- ADD TO oBrw DATA nValue HEADER "Number"
OR (old way)
- Code: Select all Expand view RUN
- WITH OBJECT oBrw:AddCol()
:bEditValue := { || nValue }
:cHeader := "Number"
END