...

View Full Version : Creating new page trouble



Crash1hd
11-05-2003, 11:44 AM
I am trying to use the following code to view all the pictures in a folder! on a link! :)


If folderb.Size > 0 Then

Dim Vb,Tbar
Vb = 0
For Each file In folderb.Files
Vb = Vb + 1
Tbar = CCase(file.Name)&": <img border=0 src=/Images/Dividers/"&CCase(file.Name)&" align=center height=20 width=300><BR />"
Tbar = Tbar + Tbar
Next
Response.Write ""
End If

Response.Write ("<a href=""javascript:t='"&Tbar&"';with(document){write(t);void(close())}"" Target=_Blank>Click Here!</a>")

Yet it only shows the last file in the folder only! how can I get it to show all the files in the folder?

A1ien51
11-05-2003, 02:04 PM
lol

you are writing over it all the time that is why you are only getting the last pic....

TBAR = "blah"
TBAR = TBAR & TBAR

ALSO DO NOT USE PLUS!!!!

Now do you see your problem??

Crash1hd
11-05-2003, 06:55 PM
I do see that it is writing over itself problem being is that
Tbar & Tbar or Tbar + Tbar both give the same output wich is the last image 2 times?

However the following code works I just need to figure out how to get the editing program to stop it from changing the code?

<a href="javascript:t=' <%
If folderbb.Size > 0 Then
Dim Vbb,Tbar
Vbb = 0
For Each file In folderbb.Files
Vbb = Vbb + 1
Response.Write CCase(file.Name)&": <img border=0 src=/Images/Dividers/"&CCase(file.Name)&" align=center height=20 width=300><BR />"
Next
End If
%>
';with(document){write(t);}" Target=_Blank>
Click Here!</a>

it for some reason after saving changes the same code to

<a href="javascript:t=' <% If folderbb.Size > 0 Then Dim Vbb,Tbar Vbb = 0 For Each file In folderbb.Files Vbb = Vbb + 1 Response.Write CCase(file.Name)&": <img border=0 src=/Images/Dividers/"&CCase(file.Name)&" align=center height=20 width=300><BR />" Next End If %> ';with(document){write(t);}" Target=_Blank>
Click Here!</a>

makes it one line if anyone knows how to make front page stop from editing code please let me know!

P.s. I know front page sucks as an editing tool I use it like it was an advanced version of notepad with colors :) I dont use any other part!

A1ien51
11-05-2003, 09:13 PM
look for EditPlus2 they have a free trial....

What I was saying above was that you are only seeing the last since it keeps rewrting over the string...If you change the First Tbar to another name then you would get the list...



If folderb.Size > 0 Then
Dim Vb,Tbar,Tbar2
Vb = 0
For Each file In folderb.Files
Vb = Vb + 1
Tbar2 = CCase(file.Name)&": <img border=0 src=/Images/Dividers/"&CCase(file.Name)&" align=center height=20 width=300><BR />"
Tbar = Tbar & Tbar2
Next
End If

Roy Sinclair
11-05-2003, 10:05 PM
FrontPage has options that you can set to tell it not to reformat code and you can also tell it exactly how to reformat code when you let it perform a reformat. Take some time and explore the program menus.

I can't tell you exactly how because I haven't used it for years but I do remember that was possible.

Crash1hd
11-06-2003, 12:51 AM
A1ien51 You are a Genius lol :) No Really I mean that I went left when you where trying to get me to go right! Better yet I think I understand your logic? :) Also I dont have to worry about sloppy code thankyou :)

P.S. I know that this is not the javascript forum but does anyone know if the Javascript: has a limit to the length and if so is there a way to break that limit?


EditPlus2 Not too bad of a program the problem I have is it adds too much color to the text, I have to say I think that is the only thing that front page did right was simplify the color so that all javascript and all asp and all html are different colors! not each part is different colors! but I will give it a try?

A1ien51
11-06-2003, 03:39 AM
You can customize the colors to whatever you want
under
tools---preferences---syntax tag----pick the html/javascript etc and it will show you the colors

*Do not worry about the trial peroid*



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum