String Problem

Results 1 to 3 of 3

Thread: String Problem

  1. #1
    Join Date
    Dec 1969

    Default String Problem

    I&#039;m trying to test a string with values against folders within a directory. If the values are present in the directory, then the folder won&#039;t display. It needs to check the string delimited by commas, and check for each value. Here&#039;s my code, can anyone tell me why this isn&#039;t working??<BR><BR><BR>site=(Request.QueryString ("site"))<BR><BR>mydir="/Sites/" & site<BR>Dim objFolder, objSubfolder, objFile<BR><BR>set objFSO=server.CreateObject("Scripting.FileSystemOb ject")<BR>set objFolder=objFSO.GetFolder(server.MapPath(mydir))< BR><BR>session("IgnoreDir")="cgi,_vti"<BR>mystr=sp lit(session("ignoredir"),",")<BR><BR> <BR> For each objSubFolder in objFolder.subfolders<BR>&#039; call check<BR> for i=0 to ubound(mystr)<BR> <BR> If Left(objSubFolder.Name, 3)= mystr(i) Then <BR>Response.Write "error"<BR> else%&#062;<BR> &#060;img src="../images/folder.gif"&#062;&nbsp&nbsp&#060;a href="files.asp?site=&#060;%=site%&#062;&departmen t=&#060;;"&#062; <BR> &#060;%Response.Write(;&#0 60;/a&#062; <BR> <BR><BR> &#060;%<BR> end if<BR><BR>next<BR>next<BR><BR>

  2. #2
    Aquarius Guest

    Default RE: String Problem

    The immediate problem that I can see is that you&#039;ll never match any of the vti_* files, because you&#039;re trying to match the four characters "vti_" against the first three characters of the filename. Is that what you meant by "not working"? I&#039;ve not tried running the code, so I don&#039;t know if it does something but not what you want, or whether it contains syntax errors.<BR><BR>Aq.<BR>

  3. #3
    Join Date
    Dec 1969

    Default How many different names can you use?

    I gave you the solution with the 3 character problem already. WHY are you not implementing it?<BR><BR>BTW -- trying to deceive us by using different names is frowned upon.

Posting Permissions

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