Visualizzazione dei risultati da 1 a 5 su 5

Discussione: Più colonne

  1. #1
    Utente di HTML.it
    Registrato dal
    Dec 2003
    Messaggi
    102

    Più colonne

    Ho la seguente funzione
    -----------------------
    Private Function LoadKey()

    Dim FileObject
    Set FileObject=Server.CreateObject("Scripting.FileSyst emObject")

    Set Rst=FileObject.OpenTextFile(Server.MapPath("parole .txt"),1,False,False)
    S=Rst.ReadAll

    Rst.Close

    Set Rst = Nothing
    Set FileObject=Nothing

    S=replace(S,Chr(13), "
    ")
    Response.Write S

    End Function
    ---------------------
    Come faccio a stampare i risultati su 3 colonne?

  2. #2
    Utente di HTML.it
    Registrato dal
    Dec 2003
    Messaggi
    102

    Split

    Qualcuno mi può aiutare con split?
    Grazie

  3. #3
    Utente di HTML.it L'avatar di Corwin
    Registrato dal
    Jan 2002
    Messaggi
    584
    Nel file c'è una sola parola per riga ?
    I don't wanna have to shout it out / I don't want my hair to fall out
    I don't wanna be filled with doubt / I don't wanna be a good boy scout
    I don't wanna have to learn to count / I don't wanna have the biggest amount
    I don't wanna grow up

  4. #4
    Utente di HTML.it
    Registrato dal
    Dec 2003
    Messaggi
    102

    no

    Ci sono più parole per riga ma suddivise da un a capo

  5. #5
    Utente di HTML.it L'avatar di Corwin
    Registrato dal
    Jan 2002
    Messaggi
    584

    Re: no

    Originariamente inviato da francy_eb
    Ci sono più parole per riga ma suddivise da un a capo


    Private Function LoadKey()

    Dim FileObject
    Set FileObject=Server.CreateObject("Scripting.FileSyst emObject")

    Set Rst=FileObject.OpenTextFile(Server.MapPath("parole .txt"),1,False,False)
    S=Rst.ReadAll

    Rst.Close

    Set Rst = Nothing
    Set FileObject=Nothing
    Parole = Split (S,Chr(13))
    nCol = 3
    %>
    <table border="1">
    <%For x = 0 to ubound(parole)%>
    <%If (x mod ncol) = 0 Then%>
    <tr>
    <%End If%>
    <td><%response.write parole(x)%></td>
    <%if (x mod nCol) = ncol -1 then%>
    </tr>
    <%
    End if
    Next
    %>
    <%If (x mod ncol) <> 0 Then%>
    <%For y = (x mod ncol) to nCol -1%>
    <td>& nbsp;</td>
    <%Next%>
    </tr>
    <%end If%>
    </table>

    End Function
    I don't wanna have to shout it out / I don't want my hair to fall out
    I don't wanna be filled with doubt / I don't wanna be a good boy scout
    I don't wanna have to learn to count / I don't wanna have the biggest amount
    I don't wanna grow up

Permessi di invio

  • Non puoi inserire discussioni
  • Non puoi inserire repliche
  • Non puoi inserire allegati
  • Non puoi modificare i tuoi messaggi
  •  
Powered by vBulletin® Version 4.2.1
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved.