Hi just a little back ground, but as a child I had an illness and I forgot a lot of stuff, it also seems to hinder me today as I cannot grasp some principles!
I can use B4A and J just fine, BUT I do everything the simple way!
Im trying to rewrite my code, but cannot work out certain things due to this block!
Arrays! I understand the basics but cant visualise them making them hard for me to use, so i don't use them! and this is my major problem!
At present I hard code everything, meaning my programs work but are hard to change! a simple change like adding something in the middle of a list requires me to do a huge amount of work!
The basic idea is based on something like lets say playstore
So I have :
a url of my package
a name of my package
a screen shot of my package
a few more bits of info about my package!
currently I have all this hard coded in the app! i understand how I would do ONE! via a settings file or xml variant with tags. but I dont know how I could read a list of more than one and put all the info in the right place! (not that i dont know, more I cannot understand or get it to lock in my head)
So I am asking if someone could show me how to do this!?
file sample i would like to use
<url>http://myapp.com/app1</url>
<name>"app name"</name>
<imageurl>http://myapp.com/app1</imageurl>
<counter>1020</counter>
<someotherinfo>blah blah</someotherinfo>
now i could read this easy!
but if i added another record how would i read that?
<url>http://myapp.com/app2</url>
<name>"app name"</name>
<imageurl>http://myapp.com/app2</imageurl>
<counter>145020</counter>
<someotherinfo>blah blah</someotherinfo>
<url>http://myapp.com/app3</url>
<name>"app name"</name>
<imageurl>http://myapp.com/app3</imageurl>
<counter>1023420</counter>
<someotherinfo>blah blah</someotherinfo>
currently i add each item to a list, all in code, then i have a lot of code to determine the current item in the list. so if item number 10 is selected, I would have something like
and so on, but as you can imagine (my list only has 40 items) and i like it in alphabetical order, So if i need to add something in the middle I have a lot of code to change.
Im not asking for you to write it, rather explain in some alternative way that my brain will absorb, or point to various examples that i can look at and try to understand.
Currently the code I am using to add to the list is about 10 lines but repeated 40 times! the code i use when the list is selected is also about 8 lines but also repeated about 40 times!
Anyone able to help at all! I have read and read many books on basic but as I say the mental block, will not let me visualise arrays.
If anyone can help i would be very grateful!
Thanks
Aidy
I can use B4A and J just fine, BUT I do everything the simple way!
Im trying to rewrite my code, but cannot work out certain things due to this block!
Arrays! I understand the basics but cant visualise them making them hard for me to use, so i don't use them! and this is my major problem!
At present I hard code everything, meaning my programs work but are hard to change! a simple change like adding something in the middle of a list requires me to do a huge amount of work!
The basic idea is based on something like lets say playstore
So I have :
a url of my package
a name of my package
a screen shot of my package
a few more bits of info about my package!
currently I have all this hard coded in the app! i understand how I would do ONE! via a settings file or xml variant with tags. but I dont know how I could read a list of more than one and put all the info in the right place! (not that i dont know, more I cannot understand or get it to lock in my head)
So I am asking if someone could show me how to do this!?
file sample i would like to use
<url>http://myapp.com/app1</url>
<name>"app name"</name>
<imageurl>http://myapp.com/app1</imageurl>
<counter>1020</counter>
<someotherinfo>blah blah</someotherinfo>
now i could read this easy!
but if i added another record how would i read that?
<url>http://myapp.com/app2</url>
<name>"app name"</name>
<imageurl>http://myapp.com/app2</imageurl>
<counter>145020</counter>
<someotherinfo>blah blah</someotherinfo>
<url>http://myapp.com/app3</url>
<name>"app name"</name>
<imageurl>http://myapp.com/app3</imageurl>
<counter>1023420</counter>
<someotherinfo>blah blah</someotherinfo>
currently i add each item to a list, all in code, then i have a lot of code to determine the current item in the list. so if item number 10 is selected, I would have something like
B4X:
Case 10
url="http://myapp.com/app1"
and so on, but as you can imagine (my list only has 40 items) and i like it in alphabetical order, So if i need to add something in the middle I have a lot of code to change.
Im not asking for you to write it, rather explain in some alternative way that my brain will absorb, or point to various examples that i can look at and try to understand.
Currently the code I am using to add to the list is about 10 lines but repeated 40 times! the code i use when the list is selected is also about 8 lines but also repeated about 40 times!
Anyone able to help at all! I have read and read many books on basic but as I say the mental block, will not let me visualise arrays.
If anyone can help i would be very grateful!
Thanks
Aidy