2nd sort - Pick Database
This is a discussion on 2nd sort - Pick Database ; S = CHANGE('A1]Q68]HH12]F6]HH1]AA678]FDQ88]A6]A123',']',@VM) N = '' FOR J = 1 TO DCOUNT(S,@VM) A = OCONV(S ,'MCA') OCONV(S ,'MCN')'R%6') LOCATE(A,N,1;POS;'AL') ELSE NULL N = INSERT(N,1,POS;A) N = INSERT(N,2,POS;S ) NEXT J N = N CRT S CRT N frosty....this works great....but ...
![]() |
| | LinkBack | Thread Tools | Display Modes |
|
#1
| |||
| |||
| N = '' FOR J = 1 TO DCOUNT(S,@VM) A = OCONV(S<1,J>,'MCA') OCONV(S<1,J>,'MCN')'R%6')LOCATE(A,N,1;POS;'AL') ELSE NULL N = INSERT(N,1,POS;A) N = INSERT(N,2,POS;S<1,J>) NEXT J N = N<2> CRT S CRT N frosty....this works great....but of course now they want other tings tagged. question if i have the string 'A1]Q68]HH12]F6]HH1]AA678]FDQ88]A6]A123' but I also have a multi string inside a string. string<1,1> = 'A1]Q68]HH12]F6]HH1]AA678]FDQ88]A6]A123' string<1,2> = 'dog]house]book]car]pc]mac]door]lock]bike' string<1,3> = 'aa]bb]cc]ee]ff]gg]tt]rr]sss] I still want to sort of off the first but carry all the subs with them. For some reason I just keep screwin this up |
|
#2
| |||
| |||
|
Data as shown is not possible if "]" is @VM. Do you mean string<2> = 'dog etc'? Iae, re-sorting related mv'd attributes is pretty straightforward, in the loop after the Insert, just add newstring<2,POS> = oldstring<2,J> etc. btw, why start a new topic? Am still curious as to whether my solution works on mvBase. Chandru On Oct 17, 1:21 pm, spa...@jitservices.com wrote: > S = CHANGE('A1]Q68]HH12]F6]HH1]AA678]FDQ88]A6]A123',']',@VM) > N = '' > FOR J = 1 TO DCOUNT(S,@VM) > A = OCONV(S<1,J>,'MCA') OCONV(S<1,J>,'MCN')'R%6')> LOCATE(A,N,1;POS;'AL') ELSE NULL > N = INSERT(N,1,POS;A) > N = INSERT(N,2,POS;S<1,J>) > NEXT J > N = N<2> > CRT S > CRT N > > frosty....this works great....but of course now they want other tings > tagged. > > question > > if i have the string > > 'A1]Q68]HH12]F6]HH1]AA678]FDQ88]A6]A123' > > but I also have a multi string inside a string. > > string<1,1> = 'A1]Q68]HH12]F6]HH1]AA678]FDQ88]A6]A123' > string<1,2> = 'dog]house]book]car]pc]mac]door]lock]bike' > string<1,3> = 'aa]bb]cc]ee]ff]gg]tt]rr]sss] > > I still want to sort of off the first but carry all the subs with > them. For some reason I just keep screwin this up n |
|
#3
| |||
| |||
|
On Oct 17, 12:56*pm, cmur...@seeinggreen.net wrote: > Data as shown is not possible if "]" is @VM. Do you mean string<2> = > 'dog etc'? > > Iae, re-sorting related mv'd attributes is pretty straightforward, in > the loop after the Insert, just add newstring<2,POS> = oldstring<2,J> > etc. > > btw, why start a new topic? Am still curious as to whether my solution > works on mvBase. > > Chandru > > On Oct 17, 1:21 pm, spa...@jitservices.com wrote: > > > > > > > S = CHANGE('A1]Q68]HH12]F6]HH1]AA678]FDQ88]A6]A123',']',@VM) > > N = '' > > FOR J = 1 TO DCOUNT(S,@VM) > > * A = OCONV(S<1,J>,'MCA') OCONV(S<1,J>,'MCN')'R%6')> > * LOCATE(A,N,1;POS;'AL') ELSE NULL > > * N = INSERT(N,1,POS;A) > > * N = INSERT(N,2,POS;S<1,J>) > > NEXT J > > N = N<2> > > CRT S > > CRT N > > > frosty....this works great....but of course now they want other tings > > tagged. > > > question > > > if i have the string > > > 'A1]Q68]HH12]F6]HH1]AA678]FDQ88]A6]A123' > > > but I also have a multi string inside a string. > > > string<1,1> = 'A1]Q68]HH12]F6]HH1]AA678]FDQ88]A6]A123' > > string<1,2> = 'dog]house]book]car]pc]mac]door]lock]bike' > > string<1,3> = 'aa]bb]cc]ee]ff]gg]tt]rr]sss] > > > I still want to sort of off the first but carry all the subs with > > them. * For some reason I just keep screwin this up > > n- Hide quoted text - > > - Show quoted text - Started new one accidently. |
|
#4
| |||
| |||
|
You can always use another list such as: n="" nn="" for j = 1 to dcount(s,@vm) a = ... locate(a,nn,1;pos;'al') else null nn = insert(nn,1,pos;a) nn = insert(nn,2,pos;j) next j Now, as you go down the list NN<2,x> will be the "next" value you want. Use that as a vector to build your output list for x = 1 to dcount(s,@vm) for j = 1 to attr.cnt n next j next x Mark news:baa4d181-edea-4ba1-9aec-7b2303b27460@h2g2000hsg.googlegroups.com... >S = CHANGE('A1]Q68]HH12]F6]HH1]AA678]FDQ88]A6]A123',']',@VM) > N = '' > FOR J = 1 TO DCOUNT(S,@VM) > A = OCONV(S<1,J>,'MCA') OCONV(S<1,J>,'MCN')'R%6')> LOCATE(A,N,1;POS;'AL') ELSE NULL > N = INSERT(N,1,POS;A) > N = INSERT(N,2,POS;S<1,J>) > NEXT J > N = N<2> > CRT S > CRT N > > frosty....this works great....but of course now they want other tings > tagged. > > > question > > if i have the string > > 'A1]Q68]HH12]F6]HH1]AA678]FDQ88]A6]A123' > > but I also have a multi string inside a string. > > string<1,1> = 'A1]Q68]HH12]F6]HH1]AA678]FDQ88]A6]A123' > string<1,2> = 'dog]house]book]car]pc]mac]door]lock]bike' > string<1,3> = 'aa]bb]cc]ee]ff]gg]tt]rr]sss] > > I still want to sort of off the first but carry all the subs with > them. For some reason I just keep screwin this up Mark Brown, BSE Senior Software Engineer Three-Time Cancer Survivor (Cell) 484-716-6154 |
|
#5
| |||
| |||
|
Hi As Chandru pointed out the Value marks seem to be misinterpreted. I am sure there must be a plan in the system design however just split up the blocks using whatever form that you prefer and in D3 this works. :ed mmbp try top ..l99 001 string = "";new1 = "";new2 = "";new3 = "" 002 string<1> = 'A1]Q68]HH12]F6]HH1]AA678]FDQ88]A6]A123' 003 string<2> = 'dog]house]book]car]pc]mac]door]lock]bike' 004 string<3> = 'aa]bb]cc]ee]ff]gg]tt]rr]sss]' 005 for a= 1 to 9 006 crt string<1,a>,string<2,a>,string<3,a> 007 next a 008 new1 = sort(string<1>) 009 crt new1 010 for a = 1 to 9 011 chk = new1<1,a> 012 locate chk in string<1>,1 setting pos else crt "boom";stop 013 new2<1,a> = string<2,pos> 014 new3<1,a> = string<3,pos> 015 next a 016 for a = 1 to 9 017 crt new1<1,a>,new2<1,a>,new3<1,a> 018 next a eoi 018 :run mmbp try A1 dog aa Q68 house bb HH12 book cc F6 car ee HH1 pc ff AA678 mac gg FDQ88 door tt A6 lock rr A123 bike sss A1]A123]A6]AA678]F6]FDQ88]HH1]HH12]Q68 A1 dog aa A123 bike sss A6 lock rr AA678 mac gg F6 car ee FDQ88 door tt HH1 pc ff HH12 book cc Q68 house bb Peter McMurray news:75bf8c24-d2f4-40de-bfd4-35940a590e94@l77g2000hse.googlegroups.com... On Oct 17, 12:56 pm, cmur...@seeinggreen.net wrote: > Data as shown is not possible if "]" is @VM. Do you mean string<2> = > 'dog etc'? > > Iae, re-sorting related mv'd attributes is pretty straightforward, in > the loop after the Insert, just add newstring<2,POS> = oldstring<2,J> > etc. > > btw, why start a new topic? Am still curious as to whether my solution > works on mvBase. > > Chandru > > On Oct 17, 1:21 pm, spa...@jitservices.com wrote: > > > > > > > S = CHANGE('A1]Q68]HH12]F6]HH1]AA678]FDQ88]A6]A123',']',@VM) > > N = '' > > FOR J = 1 TO DCOUNT(S,@VM) > > A = OCONV(S<1,J>,'MCA') OCONV(S<1,J>,'MCN')'R%6')> > LOCATE(A,N,1;POS;'AL') ELSE NULL > > N = INSERT(N,1,POS;A) > > N = INSERT(N,2,POS;S<1,J>) > > NEXT J > > N = N<2> > > CRT S > > CRT N > > > frosty....this works great....but of course now they want other tings > > tagged. > > > question > > > if i have the string > > > 'A1]Q68]HH12]F6]HH1]AA678]FDQ88]A6]A123' > > > but I also have a multi string inside a string. > > > string<1,1> = 'A1]Q68]HH12]F6]HH1]AA678]FDQ88]A6]A123' > > string<1,2> = 'dog]house]book]car]pc]mac]door]lock]bike' > > string<1,3> = 'aa]bb]cc]ee]ff]gg]tt]rr]sss] > > > I still want to sort of off the first but carry all the subs with > > them. For some reason I just keep screwin this up > > n- Hide quoted text - > > - Show quoted text - Started new one accidently. |
|
#6
| |||
| |||
|
On Oct 18, 1:07*am, "Peter McMurray" > Hi > As Chandru pointed out the Value marks seem to be misinterpreted. *I amsure > there must be a plan in the system design however just split up the blocks > using whatever form that you prefer and in D3 this works. > :ed mmbp try > top > .l99 > 001 string = "";new1 = "";new2 = "";new3 = "" > 002 string<1> = 'A1]Q68]HH12]F6]HH1]AA678]FDQ88]A6]A123' > 003 string<2> = 'dog]house]book]car]pc]mac]door]lock]bike' > 004 string<3> = 'aa]bb]cc]ee]ff]gg]tt]rr]sss]' > 005 for a= 1 to 9 > 006 crt string<1,a>,string<2,a>,string<3,a> > 007 next a > 008 new1 = sort(string<1>) > 009 crt new1 > 010 for a = 1 to 9 > 011 chk = new1<1,a> > 012 locate chk in string<1>,1 setting pos else crt "boom";stop > 013 new2<1,a> = string<2,pos> > 014 new3<1,a> = string<3,pos> > 015 next a > 016 for a = 1 to 9 > 017 crt new1<1,a>,new2<1,a>,new3<1,a> > 018 next a > eoi 018 > > :run mmbp try > A1 * * * * * * * *dog * * * * * * * aa > Q68 * * * * * * * house * * * * * * bb > HH12 * * * * * * *book * * * * * * *cc > F6 * * * * * * * *car * * * * * * * ee > HH1 * * * * * * * pc * * * * * * * *ff > AA678 * * * * * * mac * * * * * * * gg > FDQ88 * * * * * * door * * * * * * *tt > A6 * * * * * * * *lock * * * * * * *rr > A123 * * * * * * *bike * * * * * * *sss > A1]A123]A6]AA678]F6]FDQ88]HH1]HH12]Q68 > A1 * * * * * * * *dog * * * * * * * aa > A123 * * * * * * *bike * * * * * * *sss > A6 * * * * * * * *lock * * * * * * *rr > AA678 * * * * * * mac * * * * * * * gg > F6 * * * * * * * *car * * * * * * * ee > FDQ88 * * * * * * door * * * * * * *tt > HH1 * * * * * * * pc * * * * * * * *ff > HH12 * * * * * * *book * * * * * * *cc > Q68 * * * * * * * house * * * * * * bb > Peter McMurray > > news:75bf8c24-d2f4-40de-bfd4-35940a590e94@l77g2000hse.googlegroups.com... > On Oct 17, 12:56 pm, cmur...@seeinggreen.net wrote: > > > > > Data as shown is not possible if "]" is @VM. Do you mean string<2> = > > 'dog etc'? > > > Iae, re-sorting related mv'd attributes is pretty straightforward, in > > the loop after the Insert, just add newstring<2,POS> = oldstring<2,J> > > etc. > > > btw, why start a new topic? Am still curious as to whether my solution > > works on mvBase. > > > Chandru > > > On Oct 17, 1:21 pm, spa...@jitservices.com wrote: > > > > S = CHANGE('A1]Q68]HH12]F6]HH1]AA678]FDQ88]A6]A123',']',@VM) > > > N = '' > > > FOR J = 1 TO DCOUNT(S,@VM) > > > A = OCONV(S<1,J>,'MCA') OCONV(S<1,J>,'MCN')'R%6')> > > LOCATE(A,N,1;POS;'AL') ELSE NULL > > > N = INSERT(N,1,POS;A) > > > N = INSERT(N,2,POS;S<1,J>) > > > NEXT J > > > N = N<2> > > > CRT S > > > CRT N > > > > frosty....this works great....but of course now they want other tings > > > tagged. > > > > question > > > > if i have the string > > > > 'A1]Q68]HH12]F6]HH1]AA678]FDQ88]A6]A123' > > > > but I also have a multi string inside a string. > > > > string<1,1> = 'A1]Q68]HH12]F6]HH1]AA678]FDQ88]A6]A123' > > > string<1,2> = 'dog]house]book]car]pc]mac]door]lock]bike' > > > string<1,3> = 'aa]bb]cc]ee]ff]gg]tt]rr]sss] > > > > I still want to sort of off the first but carry all the subs with > > > them. For some reason I just keep screwin this up > > > n- Hide quoted text - > > > - Show quoted text - > > Started new one accidently. why do you do this you secrete your small algorithms in ignorance why? why do you do this? u are hobbyists? u study klingon? why? |
![]() |
« Previous Thread
|
Next Thread »
| Thread Tools | |
| Display Modes | |
| |
All times are GMT -4. The time now is 12:52 PM.



OCONV(S<1,J>,'MCN')'R%6')
Linear Mode