Paolo Mantovani wrote: > Hi, > > Il lunedì 11 febbraio 2008 20:12:48 Jonathan Kaye ha scritto: >> Steffen Grund wrote: >> > Hello, >> > >> > I am not the Basic expert here, but wouldn't something like this work? >> > >> > While Position <> <exit_value> >> > Position = Instr(i, ProcessString, " ") >> > etc. etc. etc. >> > Wend >> > >> > and just initialize Position before, so it does not have the exit >> > value? >> >> Hi Steffen, >> In fact, no it wouldn't. I'm processing entries in a spreadsheet which >> may have an arbitrary number of spaces in them. The entries also contain >> numbers. The idea is that all the numbers within a given chunk have to >> wind up at the end of the chunk next to a following space or EOL. So the >> exit condition would be when there are no more spaces left in the entry. >> I do this by successively shrinking the value of ProcessString with each >> loop. > > I'm not sure to understand what you're trying to archieve. > May you provide an example of the kind of data that you expect as input > and the correspondig output that you would obtain from the function ?
Hi Paolo, You can find a complete .ods file here http://homepage.univie.ac.at/jonathan.kaye/docs/ndp11testsort.ods but beware! it has 24.265 rows and 28 columns more or less. The function works on data like this (taken from Column B) flo2o4.b, fo2lo4.b .[N]; flor.i$ .[V]; ºôo2po4.b fo3r2«o2o2.s fotosintese.s$* Fra4i3ta3xèe2e1.s, Ko3ro2º`œ2i1èe2e1.s ga1 ga1 - ga1a3; ga1ra3 .[D,Hm]; ga3ra1 .[ØA] ga1a3.s ga1a3-a4i3 ra ºû±2a1.b ga1a3-a4i3 ga1a3-a4i3(«o2e1).b$/s ga1a3-a4i3«o2e1ºãu3i2se2n ga1a3-a4i3«o2e1ºãu3i2se2nxa1 ga1a3-a4i3se2 ga1a3-a4i3si1.b$/s ga1a3-a4i3!üa4a3se2n ga1a3da2a1 ga1a3da2a1sa1 ga1a2ga2a1.s$/(b) ga1a2ga2a1o2!ü±2a2 ga1a2ga2a1si1 ho2o1!`±2a1.s ga1a2ga2a1si1 ma1a3.s ga1a2ga2a1si1 m±3a2si1.b ga1a2ga2a1si1 m¡1u3.di ga1a2ga2a1si1 s±2a2.b ga1a2ga2a1si1 ta2ni1se2n.s ga1a2ga2a1si1 ¡2i2.b ga1a2ga2a1si1 |ãa2i1.b ga1a2ga2a1si1 ºü±1u3!`a2a4.b ga1a2ga2a1si1 ga1a2ga2a1si1se2 ga1a3ra4.sý$ .[D]; xa2rèi3ºãa3a2ºãa3a2.s .[N]; ºôa2ra2ga1.s (?, Rust `69:162) ga1a3sa1 ga1a3se2n ga1a3se2n.s ga1a3xa1 ga1a3xa1o2!ü±2a2 ga1a3xa1o2!ü±2a2si1.b ga1a3xa1!ü±2a2 ga1a3xa1!ü±2a2.s ga1a3xa1!ü±2a2(he1)sa1 ga1a3xa1!ü±2a2sa1be1se2, ~xa1!ü±2a2-a2o1se2 ga1a3xa1!ü±2a2si1.b ga1a3xa1!ü±2a2xa1 ga1a3xa1!ü±2a2xa1si1.b ga1a2ra1.sý$/gu, |`o4ma3re4.s ga1a2ra1xa1, |`o4ma3re4xa1 ga1a2ra1xa1-a3i2, |`o4ma3re4xa1-a3i2 ga1a2ra1ø It must do some string manipulations so I can map each of these form onto a string and that string will be the basis of the sort routine. > > >> The actual code I wrote looks like this: >> Function cutspace(ProcessString) as String > [...] > >> Lft = Lft + movetones(Chunk) + " " > > What is "movetones" ? movetones is a function that scans the string (such as those above) and collects the tone markers (1,2,3,4) and puts them after the last character of the line or some other positions. movetones applied to the first example above gives this: floo.b, folo.b .[N]; flor.i$ .[V]; ºôopo.b242424 movetones is only a small part of the big macro called "fixsort". > > ciao > Paolo M I hope this answers your question. cheers, Jonathan -- Registerd Linux user #445917 at http://counter.li.org/ Please do not send me copies of list mail. I read the lists. Thanks! --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]