Välkommen till notessidan, testa gärna Intrapages

Gå till förstasidan
Behöver du en snabb och effektiv konsult för Lotus Notes och Domino eller en offert på en applikation ?  kontakta mig nu
  Sök
 Sortera en array med evaluate - Lotusscript  3

Följande kodsnutt sorterar en array

Dim s1 As String,sarr(4) As String, s2 As Variant
sarr(0) = "e"
sarr(1) = "c"
sarr(2) = "b"
sarr(3) = "f"
sarr(4) = "a"

s1 = |"| + Implode(sarr,|":"|) + |"|
s2 = Evaluate(|@Sort(| + s1 + |)|)
Print Implode(s2)

s2 innehåller en sorterad array
Lämna gärna en kommentar
18 feb 2011  |   Länk till denna post | 0 personer gillar denna post   
86BC1AE807184954C125783B005CDE6554.224.75.101
Kommentarer:3
2011-02-18 20:42:50 CET - Karl-Henry Martinsson
Snyggt! Själv försöker jag undvika Evaluate i Lotusscript (vet inte varför, känns bara inte rätt att blanda språk), men det är bra mycket kortare kod än den jag använder idag för att sortera arrayer...
2011-02-21 09:28:10 CET - Mark Leusink
Hi Thomas,

This solution works well for small lists, but be careful: there are lmits when using the evaluate function and/ or limits on the length of the list to be sorted. I encountered this when I used @URLDecode in a lotusscript class (see also here http://www.codestore.net/store.nsf/unid/BLOG-20080116).

Alternatives to use in lotusscript are to use a bubblesort routine (find one using Google) or to write a Java routine and use LS2J.

Mark
2011-02-21 12:12:36 CET - Per Gref
Kör en liknande själv, men ett tips kan vara att byta \ mot \\ innan implode märkte jag när jag sorterade filepaths häromdagen...:

s1 = |"| + Implode(Replace(sarr,"\","\\"),|":"|) + |"|
Kommentera denna post:
Namn:
Epost:
Skriv en kommentar:




Observera: Om du skriver en giltig epost adress kommer du få mail om någon annan svarar på denna post. Din epost adress visas aldrig här.

Du kommer också få ett bekräftelsemail inom 5 minuter, om  inte, kontrollera din spam folder och makera meddelandet som "inte spam" så kommer det till din inbox nästa gång.
 Prenumerera på nya poster
Senaste Kommentarerna

Svenska Helgdagar i IBM Notes (2)

Från: Mikael Eriksson

Holidays.nsf är 0kB dvs. den innehåller ingenting, varför är det så?

Svenska Helgdagar i IBM Notes (2)

Från: Jesper Kiaer

Like this: With both the Administrator and the User side of it. http://nevermind.dk/nevermind/blog.nsf/subject/importing-holidays-into-the-lotus -notes-calendar

Ytria - Bra verktyg för utvecklare och administratörer (6)

Från: Roy Rumaner

valeric, I don't know why you think anyone would give you the serial number for a copy of scanEZ. Ytria is in the business of selling their products not giving them away for free which is why they put a serial number on there in the first place. What you are asking for is the same thing as stealing and that is unacceptable in this industry. Pay for the tools you need and you will find out that they are worth much more than you paid for in the first place.

How to install IntraPages - 7 easy steps (5)

Från: Sinisa

Hi First: great work! The best xpage application that I have seen so far... I am getting a strange problem with version 1.8 in IE8 (FF & Chrome are fine). But your public version 1.9 Beta seems to work fine. Is there any way to get the beta version just to see if I'll have the same problem on my server? Thanks, Sinisa

How to install IntraPages - 7 easy steps (5)

Från: Sean Cull

could you provide some guidance for people wanting to install the demo on a server that has no anonymous access e.g. how can you make an existing person an administrator ? Thanks, Sean

How to install IntraPages - 7 easy steps (5)

Från: Thomas Adrian

also make sure your url point correctly , should end with content=news

How to install IntraPages - 7 easy steps (5)

Från: Thomas Adrian

Could you send me screenshots of your problem thomas.adrian (a) consili.se have you tried to reload the page, I have seen this problem but it should only occure the first time the page loads.

How to install IntraPages - 7 easy steps (5)

Från: Ravi

Really appreciate your effort on the intrapages. I have been trying to use this application. On my startpage i always see the loader gif without any content. Is there any setup issue?

How to reduce build time in large XPages apps (4)

Från: Simon O'Doherty

SSD also helps. :)

klicka för att ladda om notessidan