Get ready for BLACK FRIDAY shopping starting in

Forums

ASP

This topic is locked

ASP Vertical LOOPER

Posted 31 Mar 2004 15:32:23
1
has voted
31 Mar 2004 15:32:23 Ivo Vosan posted:
Please help me <img src=../images/dmxzone/forum/icon_smile.gif border=0 align=middle>. I need sort names vertical menu in table like
A E I
B F J
C G K
D H L

This is help for PHP
www.dmxzone.net/forum/topic.asp?TOPIC_ID=27397&FORUM_ID=67&CAT_ID=5&Topic_Title=Is+there+a+Vertical+Looper%3F&Forum_Title=PHP

Can you help me please?

Replies

Replied 31 Mar 2004 19:00:25
31 Mar 2004 19:00:25 Dave Thomas replied:
so you need a 3 column repeat region then yeah

you could download an extension for this called Hlooper2 but here is code to do it manually if you so wish.

you need to change table called tblData to your database table name, also the "Item" field to your own field name
ID - autonumber
Item - text field

&lt;%
DIM mySQL, objRS
mySQL = "SELECT * FROM tblData"
Set objRS = Server.CreateObject("ADODB.Recordset"
objRS.Open mySQL, objConn

DIM recCount
IF Not objRS.EOF THEN
Response.Write "&lt;table width='100%'&gt;"
recCount = 0
Do UNTIL objRS.EOF

IF recCount Mod 3 = 0 THEN

IF recCount &lt;&gt; 0 THEN
Response.Write "&lt;/tr&gt;"
Response.Write "&lt;tr&gt;&lt;td&gt;"&objRS("Item"&"&lt;/td&gt;"
ELSE
Response.Write "&lt;td&gt;"&objRS("Item"&"&lt;/td&gt;"
END IF

recCount = recCount + 1
objRS.MoveNext
Loop

Response.Write"&lt;/tr&gt;&lt;/table&gt;"
ELSE
Response.Write "Sorry, there are no records in our database."
END IF
%&gt;


The script will return all of the records in your tblData table and display them in a table on your page. Plus, it will display three records horizontally in a table row and then end the current row, start a new row, and display three more records. If you want to display more records horizontally, simply change the "3" in this line: IF recCount Mod 3 = 0 THEN to however many records you want to display in each row.


Regards,
Dave

[DWMX 2004]|[FlashMX 2004 Pro]|[Studio MX 2004]|[SQL]|[Access2000/2002]|[ASP/VBScript]|[XP-Pro]
If you like online gaming, please register @ www.nova-multigaming.com
Replied 08 Apr 2004 15:11:39
08 Apr 2004 15:11:39 Dave Thomas replied:
ok ive figured out how to do it for you.

how many records do you wish repeating? you going thru the whole alphabet a-z?

Regards,
Dave

[DWMX 2004]|[FlashMX 2004 Pro]|[Studio MX 2004]|[SQL]|[Access2000/2002]|[ASP/VBScript]|[XP-Pro]
If you like online gaming, please register @ www.nova-multigaming.com
Replied 14 Apr 2004 13:40:03
14 Apr 2004 13:40:03 Ivo Vosan replied:
Thank you for replay, I need sort only alphabet a-z but verticaly like
A E I
B F J
C G K
D H L
If I use Horizontal Looper2 for DM, then sort is
A B C D
E F G H...
......

Thanks Vosan..
Replied 15 Apr 2004 02:57:48
15 Apr 2004 02:57:48 Dave Thomas replied:
ok view this tutorial my marcello

www.dmxzone.com/showDetail.asp?TypeId=2&NewsId=531

this is what you need to follow, other than you need to create 3 repeat regions instead of 2 like in the example.

change your repeat code index number in the code and you will find it works.

im droning on, just follow the example and have fun <img src=../images/dmxzone/forum/icon_smile_tongue.gif border=0 align=middle>

Regards,
Dave

[DWMX 2004]|[FlashMX 2004 Pro]|[Studio MX 2004]|[SQL]|[Access2000/2002]|[ASP/VBScript]|[XP-Pro]
If you like online gaming, please register @ www.nova-multigaming.com
Replied 15 Apr 2004 14:07:42
15 Apr 2004 14:07:42 Ivo Vosan replied:
Excellent working OK, thank you very much <img src=../images/dmxzone/forum/icon_smile_big.gif border=0 align=middle>

Vosan.

Reply to this topic