Numero de linea de mis sentencias
HOla.estoy programando en VBScript....y necesito saber como puedo averiguar el numero de linea en que se encuentra una sentencia cualquiera...es decir si existe alguna funcion o forma de poder hacer esto...dedsde ya muchas gracias
Espero que te sirva
dim i as integer
dim bol as boolean
dim numfile as integer
dim numreg as integer
dim FUNCIONBUSCADA as string
dim registro as string
dim aux as string
numfile = freefile
open "ARCHIVO" for input as #numfile
numreg=0
bol = false
while not eof(numfile) and not bol
input #numfile, registro
numreg = numreg + 1
i = 1
while i <= len(registro) - len(FUNCIONBUSCADA) + 1
aux=mid(registro,i,len(FUNCIONBUSCADA))
if aux = FUNCIONBUSCADA then
bol = true
i = 10000
end if
i=i+1
wend
wend
close #numfile
if not bol then
msgbox("la func no está")
else
msgbox("la func está en la linea: " & numreg)
end if
Saludos de Baires
dim i as integer
dim bol as boolean
dim numfile as integer
dim numreg as integer
dim FUNCIONBUSCADA as string
dim registro as string
dim aux as string
numfile = freefile
open "ARCHIVO" for input as #numfile
numreg=0
bol = false
while not eof(numfile) and not bol
input #numfile, registro
numreg = numreg + 1
i = 1
while i <= len(registro) - len(FUNCIONBUSCADA) + 1
aux=mid(registro,i,len(FUNCIONBUSCADA))
if aux = FUNCIONBUSCADA then
bol = true
i = 10000
end if
i=i+1
wend
wend
close #numfile
if not bol then
msgbox("la func no está")
else
msgbox("la func está en la linea: " & numreg)
end if
Saludos de Baires
