September 17th, 2009, 08:50 AM
Please, need help in understanding the following functions
Public db as Database
Public textval , dtext, SString, Sendstr, Rtext As String
Public trs, rps, prs, Srs, Drs As Recordset
Public X, Eout1, bout1, out, Timeout1, As Integer
Public pch, pa, pb, attin, pc, As Integer
Public oldx, oldy, Maxv As Single
Public k, grval As Integer
Public t1, tt0, tt1, t2, t3, t4, tt2, Ecg1 As Double
Public p1, p2, p3, p4, Sal As String
Public Strt As Integer
Public Fnames(1 to 7) As String
Public Egra1(1 to 100) As Single
Public Fcnt As Integer
Public a(0 to 19) As Single
Public pt1, pt2 As Single
Public ptr, vvv, vvv2 Sarr(1 to 7) As Integer
Public Beat, Bcnt, Bflg, Tcount As Single
Public hcnt, hout As Integer
Public Declare Function Sleep Lib “kernel32” (ByVal dwMilliseconds As Long) As Long
Public objOutlook As New Outlook.Application
Public objOutlookMsg As Outlook.MailItem
Public pflg, sale, t1flg, t2flg, hflg1, finflg, myflg As Integer
Public Lg As Long
September 17th, 2009, 09:50 AM
Re: Please, need help in understanding the following functions
These are no functions at all, but are declarations of several variables.
Also I have to state that nearly all of these lines are WRONG.
Every variable has to declared explicitly like
Wrong: Public textval , dtext, SString, Sendstr, Rtext As String
only the Rtext is declared as string. The others become Variant, because they carry no AS statement.
Right: Public textval As String , dtext As String, SString As String, Sendstr As String, Rtext As String
Also right: Public textval$ , dtext$, SString$, Sendstr$, Rtext As String
This uses the shorthand $ for AS String.
Similar you can use % for AS Integer, ! for As Single, # for As Double and & for As Long.
Tags for this Thread
Click Here to Expand Forum to Full Width
This is a Codeguru.com survey!