How to define a substitute for a String*x structure field on iOS?

The structure editor lets you define a certain length character field by using the type String, followed by an asterisk and the number of characters/bytes.

Xojo’s iOS framework doesn’t use String anymore. A Text*x value results in a question mark for the field length – which makes sense, a Text character can use more than one Byte. But how would one define a structure textfield of a certain length under the new framework if you need more than 4 characters, for which the OSType can be used? Can it be only done via an array of bytes which then must be converted to text?

an array of bytes [chars]?

What are you trying to accomplish? In Xojo structures are more or less only used for declares into third party libraries and operating system frameworks. And for these you could not use Text anyway.

Why not use Cstring, as I suspect you need this for declare anyway ? It seems to allow setting the size, and it is in fact a bonafide string…

if you had
foo as string*25
that should turn into
foo(25) as byte

String*X was basically X many bytes anyway

Thanks, you all. My question disappeared when I found OSType. I still encounter new things after a few years …

I think OSType is only part of the old framework and not available for the new one.

I thought so too, but I can use it, check it and compile it for iOS. Although it stays unclear to me how to assign a value.
Maybe Norman can shed a bit of light on this – should it be available for iOS or not?

[quote=231529:@Ulrich Bogun]I thought so too, but I can use it, check it and compile it for iOS. Although it stays unclear to me how to assign a value.
Maybe Norman can shed a bit of light on this – should it be available for iOS or not?[/quote]

Yes.

Then the docs should say so. See: Advanced Data Types.

Thanks, Joe!

@Eli: I’ll file a small feedback report that the docs should be updated. Or did you already?

Never having used it: How do I assign a value to an OSType? If I understand correctly, I should be able to assign a 4 Char “String” value or a 4 Byte Integer value to it. But I can’t – type mismatch error –, and CTyping doesn’t help either.

I take that back. It seems logical that it should work, but it doesn’t at the moment and that’s probably a bug.

So I was not too stupid? :smiley:
Should I update <https://xojo.com/issue/41655>, issue a new feedback report or do you keep it on your list?

[quote=231553:@Ulrich Bogun]So I was not too stupid? :smiley:
Should I update <https://xojo.com/issue/41655>, issue a new feedback report or do you keep it on your list?[/quote]

I’ve commandeered the case to also mean “this should work on iOS”.

Thanks, Joe! I like the new headline! :smiley: