Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 7 of 7
  1. #1
    Regular Coder
    Join Date
    Jul 2002
    Location
    51° 03' -78" N -114° 05' 72" W
    Posts
    617
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Creating new page trouble

    I am trying to use the following code to view all the pictures in a folder! on a link!

    Code:
    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?

  • #2
    Senior Coder A1ien51's Avatar
    Join Date
    Jun 2002
    Location
    Between DC and Baltimore In a Cave
    Posts
    2,717
    Thanks
    1
    Thanked 94 Times in 88 Posts
    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??

  • #3
    Regular Coder
    Join Date
    Jul 2002
    Location
    51° 03' -78" N -114° 05' 72" W
    Posts
    617
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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!
    Last edited by Crash1hd; 11-05-2003 at 06:22 PM.

  • #4
    Senior Coder A1ien51's Avatar
    Join Date
    Jun 2002
    Location
    Between DC and Baltimore In a Cave
    Posts
    2,717
    Thanks
    1
    Thanked 94 Times in 88 Posts
    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...

    Code:
    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

  • #5
    Senior Coder
    Join Date
    Jun 2002
    Location
    Wichita
    Posts
    3,880
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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.
    Check out the Forum Search. It's the short path to getting great results from this forum.

  • #6
    Regular Coder
    Join Date
    Jul 2002
    Location
    51° 03' -78" N -114° 05' 72" W
    Posts
    617
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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?
    Last edited by Crash1hd; 11-06-2003 at 12:20 AM.

  • #7
    Senior Coder A1ien51's Avatar
    Join Date
    Jun 2002
    Location
    Between DC and Baltimore In a Cave
    Posts
    2,717
    Thanks
    1
    Thanked 94 Times in 88 Posts
    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*


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •