rickrack Member Licensed User Longtime User Oct 10, 2012 #1 Hello, I would like to change a label text color by downloading a string from an online stored .txt file that contains requested values xxx, xxx, xxx, xxx but I get an error when I try to debug the app. Sub hc_avversario_ombra_ResponseSuccess(Response As HttpResponse, TaskId As Int) data_avversario_ombra.TextColor = Colors.ARGB(Response.GetString("UTF8")) End Sub Compiling code. Error Error compiling program. Error description: Missing parameter. Occurred on line: 124 data_avversario_ombra = Colors.ARGB(Response.GetString("UTF8")) Word: ) Please help me.. I'm trying to solve this from 2 days but no results ( thanks in advance Last edited: Oct 11, 2012
Hello, I would like to change a label text color by downloading a string from an online stored .txt file that contains requested values xxx, xxx, xxx, xxx but I get an error when I try to debug the app. Sub hc_avversario_ombra_ResponseSuccess(Response As HttpResponse, TaskId As Int) data_avversario_ombra.TextColor = Colors.ARGB(Response.GetString("UTF8")) End Sub Compiling code. Error Error compiling program. Error description: Missing parameter. Occurred on line: 124 data_avversario_ombra = Colors.ARGB(Response.GetString("UTF8")) Word: ) Please help me.. I'm trying to solve this from 2 days but no results ( thanks in advance
lagore Active Member Licensed User Longtime User Oct 10, 2012 #2 Put a line to log the value that you are downloading to make sure it is the correct format Sent from my HTC One X using Tapatalk 2 Upvote 0
Put a line to log the value that you are downloading to make sure it is the correct format Sent from my HTC One X using Tapatalk 2
NJDude Expert Licensed User Longtime User Oct 10, 2012 #3 That will fail because ARGB expects 4 integers, you will have to parse the result like this: Code: Dim Values() As String Dim Result As String Result = Response.GetString("UTF8") Values = Regex.Split(",", Result) data_avversario_ombra.TextColor = Colors.ARGB(Values(0), Values(1), Values(2), Values(3)) I haven't tested the code but it should work. Last edited: Oct 10, 2012 Upvote 0
That will fail because ARGB expects 4 integers, you will have to parse the result like this: Code: Dim Values() As String Dim Result As String Result = Response.GetString("UTF8") Values = Regex.Split(",", Result) data_avversario_ombra.TextColor = Colors.ARGB(Values(0), Values(1), Values(2), Values(3)) I haven't tested the code but it should work.
margret Well-Known Member Licensed User Longtime User Oct 10, 2012 #4 Should it not also be? Code: data_avversario_ombra.TextColor = Colors.ARGB(Values(0), Values(1), Values(2), Values(3)) Upvote 0
Should it not also be? Code: data_avversario_ombra.TextColor = Colors.ARGB(Values(0), Values(1), Values(2), Values(3))
rickrack Member Licensed User Longtime User Oct 10, 2012 #5 I did it as margret advised using njdude code thank you for rapid support! There's just a problem in yours, njdude: "values" must be string too because the split can't use two different types of variables thanks, have a nice day! Last edited: Oct 10, 2012 Upvote 0
I did it as margret advised using njdude code thank you for rapid support! There's just a problem in yours, njdude: "values" must be string too because the split can't use two different types of variables thanks, have a nice day!
NJDude Expert Licensed User Longtime User Oct 10, 2012 #6 There's just a problem in yours, njdude: "values" must me string too because the split can't use two different types of variables Click to expand... I wrote that code from the top of my head, I wasn't sure about that, that's why I advised caution. I have modified the code in case someone else wants to do the same. Thanks. Upvote 0
There's just a problem in yours, njdude: "values" must me string too because the split can't use two different types of variables Click to expand... I wrote that code from the top of my head, I wasn't sure about that, that's why I advised caution. I have modified the code in case someone else wants to do the same. Thanks.