Lookup Table
Moderator: Rathinagiri
Lookup Table
Hi All,
How to make lookup table, example if key F2 or klik button can display list of customer and when enter, cust id can display ?
In Clipper, I use SuperLib Library Function.
Best Regards,
Tristan
How to make lookup table, example if key F2 or klik button can display list of customer and when enter, cust id can display ?
In Clipper, I use SuperLib Library Function.
Best Regards,
Tristan
- Rathinagiri
- Posts: 5471
- Joined: Tue Jul 29, 2008 6:30 pm
- DBs Used: MariaDB, SQLite, SQLCipher and MySQL
- Location: Sivakasi, India
- Contact:
Re: Lookup Table
I think Sudip would be the right person to answer.
East or West HMG is the Best.
South or North HMG is worth.
...the possibilities are endless.
South or North HMG is worth.
...the possibilities are endless.
- esgici
- Posts: 4543
- Joined: Wed Jul 30, 2008 9:17 pm
- DBs Used: DBF
- Location: iskenderun / Turkiye
- Contact:
Re: Lookup Table
Hi Tristan
Regards
--
Esgici
What is name of function you use from Superlib ?Tristan wrote:Hi All,
How to make lookup table, example if key F2 or klik button can display list of customer and when enter, cust id can display ?
In Clipper, I use SuperLib Library Function.
Best Regards,
Tristan
Regards
--
Esgici
Viva INTERNATIONAL HMG
Re: Lookup Table
Hello Tristan,
I am only a learner of HMG
Some times ago I wrote a function which may solve your problem: Following code may have bugs, but hope will help Please check FindRec() function
With best regards.
Sudip
I am only a learner of HMG
Some times ago I wrote a function which may solve your problem: Following code may have bugs, but hope will help Please check FindRec() function
With best regards.
Sudip
With best regards,
Sudip
Sudip
Re: Lookup Table
Hi Mr. Esgici,
I use smallkset and smalls function for lookup table.
Hi Mr. Sudip,
Thanks for example, but I get error when compile.
Thanks,
Tristan
I use smallkset and smalls function for lookup table.
Hi Mr. Sudip,
Thanks for example, but I get error when compile.
Thanks,
Tristan
- Attachments
-
- wAcct.JPG (35.82 KiB) Viewed 6327 times
Re: Lookup Table
Hello Tristan,
I didn't send the total source code. I only showed you how to do this
Please check following code snippet :
With best regards.
Sudip
I didn't send the total source code. I only showed you how to do this
Please check following code snippet :
Code: Select all
Function FindRec()
local mRecno, aAcctnm := {}, i :=0
netselect("ACCT")
set order to 2
mRecno = iif(eof(), 0, recno())
go top
dbeval({|| aadd(aAcctnm, acct->acctnm)})
if recno() <> 0
go (mRecno)
endif
i := frmFind(aAcctnm)
if i > 0
netselect("acct")
set order to tag acctnm
seek upper(aAcctNm[i])
RefreshData()
endif
return nil
Function FrmFind(aData)
private aTempData := {}, mPtr := 0
aeval(aData, {|x| aadd(aTempData, x)})
WinFrmFind()
frmFind.Center
frmFind.Activate
Return (mPtr)
Static function InitFind()
frmFind.lstFind.deleteallitems()
aeval(aTempData, {|x| frmFind.lstFind.additem(x)})
frmFind.lstFind.setfocus()
return nil
Function WinfrmFind()
DEFINE WINDOW AT 140 , 235 ;
WIDTH 550 HEIGHT 394 ;
TITLE "Find"
MODAL ;
ON INIT InitFind()
DEFINE BUTTON cmdOk
ROW 330
COL 120
WIDTH 100
HEIGHT 28
ACTION {mPtr := frmFind.lstFind.value, frmFind.release()}
CAPTION "&Ok"
END BUTTON
DEFINE BUTTON cmdCancel
ROW 330
COL 300
WIDTH 100
HEIGHT 28
ACTION {mPtr = 0, frmFind.release()}
CAPTION "&Cancel"
END BUTTON
DEFINE LISTBOX lstFind
ROW 0
COL 0
WIDTH 541
HEIGHT 323
ITEMS {""}
VALUE 0
FONTNAME "Lucida Console"
FONTSIZE 10
BACKCOLOR {253,254,199}
ONDBLCLICK {frmFind.cmdOk.action()}
END LISTBOX
END WINDOW
return nil
Sudip
With best regards,
Sudip
Sudip
Re: Lookup Table
Hi Mr. Sudip,
Why use array not use direct table ? If use array all data should transfer to array, it takes time.
Regards,
Tristan
Why use array not use direct table ? If use array all data should transfer to array, it takes time.
Regards,
Tristan
Re: Lookup Table
Because,Tristan wrote: Why use array not use direct table ? If use array all data should transfer to array, it takes time.
1) I want to make the code generic (please check FrmFind() function onwords). This code can be used with any table
2) This code can be used with SQL tables also where we store data into array
3) Generally Lookup table (in old days we called Master table) is not so big comparing Transaction table
4) I am a great admirer of GRID Please check VIRTUAL property of GRID in the Reference regarding performance
But, I can't say that I am always correct, as I am learning HMG
So, please send your comments regarding this
With best regards.
Sudip
With best regards,
Sudip
Sudip
Re: Lookup Table
Hi Mr. Sudip ,
In array only support 4800 line, is it right ? What happen if table have more than 4800 record ?
Thanks for advance.
Regards,
Tristan
In array only support 4800 line, is it right ? What happen if table have more than 4800 record ?
Thanks for advance.
Regards,
Tristan
Re: Lookup Table
I just tested to store some fields into an array of a table having 429712 records. It runs fine. So this array has 429712 rows and 3 columnsTristan wrote: In array only support 4800 line, is it right ? What happen if table have more than 4800 record ?
Code: Select all
...
...
Function TestRecord()
local i := 0, mTotRec
aData := {}
select saledtl
mTotRec := reccount()
go top
main.progressbar_1.value := 0
do while !eof()
do events
i++
main.label_1.value := ltrim(str(i))+" / "+ltrim(str(mTotRec))
main.progressbar_1.value := i/mTotRec*100
aadd(adata, {saleid, styleid, sizeid})
skip
enddo
msgbox("complete")
go top
return nil
With best regards.
Sudip
Last edited by sudip on Tue Nov 10, 2009 9:02 am, edited 2 times in total.
With best regards,
Sudip
Sudip