dbTalk Databases Forums  

Quickest way to go from "portrait" to "landscape"

comp.databases.pick comp.databases.pick


Discuss Quickest way to go from "portrait" to "landscape" in the comp.databases.pick forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
michael@preece.net
 
Posts: n/a

Default Quickest way to go from "portrait" to "landscape" - 10-05-2005 , 07:08 PM






Suppose I have arrays like this:


London]John Smith]Closed]3
Sydney]Adam Jones]Open]1
Mumbai]Dipak Patel]Closed]5
Auckland]John Gray]Closed]1
....etc

and...


220]Ian Jackson]Closed]A]Joe Bloggs
221]Ian Jackson]Open]C]Scott Ball
186]Mike Kezman]Closed]B]Joe Delany
429]Ian Jackson]Closed]D]Scott Ball
....etc

and other similarly structured arrays, and I want to convert them into
a more Pick-like form:


London]Sydney]Mumbai]Auckland]...etc
John Smith]Adam Jones]Dipak Patel]John Gray]...etc
Closed]Open]Closed]Closed]...etc
3]1]5]1]...etc

Is this the best way to go about it:

PORTRAIT.LINES=DCOUNT(ARY,@AM)
DIM PORTRAIT.MAT(PORTRAIT.LINES)
MATPARSE PORTRAIT.MAT FROM PORTRAIT.LINES,@AM
LANDSCAPE.LINES=DCOUNT(PORTRAIT.MAT(1),@VM)
DIM LANDSCAPE.MAT(LANDSCAPE.LINES)
MAT LANDSCAPE.MAT=''
FOR X=1 TO PORTRAIT.LINES
FOR Y=1 TO LANDSCAPE.LINES
LANDSCAPE.MAT(Y)<1,X>=PORTRAIT.MAT(X)<1,Y>
NEXT Y
NEXT X

Mike.


Reply With Quote
  #2  
Old   
michael@preece.net
 
Posts: n/a

Default Re: Quickest way to go from "portrait" to "landscape" - 10-05-2005 , 07:12 PM






PORTRAIT.LINES=DCOUNT(ARY,@AM)
DIM PORTRAIT.MAT(PORTRAIT.LINES)

MATPARSE PORTRAIT.MAT FROM ARY,@AM
===
LANDSCAPE.LINES=DCOUNT(PORTRAIT.MAT(1),@VM)
DIM LANDSCAPE.MAT(LANDSCAPE.LINES)
MAT LANDSCAPE.MAT=''
FOR X=1 TO PORTRAIT.LINES
FOR Y=1 TO LANDSCAPE.LINES
LANDSCAPE.MAT(Y)<1,X>=PORTRAIT.MAT(X)<1,Y>
NEXT Y
NEXT X


Reply With Quote
  #3  
Old   
michael@preece.net
 
Posts: n/a

Default Re: Quickest way to go from "portrait" to "landscape" - 10-05-2005 , 08:55 PM



This:

LANDSCAPE.LINES=DCOUNT(ARY<1>,@VM)
DIM LANDSCAPE.MAT(LANDSCAPE.LINES)
MAT LANDSCAPE.MAT=''
LSATT=1 ; LSMV=1
LOOP
REMOVE FIELD.DATA FROM ARY SETTING DELIM
LANDSCAPE.MAT(LSATT)<1,LSMV>=FIELD.DATA
IF DELIM=3 THEN LSATT+=1
IF DELIM=2 THEN LSMV+=1; LSATT=1
WHILE DELIM DO REPEAT

proved to be slightly quicker on UniData

Mike.


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.