Dim CallLog As CallLog

wwregistry

Member
Licensed User
Longtime User
Dim CallLog As CallLog
can anybody make sense of this

in this tutorial
Basic4android - Phone

Dim Calls As List

Dim CallLog As CallLog

calls = CallLog.GetAll(10) 'Get the last 10 calls
For i = 0 To calls.Size - 1
Dim c As CallItem
c = calls.Get(i)
Dim callType, name As String
Select c.CallType
Case c.TYPE_INCOMING
callType="Incoming"
Case c.TYPE_MISSED
callType = "Missed"
Case c.TYPE_OUTGOING
callType = "Outgoing"
End Select
name = c.CachedName
If name = "" Then name = "N/A"
Log("Number=" & c.Number & ", Name=" & name _
& ", Type=" & callType & ", Date=" & DateTime.Date(c.Date))
Next
 

JesseW

Active Member
Licensed User
Longtime User
yes, this statement references both a variable name/identifier and an object type, both of which are 'CallLog'.

Dim [identifier] As [object type]

so...

Dim CallLog As CallLog

dimensions a new variable, names it CallLog, and creates it as a CallLog object. the confusion comes in when variable identifiers use the same name as their object type, as java will allow you to do.

if youre not sure what CallLog is or does, see here
 
Upvote 0
Top