Subject: | Re: TableFrame or ListBox
| Date: | Thu, 07 Jul 2022 09:33:36 +0200
| From: | modridirkac <jure.zorko@gmail.com>
| Newsgroups: | pnews.paradox-programming
|
Hm, yes.
proc padString(s string, l smallint) string
if s.size() > l then
return(s.SubStr(1,l)
else
return(s+fill(" ",l-s.size() ) )
endIf
endProc
var q query
TCtmp TCursor
endVar;
First get your data:q = query
:db:xyz.db | Col1 | Col2 | Col3 |
| Check | Check | Check |
endQuery
q.ExecuteQBE(TCtmp)
; now put it into list
myList.list.list.selection = TCtmp.nRecords()
scan TCtmp:
myList.list.list.selection = TCtmp.recNo()
myList.list.list.value = padString(TCtmp."Col1",11) + "| "
+padString(TCtmp."Col2",7) + "| "
+padString(TCtmp."Col3",8)
endScan
Jure
>
> Jure,
> Thanks! For the padding, I need to pull the data from a db. I trying to
> Pad each column with a specific number of characters. "Column" 1 = max
> 10
> Characters + space | space
> "Column" 2 = max 6 Characters + space | space
> "Column" 3 = max 8 Characters
>
> the listbox would look like:
> 12/10/2021 | 123456 | 12345678
> 12/11/2021 | 1234 | 12345
> 01/01/2022 | 12345 | 12
>
> Is this possible?
>
> modridirkac <jure.zorko@gmail.com> wrote:
>> ------------phWsru9JzVF5noLndtr7Xt
>>
>>> I need to know if it's possible to either have a tableframe to display
>
>>> fields only (the user can select a row, but not change anything)
>>
>> On a form:
>> Menu Format - Data model, right click on table and select Read only.
>>
>>
>>> can create how to use a listbox with a fixed font and padding to
>>> simulate a multicolumn listbox.
>>
>> Yes, you can pad, but with spaces, not tabs.
>> Just one trick, rename that default name #List6 to "list".
>> And then use
>> myList.list.list.selection = 1
>> myList.list.list.value = "a a"
>> myList.list.list.selection = 2
>> myList.list.list.value = "b b"
>>
>>
>> Jure
>> ------------phWsru9JzVF5noLndtr7Xt
>
--
Using Opera's mail client: http://www.opera.com/mail/
|