This blog post is based on a pre-release version of the RAD Studio software and it has been written with specific permission by Embarcadero. No feature is committed until the product GA release. It seems I'm getting very excited about multi-line strings of late. My previous post was about multi-line string literals for Delphi and this time I'm talking about the new multi-line string property editor being slated for the RAD Studio 12 IDE. For more years than I care to remember, I've been frustrated by the inability to enter multi-line strings in the Delphi IDE object inspector. That meant having to resort to code to initialise some multi-line labels. So frustrated was I that I wrote a little property editor of my own ( stringpe ), way back in 2004. It's still around and on GitHub. Here's what it (sometimes) looks like: Yeah, I know this is Vista - I used an old screenshot Sometimes? Well it looked like that until it got installed on DPI aware Delphis, and then it sh
This blog post is based on a pre-release version of the RAD Studio software and it has been written with specific permission by Embarcadero. No feature is committed until the product GA release. The upcoming new release of RAD Studio 12 Yukon is a major update that's got a new Delphi language features that I've been wanting for years, or perhaps even decades since I first discovered heredocs in PHP. Yep, we're going to get multi-line string literals. This excites me just as much as the earlier introduction of inline var statements, which was a lot! I write a lot of multiline string constants in my code like this: const S0 = ' Lorem ipsum dolor sit amet, consectetur adipiscing elit.' + sLineBreak + ' Vestibulum eleifend elit id dapibus pulvinar.' + sLineBreak + 'Suspendisse tincidunt, diam vel dapibus aliquam.'; Miss out one of the closing quotes or + signs and bang, compile failure. Annoying. But now we have multi-l
Calling a JavaScript function in a TWebBrowser is easy, but getting a return value from it is hard. I've been struggling for ages to find an answer to this, and lots of users have asked. My article " How to call JavaScript functions in a TWebBrowser from Delphi " goes into details. Christian Sciberras suggested a solution that depended on modifying the HTML source to include a hidden input field and modifying the function stores its result in the field. I've wanted a tidier solution that didn't involve changing either the HTML code or the JavaScript function, because we can't always do that. I've now got a solution based on Christian's: Create a hidden input field in the current document with a unique id. Wrap the required function call in JavaScript that calls the function and stores its return value in the input field. Read the value from the input field and return it. It's a bit of a dirty hack, and it only works if the function
Comments
Post a Comment
Comments are very welcome, but please don't comment here if:
1) You have a query about, or a bug report for, one of my programs or libraries. Most of my posts contain a link to the relevant repository where there will be an issue tracker you can use.
2) You have a query about any 3rd party programs I feature, please address them to the program's developer(s) - there will be a link in the post.
3) You're one of the tiny, tiny minority who are aggressive or abusive - in the bin you go!
Thanks