make a constant that is equal to chr(9) i.e. tab ?

The XML format looks pretty standard. But if and when it breaks, we shall never blame you :wink:

I’ll second that.

I’m sure there’s a certain lurker who will have fun with this conversation though - Hi B…d!

To me this is like scrapping a web page to extract data - we’re at the mercy of the owner to not change their specs. It’s not like a published API where there’s some responsibility to provide a standard.

[quote=161294:@Wayne Golding]I’ll second that.

I’m sure there’s a certain lurker who will have fun with this conversation though - Hi B…d!

To me this is like scrapping a web page to extract data - we’re at the mercy of the owner to not change their specs. It’s not like a published API where there’s some responsibility to provide a standard.[/quote]

I would tend to think the XML maybe a little less fragile, since it is not a proprietary format. But that is only for loading it.

Right now, I have incorporated that into a module and it is part of a project, so if it breaks, it will be because for some reason Xojo decided not to support control characters as default string for constants anymore. From what I see, it saves and loads fine in binary format.

Should we live in fear ? If the powers that be decide to sacrifice the possibility for constants to represent control characters, then we’ll make them computer properties.

I suspect access to a constant is faster, though. But with present computers, the difference is probably infinitesimal.

just tried now. the “&u09” ( or “&u13”) trick does not work.

I make a constant with the ide, choose a NUMBER type and give a value kret = &u13
then a command such as msgbox "aaa"+kret"+"bbb" gives a single line like “aaa bbb” (with a small space between)
if I try msgbox "aaa"+chr(13)+"bbb" then I have what I want two lines with “aaa” on the first and “bbb” on the second.

if I try msgbox "aaa"+chr(kret)+"bbb" then I have a compilation error wrong type
what’s next ?

Euhh, I’m not sure to understand all the problem.

I have a external modul (.rbo) which contains my usual Methods and Constants (used in al my programs).
I created a string constant in which I paste the Tab character (I did in textEdit and I copied it).

You gave the value in decimal, but it must be in hex. Try kret = &u0D

&u13 is actually code point 19, or a control-S.

thanks Kem that works …

[quote=161331:@Thomas ROBISSON]Euhh, I’m not sure to understand all the problem.

I have a external modul (.rbo) which contains my usual Methods and Constants (used in al my programs).
I created a string constant in which I paste the Tab character (I did in textEdit and I copied it).[/quote]
I did not try that, it must work, but how do you do it for all ascii chars < 27 that you may need for import-export text files ?

Look at Wayne Golding method, and what I posted for a module saved as XML, 14 posts ago…

@ jean-yves pochez , Sorry I don’t know. I do it for chr(9) (I could for chr(10) and chr(13) but no need as there is EndOfLine.Mac and EndOfLine.Win ).

C’est marrant, 3 Franais qui se causent en Anglais :wink: .

[quote=161195:@Wayne Golding]This module has kTab as a global constant = ChrB(9).

Just import the module into your project.[/quote]

You can do this in the IDE:
1 create a module
2 add a constant to the module
3 select the just made constant in the navigator
4 goto the inspector and set the type of the constant to string
5 after point 4 there is a button with 3 dots next to the default value box in the inspector
6 click with the left mousebutton on that button and a text window will open
7 in that textbox press the tab key and close the text window
8 your tab character is available in the new constant.

OR did i miss something?

[quote=161398:@Andre Kuiper]You can do this in the IDE:
1 create a module
2 add a constant to the module
3 select the just made constant in the navigator
4 goto the inspector and set the type of the constant to string
5 after point 4 there is a button with 3 dots next to the default value box in the inspector
6 click with the left mousebutton on that button and a text window will open
7 in that textbox press the tab key and close the text window
8 your tab character is available in the new constant.

OR did i miss something?[/quote]

It works fine for Tab, it does not work for &u0D+&u0A. At least on Mac, hitting Return will simply enter &u0A (chr(10)) in the constant.

[quote=161272:@Eli Ott]Thanks Kem, good to know. I’ve never used &uNNNN for constants created in the IDE, because I only just figured out now, that the data type needs to be Integer.
[/quote]

[quote=161276:@Kem Tekinay]It looks like you can use that trick for a single character but not multiple characters. Within code though, this works:
I can’t see a way to reproduce that in the constant editor.[/quote]
These two combined sounds like a bug in the IDE

I’m going to book mark this one :slight_smile: