Text to

This forum is meant for examples of X# code.

Post Reply
User avatar
wriedmann
Posts: 3755
Joined: Mon Nov 02, 2015 5:07 pm
Location: Italy

Text to

Post by wriedmann »

Hi,
I would remember to anyone that X# has added a "text to" command also to other dialects than VFP (even in Core!).
That makes it really easy and readable to write XML/JSON/HTML code to a variable:

Code: Select all

text to cCostPattern
{
  "date": 	"2024-01-10",
  "metric": 	123.4
}
endtext
It is a really great addition and it helps me a lot - my thanks go to the development team!
Wolfgang
Wolfgang Riedmann
Meran, South Tyrol, Italy
wolfgang@riedmann.it
https://www.riedmann.it - https://docs.xsharp.it
User avatar
xinjie
Posts: 106
Joined: Wed May 20, 2020 10:05 am
Location: China
Contact:

Re: Text to

Post by xinjie »

I use it a lot to write complex SQL statements in VFP. Works great.
简单的东西重复做,你能成为专家;重复的东西用心做,你能成为赢家!
User avatar
wriedmann
Posts: 3755
Joined: Mon Nov 02, 2015 5:07 pm
Location: Italy

Re: Text to

Post by wriedmann »

Hi Xinjie,

yes, I saw that functionality in a readme when it was added for the VFP dialect, and therefore I asked the development team to support it also in other dialects, and specifically in the Core dialect where I`m writing most of my new code.
And yes, I use it also a lot for SQL statements as it is much easier to write and much, much easier to read (and to copy to my database tool for testing...).

Wolfgang
Wolfgang Riedmann
Meran, South Tyrol, Italy
wolfgang@riedmann.it
https://www.riedmann.it - https://docs.xsharp.it
Post Reply