Visualizzazione dei risultati da 1 a 3 su 3

Discussione: info su split

  1. #1
    Utente di HTML.it
    Registrato dal
    Sep 2002
    Messaggi
    283

    info su split

    Ciao a tutti o da effettuare uno split su alcuni record che come testo hatto:

    testo1#testo2#testo3
    testo1#testo2
    testo1#testo2#testo3#testo4

    cioè ho bisogno di estrarre in alcuni casi il testo1 in altri casi il testo3 o il testo4

    ho realizzato questo script ma per il testo1 funziona mentre per gli altri casi mi lascia gli spazi

    <% set rs=db.execute("select * from tabella order by campo1, campo2

    if not rs.eof then
    rs.movefirst
    while not rs.eof

    MyString=split(rs("campo1"),"~")

    for r=ubound(mystring) to ubound(mystring)
    for k = 0 to ubound(mystring)
    next

    '----ESTRAE IL TESTO1
    if ubound(mystring)=0 then
    response.write MyString(r)
    end if


    next %
    <% rscatm.movenext
    wend
    end if %>


    PER IL TESTO2 E GLI ALTRI CASI CAMBIO 0 CON 1 OPPURE 2 ECC.
    FUNZIONA MA LASCIA DEGLI SPAZI TRA OGNI RECORD.
    ESEMPIO

    if ubound(mystring)=2 then
    response.write MyString(r)
    end if

    scrive

    testo2

    testo2


    testo2

  2. #2
    Utente di HTML.it
    Registrato dal
    Sep 2002
    Messaggi
    283
    correggo

    MyString=split(rs("campo1"),"#")

  3. #3
    codice:
    for r=lbound(mystring) to ubound(mystring)
    for k = 0 to ubound(mystring)
    next

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.