When is text not text - iOS ShowURL example

I am having a hard time with something that seems trivial.

I have adapted the iOS ShowURL example that comes with Xojo to create a simple app that will let me make calls from some preset buttons. However it seems all Text is not equal.

The ShowURL app lets you type in “tel:0123456789” in an iOSTextField and calls the ShowURL method with the textfields .text property.

I can do the same in my app with a textfield and a button. I can also just use ShowURL(“tel:0123456789”). I can stick in a Text variable and use it:

dim t as Text

t=“tel:0123456789”
ShowURL(t)

However when I store some phone numbers in a 2-d array it does not work, e.g.

Data(1,2)=“tel:0123456789”
ShowURL(Data(1,2))

I have tried copying the array data into a single text variable and using that, putting it in a TestField or Label and using the .Text property, and using just a 1-D array but nothing works.

It is frustrating enough that we don’t have arrays of controls in iOS but now it seems arrays of Text are somehow not the same as other Texts. Unless anyone can tell be what terribly stupid thing I have done …

Cheers, Richard

What’s the data type of the Data array?

And what’s the actual error?

Thanks, it’s a property of the View and is Data(20,3) as Text. I hadn’t thought of trying to create it at runtime with a dim, perhaps that would make a difference (although it shouldn’t of course).

I don’t see an error, it just doesn’t make the iPhone attempt a call. I assume ShowURL is returning False, just like if you give it something that is not a valid telephone number.

[quote=481278:@Richard Dixon]Thanks, it’s a property of the View and is Data(20,3) as Text. I hadn’t thought of trying to create it at runtime with a dim, perhaps that would make a difference (although it shouldn’t of course).

I don’t see an error, it just doesn’t make the iPhone attempt a call. I assume ShowURL is returning False, just like if you give it something that is not a valid telephone number.[/quote]
For a valid telephone number, you should get a prompt from the OS whether to call the number, but keep in mind that this may not work in the iOS simulator. You’d only see it on a physical device.

Thanks, yes, you are correct, the simulator does not manage to respond to ShowUrl with a telephone number. The results I mention above are all on a real iPhone where I get the prompt asking me if I want to call the number in all cases except where the phone number is held in an array. Cheers, Richard

A bug report with an example is in order then.

Thanks for your help, I’ll do that.