to sort system date in a list, and special effect with sliders (XP)
gaich software service
service at gaich.de
Tue Nov 29 09:34:15 EST 2005
Hello all of this very helpful list,
I am a consultant and supporter of a well known ERP-Software in germany.
Since 6 months I am programming tools for that ERP-System and I do it
with revolution.
I think this was the best idea I've ever had.
My customers are very happy to get the tools they need in a very short
time and for a low price.
Until now I wasn't an active user of this list, because my english isn't
very good, as you see.
I have a question about date sort in a list. Because my customers are
german, they want to see the german date format (system date).
Is there a way to sort a list by an item that contains a system date?
I wrote a little function for this problem:
function sortContainerBySystemDate pContainer, pItemToSort, pSortOrder
local
nOL
local nOI
local x
if (pContainer is empty) or (pItemToSort is not a number) or
(pItemToSort < 1) then
put empty into sortedContainer
return sortedContainer
exit sortContainerBySystemDate
end if
set the itemDel to tab
put the number of lines of pContainer into nOL
put the number of items of line 1 of pContainer into nOI
if nOL < 2 or nOI < pItemToSort then
put pContainer into sortedContainer
return sortedContainer
exit sortContainerBySystemDate
end if
repeat for each line x in pContainer
convert item pItemToSort of x from system date to seconds
end repeat
if pSortOrder = 1 then
sort lines of pContainer descending numeric by item pItemToSort
of each
else
sort lines of pContainer ascending numeric by item pItemToSort
of each
end if
repeat for each line x in pContainer
convert item pItemToSort of x from seconds to system date
end repeat
put pContainer into sortedContainer
return sortedContainer
end sortContainerBySystemDate
It works for me. But may be there is a better and shorter way to do that!?
Another Problem:
Because my costumers are working on windows machines, they have very
different Versions (98,2000,XP).
I'm programming on a windows XP with Classic Style for Windows and gadgets.
I did a tool that contains sliders and it works fine.
I installed it on a customers machine with XP and XP Style. I was scared
-- the knop of the slider was not there and there was no way to do
anything with the slider.
When I turned the Style to Classic on that machine, the knob was there
again. But the employee wants to have the XP Style, hmmm.
Is this a well known effect and is there a possible solution?
Puuhhh, it takes longer time to write this little english text then to
programm a little tool with Revolution :-)
Best,
Günter
------------------------------------------------------------------------
*gaich software service
Günter Gaich
*
*fon: +49 (0) 6452-91101-55
fax: +49 (0) 6452-91101-57
mobil: +49 (0) 172 970 26 51
service at gaich.de*
More information about the use-livecode
mailing list