CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2

Hybrid View

  1. #1
    Join Date
    Sep 2009
    Posts
    14

    Please, need help in understanding the following functions

    Module1
    Option Explicit
    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

  2. #2
    Join Date
    Jul 2006
    Location
    Germany
    Posts
    3,725

    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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured