Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
 From: Anders Altberg
  Where is Anders Altberg?
 Uppsala
 Sweden
 Anders Altberg
 To: Tahir Iqbal
  Where is Tahir Iqbal?
 Lahore
 Pakistan
 Tahir Iqbal
 Tags
Subject: RE: Devide Rows
Thread ID: 373581 Message ID: 373590 # Views: 41 # Ratings: 0
Version: Visual FoxPro 9 Category: Forms
Date: Saturday, March 23, 2013 8:20:38 PM         
   


> I have following data
>
>
> Create Cursor diary (names c(10), mobile c(3))
> 
> Insert Into diary Values("A","123")
> Insert Into diary Values("F","128")
> Insert Into diary Values("C","147")
> Insert Into diary Values("E","654")
> Insert Into diary Values("X","258")
> 
> 

>
> I want to show this data into diary2 as
>
> Create Cursor diary2 (names c(10))
>
> A
> 123
> F
> 128
> C
> 147
> E
> 654
> X
> 258
>
> First column will be first row and second column will be second row.

You can do that in a Grid if you set
Grid.View = 1

In a ListBox or ComboBox you can do it if you have a RowSourceType= array and redimension the orginally 2-dimenional array to a 1- dimensional array.

Create Cursor diary (names c(10), mobile c(3))
Insert Into diary Values("A","123")
Insert Into diary Values("F","128")
Insert Into diary Values("C","147")
Insert Into diary Values("E","654")
Insert Into diary Values("X","258")

SELECT * FROM Diary INTO ARRAY aa
DIMENSION aa(ALEN(aa,1)*ALEN(aa,2),1)

CREATE CURSOR Diary2 (name c(10))
INSERT INTO Diary2 FROM ARRAY aa
BROWSE LAST NOWAIT 

Name      	
A
123
F
128
C
147
E
654
X
258


May I ask why? To me it's just inviting users' misreadings.
-Anders

ENTIRE THREAD

Devide Rows Posted by Tahir Iqbal @ 3/23/2013 5:19:50 PM
RE: Devide Rows Posted by Tariq Mehmood @ 3/23/2013 5:46:26 PM
RE: Devide Rows Posted by Anders Altberg @ 3/23/2013 8:20:38 PM