Olaan Expert Licensed User Longtime User Aug 15, 2023 #1 refer to: https://www.b4x.com/android/forum/threads/map-collection-the-most-useful-collection.60304/#content Now I have the old code Code: CLV1.Add(CreateItem(CLV1.AsView.Width,"Low Price",1000),"") CLV1.Add(CreateItem(CLV1.AsView.Width,"Medium Price",10000),"") CLV1.Add(CreateItem(CLV1.AsView.Width,"High Price",10000000),"") I would like to use Map collection,but there is my mistake which I don't understand it. Code: Dim Products As Map =CreateMap("Low Price":1000,"Medium Price":10000,"High Price":10000000) For Each Products As String In Products.Keys Dim Price As Float=Products.Get(Products) CLV1.Add(CreateItem(CLV1.AsView.Width,${Products},{Price}),"") '<==This line is my problem Next Last edited: Aug 16, 2023
refer to: https://www.b4x.com/android/forum/threads/map-collection-the-most-useful-collection.60304/#content Now I have the old code Code: CLV1.Add(CreateItem(CLV1.AsView.Width,"Low Price",1000),"") CLV1.Add(CreateItem(CLV1.AsView.Width,"Medium Price",10000),"") CLV1.Add(CreateItem(CLV1.AsView.Width,"High Price",10000000),"") I would like to use Map collection,but there is my mistake which I don't understand it. Code: Dim Products As Map =CreateMap("Low Price":1000,"Medium Price":10000,"High Price":10000000) For Each Products As String In Products.Keys Dim Price As Float=Products.Get(Products) CLV1.Add(CreateItem(CLV1.AsView.Width,${Products},{Price}),"") '<==This line is my problem Next
Solution sirjo66 Aug 15, 2023 There is another error, try this: B4X: Dim Products As Map = CreateMap("Low Price":1000,"Medium Price":10000,"High Price":10000000) For Each Product As String In Products.Keys Dim Price As Float = Products.Get(Product) CLV1.Add(CreateItem(CLV1.AsView.Width, Product, Price),"") Next For Each Product, not Products !!
There is another error, try this: B4X: Dim Products As Map = CreateMap("Low Price":1000,"Medium Price":10000,"High Price":10000000) For Each Product As String In Products.Keys Dim Price As Float = Products.Get(Product) CLV1.Add(CreateItem(CLV1.AsView.Width, Product, Price),"") Next For Each Product, not Products !!
sirjo66 Well-Known Member Licensed User Longtime User Aug 15, 2023 #2 Try with B4X: CLV1.Add(CreateItem(CLV1.AsView.Width, Products, Price), "") Upvote 1
Olaan Expert Licensed User Longtime User Aug 15, 2023 #3 sirjo66 said: Try with B4X: CLV1.Add(CreateItem(CLV1.AsView.Width, Products, Price), "") Click to expand... After I changed them. It's still error. Upvote 0
sirjo66 said: Try with B4X: CLV1.Add(CreateItem(CLV1.AsView.Width, Products, Price), "") Click to expand... After I changed them. It's still error.
sirjo66 Well-Known Member Licensed User Longtime User Aug 15, 2023 #4 There is another error, try this: B4X: Dim Products As Map = CreateMap("Low Price":1000,"Medium Price":10000,"High Price":10000000) For Each Product As String In Products.Keys Dim Price As Float = Products.Get(Product) CLV1.Add(CreateItem(CLV1.AsView.Width, Product, Price),"") Next For Each Product, not Products !! Last edited: Aug 15, 2023 Upvote 0 Solution
There is another error, try this: B4X: Dim Products As Map = CreateMap("Low Price":1000,"Medium Price":10000,"High Price":10000000) For Each Product As String In Products.Keys Dim Price As Float = Products.Get(Product) CLV1.Add(CreateItem(CLV1.AsView.Width, Product, Price),"") Next For Each Product, not Products !!
Olaan Expert Licensed User Longtime User Aug 15, 2023 #5 sirjo66 said: There is another error, try this: B4X: Dim Products As Map = CreateMap("Low Price":1000,"Medium Price":10000,"High Price":10000000) For Each Product As String In Products.Keys Dim Price As Float = Products.Get(Product) CLV1.Add(CreateItem(CLV1.AsView.Width, Product, Price),"") Next For Each Product, not Products !! Click to expand... Many thanks for kind of you. Upvote 0
sirjo66 said: There is another error, try this: B4X: Dim Products As Map = CreateMap("Low Price":1000,"Medium Price":10000,"High Price":10000000) For Each Product As String In Products.Keys Dim Price As Float = Products.Get(Product) CLV1.Add(CreateItem(CLV1.AsView.Width, Product, Price),"") Next For Each Product, not Products !! Click to expand... Many thanks for kind of you.
sirjo66 Well-Known Member Licensed User Longtime User Aug 15, 2023 #6 Theera said: Many thanks for kind of you. Click to expand... Many thanks to you Please set "solution" in my post and change the title of the thread and add "[solved]" text Upvote 0
Theera said: Many thanks for kind of you. Click to expand... Many thanks to you Please set "solution" in my post and change the title of the thread and add "[solved]" text
sirjo66 Well-Known Member Licensed User Longtime User Aug 18, 2023 #7 I ask you again if, please, can set my post as "solution" Go to my post, here: https://www.b4x.com/android/forum/t...on-instead-of-the-old-code.149595/post-948066 Then, on the right you can see the number "0", and, above it a little "check". Please click on it Thanks Attachments Immagine.png 1.8 KB · Views: 524 Upvote 0
I ask you again if, please, can set my post as "solution" Go to my post, here: https://www.b4x.com/android/forum/t...on-instead-of-the-old-code.149595/post-948066 Then, on the right you can see the number "0", and, above it a little "check". Please click on it Thanks
M Mahares Expert Licensed User Longtime User Aug 18, 2023 #8 I don't think you should force a member to make your post a 'Solution' He already gave you many likes. It is up to them to give the reaction they want to give. Some members get a lot of help and never make any reactions. Some others are more appreciative. Look and see in the forum how many times many of us give a very fitting answer that deserves a reaction, but the answer doen't even get rewarded. Upvote 0
I don't think you should force a member to make your post a 'Solution' He already gave you many likes. It is up to them to give the reaction they want to give. Some members get a lot of help and never make any reactions. Some others are more appreciative. Look and see in the forum how many times many of us give a very fitting answer that deserves a reaction, but the answer doen't even get rewarded.
sirjo66 Well-Known Member Licensed User Longtime User Aug 18, 2023 #9 you are right, I'm sorry Upvote 0
Olaan Expert Licensed User Longtime User Aug 19, 2023 #10 Mahares said: I don't think you should force a member to make your post a 'Solution' He already gave you many likes. It is up to them to give the reaction they want to give. Some members get a lot of help and never make any reactions. Some others are more appreciative. Look and see in the forum how many times many of us give a very fitting answer that deserves a reaction, but the answer doen't even get rewarded. Click to expand... I'm not seriously about his advice.He helps me learn how to do. Thank you for caring my felt,Mahares. I would like to tell everyone ,if someone need me to do anything,I have ready to learn all. Thank you all of replies. Upvote 0
Mahares said: I don't think you should force a member to make your post a 'Solution' He already gave you many likes. It is up to them to give the reaction they want to give. Some members get a lot of help and never make any reactions. Some others are more appreciative. Look and see in the forum how many times many of us give a very fitting answer that deserves a reaction, but the answer doen't even get rewarded. Click to expand... I'm not seriously about his advice.He helps me learn how to do. Thank you for caring my felt,Mahares. I would like to tell everyone ,if someone need me to do anything,I have ready to learn all. Thank you all of replies.