Android Question Is there something like this in B4A?

RVP

Active Member
Licensed User
Longtime User
I another language I used you can define what they call a StringTemplate, for accessing and working with data

Something like this:

DIM MYTPL:"CustId:C(6),Name:C(20),Addr1:C(30),City:C(14),Phone:N(20),Balance[2]:N(10)"

Then you can populate the fields:

MYTPL.CustId = "Fred"
MYTPL.Balance =100
MYTPL.Balance[1] = 20
MYTPL.Balance[2] = 120

or retrieve them
DIM A as string
A = MYTPL.CustId

Or you can do:


DIM A as string
A = "CustId"
FIELD MYTPL,A = "Fred"
OR

localcustid = FIELD(MYTPL,A)

DIM A as string
A= FATTR(MYTPL)

give you back the template definition

Lots more stuff, but it makes it very easy to pass data around as well as save and retrieve it
 

DonManfred

Expert
Licensed User
Longtime User
MAybe you are searching for custom TYPEs?
B4X:
Type MYTPL (CustId As Int, Name As String, Addr1 As String, City As String,TelePhone As String, Balance As Int, n As String)
B4X:
Dim test As MYTPL
test.Name = "Manfred"
test.City = "Düren"
test.CustId = 0815
test.TelePhone = "secret"
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…