#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 97
Default Please Help

I need to figure out how to write a loop that will do the
following things. I need to arrange a spreadsheet that
contains information on lines into an ordered fashion.
The first column says the line number. The next three
columns tell the children of the line. For example if
101, 102, and 103 are connected to 100, 100 would be
listed with three children (101, 102, and 103). Here is
what the file looks like if 101, 102, and 103 also had
children.

Line Child Child Child
100 101 102 103
101 104
104
102 105 106
105
106
103 107
107

This file would denote line 100 as the starting line.
100 branches into three other lines (101, 102, and 103).
101 branches into 104. 104 has no children. 102 then
branches itno 105 and 106. Etc...

The file that I just showed is ordered. However, my file
is not. I know what line is the first line and have
already written the part of the program to move that line
to the beginning of the file. However, I need to write a
loop that will pick the first child and list it next.
Then it will list that child's children next. If it
doesn't have any children, it will go back to the last
child that hasn't been listed and go from there. Like I
said, the file that I listed is organized in the fashion
that I need. I don't know what types of loops to write
or how to get started. Thank you very very much. If you
need any other information, I can provide it. Thanks
again.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 38
Default Please Help

What does the 'unordered' file look like? It would be helpful to have a
before and after image.
Paul D

"John" wrote in message
...
I need to figure out how to write a loop that will do the
following things. I need to arrange a spreadsheet that
contains information on lines into an ordered fashion.
The first column says the line number. The next three
columns tell the children of the line. For example if
101, 102, and 103 are connected to 100, 100 would be
listed with three children (101, 102, and 103). Here is
what the file looks like if 101, 102, and 103 also had
children.

Line Child Child Child
100 101 102 103
101 104
104
102 105 106
105
106
103 107
107

This file would denote line 100 as the starting line.
100 branches into three other lines (101, 102, and 103).
101 branches into 104. 104 has no children. 102 then
branches itno 105 and 106. Etc...

The file that I just showed is ordered. However, my file
is not. I know what line is the first line and have
already written the part of the program to move that line
to the beginning of the file. However, I need to write a
loop that will pick the first child and list it next.
Then it will list that child's children next. If it
doesn't have any children, it will go back to the last
child that hasn't been listed and go from there. Like I
said, the file that I listed is organized in the fashion
that I need. I don't know what types of loops to write
or how to get started. Thank you very very much. If you
need any other information, I can provide it. Thanks
again.



  #3   Report Post  
Posted to microsoft.public.excel.programming
No Name
 
Posts: n/a
Default Please Help

The before file would look like this:

Line Child Child Child
100 101 102 103
107
105
102 105 106
103 107
104
106
101 104


The after file would like this:

Line Child Child Child
100 101 102 103
101 104
104
102 105 106
105
106
103 107
107

Like I said, I already wrote the program to move the
first line to the top. It does that from other data that
I haven't listed. That is why line 100 is at the top in
both. These aren't the exact files. The real file is
much bigger, but if I can get a program to work for this
little line, it will work for the big one. Thank you so
very much.


-----Original Message-----
What does the 'unordered' file look like? It would be

helpful to have a
before and after image.
Paul D

"John" wrote in

message
...
I need to figure out how to write a loop that will do

the
following things. I need to arrange a spreadsheet that
contains information on lines into an ordered fashion.
The first column says the line number. The next three
columns tell the children of the line. For example if
101, 102, and 103 are connected to 100, 100 would be
listed with three children (101, 102, and 103). Here

is
what the file looks like if 101, 102, and 103 also had
children.

Line Child Child Child
100 101 102 103
101 104
104
102 105 106
105
106
103 107
107

This file would denote line 100 as the starting line.
100 branches into three other lines (101, 102, and

103).
101 branches into 104. 104 has no children. 102 then
branches itno 105 and 106. Etc...

The file that I just showed is ordered. However, my

file
is not. I know what line is the first line and have
already written the part of the program to move that

line
to the beginning of the file. However, I need to

write a
loop that will pick the first child and list it next.
Then it will list that child's children next. If it
doesn't have any children, it will go back to the last
child that hasn't been listed and go from there. Like

I
said, the file that I listed is organized in the

fashion
that I need. I don't know what types of loops to write
or how to get started. Thank you very very much. If

you
need any other information, I can provide it. Thanks
again.



.

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 38
Default Please Help

This appears to be a rather tricky sort. I will try to work on it but I
make no promises. Hopefully someone else will throw in some suggestions.
Paul D

wrote in message
...
The before file would look like this:

Line Child Child Child
100 101 102 103
107
105
102 105 106
103 107
104
106
101 104


The after file would like this:

Line Child Child Child
100 101 102 103
101 104
104
102 105 106
105
106
103 107
107

Like I said, I already wrote the program to move the
first line to the top. It does that from other data that
I haven't listed. That is why line 100 is at the top in
both. These aren't the exact files. The real file is
much bigger, but if I can get a program to work for this
little line, it will work for the big one. Thank you so
very much.


-----Original Message-----
What does the 'unordered' file look like? It would be

helpful to have a
before and after image.
Paul D

"John" wrote in

message
...
I need to figure out how to write a loop that will do

the
following things. I need to arrange a spreadsheet that
contains information on lines into an ordered fashion.
The first column says the line number. The next three
columns tell the children of the line. For example if
101, 102, and 103 are connected to 100, 100 would be
listed with three children (101, 102, and 103). Here

is
what the file looks like if 101, 102, and 103 also had
children.

Line Child Child Child
100 101 102 103
101 104
104
102 105 106
105
106
103 107
107

This file would denote line 100 as the starting line.
100 branches into three other lines (101, 102, and

103).
101 branches into 104. 104 has no children. 102 then
branches itno 105 and 106. Etc...

The file that I just showed is ordered. However, my

file
is not. I know what line is the first line and have
already written the part of the program to move that

line
to the beginning of the file. However, I need to

write a
loop that will pick the first child and list it next.
Then it will list that child's children next. If it
doesn't have any children, it will go back to the last
child that hasn't been listed and go from there. Like

I
said, the file that I listed is organized in the

fashion
that I need. I don't know what types of loops to write
or how to get started. Thank you very very much. If

you
need any other information, I can provide it. Thanks
again.



.



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 09:30 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"