[duvida] FUNÇOES

PHP, Java, JavaScript, XML, XHTML, HTML, CSS, ASP, Delphi, Assembly, LaTeX, C, UML, Flash, Perl, SQL, Python, Zope, Pascal, WML. Se conhece mais de 3 siglas referidas, este é o forum para si.

Moderadores: Administradores, Moderadores

[duvida] FUNÇOES

Mensagempor boinex » Quarta Fev 06, 2008 15:06

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%>
Editado pela última vez por boinex em Quarta Fev 06, 2008 17:14, num total de 1 vez.
boinex
Novato
Novato
 
Mensagens: 2
Registado: Quarta Fev 06, 2008 15:04

Mensagempor bvmzinho » Quarta Fev 06, 2008 16:14

btnext? 8O
MacBook Pro 2.2GHz
bvmzinho
Membro de Prata
Membro de Prata
 
Mensagens: 362
Registado: Sábado Jan 15, 2005 17:25

Mensagempor boinex » Quarta Fev 06, 2008 17:13

enganei m!

:)


ningm m da umas dicas???


kumps!
boinex
Novato
Novato
 
Mensagens: 2
Registado: Quarta Fev 06, 2008 15:04

Mensagempor bvmzinho » Quarta Fev 06, 2008 19:21

mas o código não é teu? que é suposto fazer?

que linguagem é?

tenta ser mais explicito...
MacBook Pro 2.2GHz
bvmzinho
Membro de Prata
Membro de Prata
 
Mensagens: 362
Registado: Sábado Jan 15, 2005 17:25

Mensagempor Fenrir » Sexta Fev 08, 2008 14:10

o código é Visual Basic ou VB.NET.

Cá para mim aprendias num tutorial sobre VB.

Não é uma linguagem que domine logo não te posso ajudar, mas acho que pelos nomes das funções daria para entender o que fazem, não?

Em ultimo caso, pergunta a quem as fez.
Avatar do Utilizador
Fenrir
Membro de Prata
Membro de Prata
 
Mensagens: 354
Registado: Segunda Set 20, 2004 22:33
Localização: Porto


Voltar para Programação

Quem está ligado:

Utilizadores a ver este Fórum: Nenhum utilizador registado e 0 visitantes

cron