ola a todos!
eu tnho umas pekenas duvidas e n sei komo resolver desde entao resolvi recurrer ao forum...
tenho as seguintes funçoes mas n sei ao cert como trabalham e seus objectivos.... s algm m poder ajudar....
Function userwrite(sData)
if not isnull(sData) then
userwrite = replace(server.HTMLEncode(sdata),chr(13)&chr(10),"<br>")
else
userwrite = ""
end if
End Function
<%Function SQLQuotes(sData)
If IsNull(sData) or sData = "" or len(sData)=0 Then
SQLQuotes = "''"
Else
SQLQuotes = "'" & Replace(sData,"'","''") & "'"
End If
End Function
Function GetValBDExt(sData,nulo)
dim rsfunc
call getRec(rsfunc,sData,3,3)
if not rsfunc.eof then
GetValBDExt = rsfunc(0)
else
GetValBDExt = nulo
end if
closeRec(rsfunc)
End Function
Function getRec(rsfunc,sData,CursorType,LockType)
set rsfunc = server.CreateObject("adodb.recordset")
rsfunc.open sData,cn,CursorType,CursorType
End Function
Function closeRec(byref rsfunc)
rsfunc.close()
set rsfunc = nothing
end function
Function executesql(sData)
cn.execute sdata
end function
Function getRec_conn(rsfunc,sData,CursorType,LockType,byref connect)
set rsfunc = server.CreateObject("adodb.recordset")
rsfunc.open sData,connect,CursorType,CursorType
End Function
Function executesql_conn(sData,byref connect)
connect.execute sdata
end function
Function fdata(ddata)
dim tipo
tipo = 4
if tipo=1 then
fdata = day(ddata) &" / "& month(ddata) &" / "& year(ddata)
elseif tipo=2 then
fdata = month(ddata) &" / "& day(ddata) &" / "& year(ddata)
elseif tipo=3 then
fdata = year(ddata) &" / "& day(ddata) &" / "& month(ddata)
elseif tipo=4 then
fdata = year(ddata) &"-"& month(ddata) &"-"& day(ddata)
else
fdata = ddata
end if
end function
function cur(valor,def)
dim tempreq
if valor<>"" then
if isnumeric(valor) then
tempreq = replace(valor,",",".")
else
tempreq = def
end if
else
tempreq = def
end if
cur = tempreq
end function
Function dataf(ddata)
dataf = day(ddata) &" / "& month(ddata) &" / "& year(ddata)
end function%>
Function chr13(sData)
dim str
str = replace(sData,chr(13)&chr(10),"")
if len(str)>0 then
chr13 = true
else
chr13 = false
end if
End Function
Function nchr13(sData)
dim str,flag,temp
flag = false
str = sData
while not flag
str = replace(str,vbcrlf&vbcrlf,vbcrlf)
temp = instr(1,str,vbcrlf&vbcrlf)
if temp=0 then
flag = true
end if
wend
nchr13 = str
End Function
Function RandomNumber(ByVal LowLimit, ByVal HiLimit)
Randomize
RandomNumber = Int((HiLimit - LowLimit + 1)*Rnd + LowLimit)
End Function
function date_ext(data)
Select Case datepart("w",data)
Case 1
Response.Write "Domingo, "
Case 2
Response.Write "Segunda-feira, "
Case 3
Response.Write "Terça-feira, "
Case 4
Response.Write "Quarta-feira, "
Case 5
Response.Write "Quinta-feira, "
Case 6
Response.Write "Sexta-feira, "
Case 7
Response.Write "Sábado, "
end select
Response.Write day(data)
Select Case month(data)
Case 1
Response.Write " de Janeiro de "
Case 2
Response.Write " de Fevereiro de "
Case 3
Response.Write " de Março de "
Case 4
Response.Write " de Abril de "
Case 5
Response.Write " de Maio de "
Case 6
Response.Write " de Junho de "
Case 7
Response.Write " de Julho de "
Case 8
Response.Write " de Agosto de "
Case 9
Response.Write " de Setembro de "
Case 10
Response.Write " de Outubro de "
Case 11
Response.Write " de Novembro de "
Case 12
Response.Write " de Dezembro de "
end select
Response.Write year(data)
end function
function getimagename(image)
dim temp
if image<>"" then
temp=split(image,"}_")
getimagename = temp(ubound(temp))
else
getimagename = ""
end if
end function
function existFile(sFilePathAndName)
dim oFS
Set oFS = Server.CreateObject("Scripting.FileSystemObject")
If oFS.FileExists(sFilePathAndName) Then
existFile = true
else
existFile = false
end if
Set oFS = Nothing
End function
Sub RemoveFile(sFilePathAndName)
dim oFS
Set oFS = Server.CreateObject("Scripting.FileSystemObject")
If oFS.FileExists(sFilePathAndName) Then
oFS.DeleteFile sFilePathAndName, True
end if
Set oFS = Nothing
End Sub
sub sendtomail(FromName,FromAddress,ToName,ToAddress,Subject,Body)
'Response.Write FromName & "<br>"
' Response.Write FromAddress & "<br>"
' Response.Write ToName & "<br>"
' Response.Write ToAddress & "<br>"
' Response.Write Subject & "<br>"
' Response.Write Body & "<br>"
dim Mailer
Set Mailer = Server.CreateObject("SMTPsvg.Mailer")
Mailer.CharSet = 2
Mailer.FromName = FromName
Mailer.FromAddress= FromAddress
Mailer.RemoteHost = "63.65.177.85"
Mailer.AddRecipient ToName, ToAddress
Mailer.Subject = Subject
Mailer.BodyText = Body
if not Mailer.SendMail then
Response.Write "Erro : " & Mailer.Response
Response.End
end if
end sub%>


