Showing numbers from 1 to 10. No array, no Ado and no any known database.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
Same problem on reduced sample.Code: Select all | Expand
@ 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 } ??????
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.
This is a sample:
Code: Select all | Expand
#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
Code: Select all | Expand
oBrw:<header> := <codeblock-to-access-value>
Code: Select all | Expand
ADD TO oBrw DATA { || nValue } HEADER "Number"
Code: Select all | Expand
ADD TO oBrw DATA nValue HEADER "Number"
Code: Select all | Expand
WITH OBJECT oBrw:AddCol()
:bEditValue := { || nValue }
:cHeader := "Number"
END