Hi Dave,
I was not able to sleep, so I fired Xojo and here I am:
I put two TextAreas in a window. The left one is named TA_Source and holds 50 Names of songs Elvis Presley sings:
Adam and Evil
After Loving You
Aint That Lovin You, Baby
All I Needed Was the Rain
All Shook Up
All That I Am
Allá en el Rancho Grande
Almost
Almost Always True
Almost in Love
Baby Lets Play House
Baby What You Want Me to Do
Baby, If Youll Give Me All of Your Love
Barefoot Ballad
Beach Boy Blues
Beach Shack
Because of Love
Beginners Luck
Beyond the Bend
Beyond the Reef
Cmon Everybody
Columbus Stockade Blues
Come Along
Come What May
Confidence
Cotton Candy Land
Cottonfields
Could I Fall in Love
Crawfish
Crazy Arms
Dainty Little Moonbeams
Danny
Danny Boy
Dark Moon
Datin
Didja Ever
Dirty, Dirty Feeling
Dixieland Rock
Do Not Disturb
Do the Clam
Early Morning Rain
Earth Angel
Earth Boy
Easy Come, Easy Go
Echoes of Love
Edge of Reality
El Toro
End of the Road
An Evening Prayer
Everybody Come Aboard
The second TextArea is TA_Results and will display the <tr><td></td></tr>
Rows.
I do not create a db: you have one; I do not add the html prefix, table declaration / end and html suffix: you know how to.
I only wrote code to generate the html rows how you wanted to. Look below:
[code] // Split the TA_Source contents in an array for speed
Dim Source(-1) As String
Dim Loop_Idx As Integer
Source = Split(ReplaceLineEndings(TA_Source.Text,EndOfLine),EndOfLine)
For Loop_Idx = 0 To 9
// Place the song names in a html Row (5 cells)
TA_Result.SelText = “” + Source(Loop_Idx) + “” + EndOfLine
TA_Result.SelText = “” + Source(Loop_Idx + 10) + “” + EndOfLine
TA_Result.SelText = “” + Source(Loop_Idx + 20) + “” + EndOfLine
TA_Result.SelText = “” + Source(Loop_Idx + 30) + “” + EndOfLine
TA_Result.SelText = “” + Source(Loop_Idx + 40) + “” + EndOfLine
// Add an empty line for readability
TA_Result.SelText = EndOfLine
// To avoid infinite loop
If UserCancelled Then Exit
Next[/code]
Et voilà the result for the first row:
[code]Adam and Evil
Baby Lets Play House
Cmon Everybody
Dainty Little Moonbeams
Early Morning Rain[/code]
More explanation:
I had two problems:
a. I was unable to wrote what I had in mind. In fact I was wrong on the implementation.
b. With a wrong information, it is hard to understand: in this case, you know far better than me.
This is an autodidact kind of work.
Now if someone can write that better than what is above (more efficient, more academic), feel free to share it. I love to learn new things.
To be totalled honest, I am a bit ashamed to show that code. Sometimes my code do the job but I think it is the result of a dirty programmer’s job.
Dave: I hope this is what you want to achieve.