Android Question create a child sub into parent sab

ArminKH

Well-Known Member
hi
if you see Picasso lib we have so subs in this library
and one of this subs is "LoadFile" but on this sub we have too many other subs such as Fetch and...
B4X:
dim Picasso1 as Picasso
Picasso1.LoadFile.Fetch
now i want to create a library which that has child subs to one parent sub(Subs to Sub)
maybe my code can be similar to following codes
B4X:
Sub Result
    Sub male() As String
        Return "Male"
    End Sub
 
    Sub Female() As String
        Return "Female"
    End Sub
End Sub

Sub Activity_Create(FirstTime As Boolean)
    Dim A As MyLib
        Log(A.Result.male)
End Sub
how is possible same future on B4A??!!
thanx to all
 

RandomCoder

Well-Known Member
Licensed User
Longtime User
Ok try this, I think it achieves what you want?
 

Attachments

  • ClassTest2.zip
    5.4 KB · Views: 261
Upvote 0

ArminKH

Well-Known Member
Ok try this, I think it achieves what you want?
aa.png
 
Upvote 0

RandomCoder

Well-Known Member
Licensed User
Longtime User
Have you remembered to refresh your libraries for the changes to take effect?




For some reason I am not seeing the same as you?
I managed to achieve this by following the advise from @LucaMs in his earlier posting create a child sub into parent sab

If you look in the XML file for the created library you will see that I have removed the initialize method and under ClassB I have given an empty string for the shortname.
 
Upvote 0

ArminKH

Well-Known Member
Have you remembered to refresh your libraries for the changes to take effect?




For some reason I am not seeing the same as you?
I managed to achieve this by following the advise from @LucaMs in his earlier posting create a child sub into parent sab

If you look in the XML file for the created library you will see that I have removed the initialize method and under ClassB I have given an empty string for the shortname.
i think u forgot to attach modiffied version of compiled lib
i just compile your ClassTest sample to library and then use that to ClassTest2
 
Upvote 0

RandomCoder

Well-Known Member
Licensed User
Longtime User
Ah you are correct, I forgot that the libraries don't get included in the zip file. Sorry about that.
If you compare the attached XML file with the file that is generated when creating the library in the first place you will see which lines I have modified. I'm not sure if this is the correct way to achieve this but it appears to work.
 

Attachments

  • ClassTest.xml
    1.1 KB · Views: 281
  • ClassTest.jar
    2.3 KB · Views: 216
Upvote 0

ArminKH

Well-Known Member
Ah you are correct, I forgot that the libraries don't get included in the zip file. Sorry about that.
If you compare the attached XML file with the file that is generated when creating the library in the first place you will see which lines I have modified. I'm not sure if this is the correct way to achieve this but it appears to work.
thank u so much now all things works perfectly
i know maybe this way is not a standard way but thats perfectly works and for now this is enough for me
thank u again ;)
 
Upvote 0
Top