I suppose this is more of a general question than an Android specific one, but... Is it possible to define the default initialization state of a CustomType?
for example, I have this:
B4X:
Type GameOptionsData(HornEnable As Boolean, LightingEnable As Boolean, RetainLighting As Boolean, ShotClockEnable As Boolean, ShotClockHornEnable As Boolean, DualLink As Boolean, ClockPreset1 As String, ClockPreset2 As String, ClockPreset3 As String, TeamFoulLimit As Int, ShotClockLightingEnable As Boolean, _
TimeoutSide As Int, TimeoutVisible As Boolean, PlayerFoulSide As Int)
Public GameOptions As GameOptionsData
Instead of doing .Initialize and then setting up all the variables of the values that they are supposed to be manually, like TimeoutVisible = True. its initialized as False by default of course
Any way to set/change this behavior? Like when you do something such as Dim XYZ as Boolean = True
I know that, but I am trying to see if theres any potential to shorten the number of lines of code. because "Defaults" for me mean something different. I need to set some options to true, while others false, some of the Ints to specific values.
Im trying to avoid 473853473847 lines of code to do that, just curious if there was a way to "define" default values so when initialized itll set to what i had them specified.
You can use the "Generate 'Create Type' Sub" method to generate the sub. You can edit the sub like you need to have it.
Setting some defaults to true, others to false, what ever.
I know that, but I am trying to see if theres any potential to shorten the number of lines of code. because "Defaults" for me mean something different. I need to set some options to true, while others false, some of the Ints to specific values.
Im trying to avoid 473853473847 lines of code to do that, just curious if there was a way to "define" default values so when initialized itll set to what i had them specified.