I have a question about Maps. Below is a small excerpt of my class "Customer".
Is the variable "Customer.CustomerId" and the hash key for the first record point to the same variable?
In other words, is
Customer.CustomerId is the same as Record.GetValue("CustomerId")
I am trying, but it doesn't work as expected:
Maybe I don't understand how maps work...
Thanks for any advice about this...
Edgard
B4X:
'Class = "Customer"
Sub Class_Globals
Public CustomerID As String
Public CompanyName As String
Public Record As Map ' Key=FieldName, Value=FieldObject
End Sub
Public Sub Initialize
'Initialize the table "record"...
Record.Initialize
Record.Put("CustomerID",CustomerID)
Record.Put("CompanyName",CompanyName)
End Sub
Is the variable "Customer.CustomerId" and the hash key for the first record point to the same variable?
In other words, is
Customer.CustomerId is the same as Record.GetValue("CustomerId")
I am trying, but it doesn't work as expected:
B4X:
' In the activity module....
Sub Globals
Private Cus As Customer ' Declare an instance of the class
End Sub
Sub Activity_Create(FirstTime As Boolean)
Cus.CustomerId = "Testing..."
MsgBox(Cus.Record.GetValueAt(1)) 'Gives an empty string....
End Sub
Maybe I don't understand how maps work...
Thanks for any advice about this...
Edgard