dbaspot
Tags Register FAQ Calendar Search Today's Posts Mark Forums Read

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 ...


Home > Database Forum > Other Databases > Pick Database > 2nd sort

Reply

 

LinkBack Thread Tools Display Modes
  #1  
Old 10-17-2008, 01:21 PM
Database Bot
 
Join Date: Sep 2009
Posts: 1,236,254
Database Administrator is on a distinguished road
Default 2nd sort

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
Reply With Quote
  #2  
Old 10-17-2008, 01:56 PM
Database Bot
 
Join Date: Sep 2009
Posts: 1,236,254
Database Administrator is on a distinguished road
Default Re: 2nd sort

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
Reply With Quote
  #3  
Old 10-17-2008, 02:26 PM
Database Bot
 
Join Date: Sep 2009
Posts: 1,236,254
Database Administrator is on a distinguished road
Default Re: 2nd sort

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.
Reply With Quote
  #4  
Old 10-17-2008, 07:30 PM
Database Bot
 
Join Date: Sep 2009
Posts: 1,236,254
Database Administrator is on a distinguished road
Default Re: 2nd sort

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 = s> ;* sturcture this any way you want
next j
next x

Mark

wrote in message
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

Reply With Quote
  #5  
Old 10-17-2008, 08:07 PM
Database Bot
 
Join Date: Sep 2009
Posts: 1,236,254
Database Administrator is on a distinguished road
Default Re: 2nd sort

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
wrote in message
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.


Reply With Quote
  #6  
Old 10-18-2008, 10:15 PM
Database Bot
 
Join Date: Sep 2009
Posts: 1,236,254
Database Administrator is on a distinguished road
Default Re: 2nd sort

On Oct 18, 1:07*am, "Peter McMurray" wrote:
> 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 wrote in message
>
> 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?
Reply With Quote
Reply

Thread Tools
Display Modes



All times are GMT -4. The time now is 12:52 PM.