I would like to append a linefeed to a string, but nowhere in the doc, or forum can I find a working example how to add a line feed to a string
SOLVED - Here is how you do it :
Jaymer and another user, forgot name... helped
Create a new column in SystemSettings - through the app is fine. Mine is LineFeedChar varchar(10)
For SQL Server:
update [dbo].[SYSTEMSETTINGS]
set LineFeedChar = char(13) + char(10)
Then this works:
'this is my string' + SystemSettings.LineFeedChar + SendMemberMessages .Message
and this works:
'this is my string <<SystemSettings.LineFeedChar>> <<SendMemberMessages .Message>>'
Thanks again to all who contributed.
Dave
I have tried:
'this is my string\n' + SendMemberMessages .Message
'this is my string' + '\u000D' + SendMemberMessages .Message
'this is my string' + '\n' + SendMemberMessages .Message
'this is my string' + '\\n' + SendMemberMessages .Message
'this is my string' + \\n + SendMemberMessages .Message
Nothing works. On most of the above, I do not get error messages.
Dave
How do you add a line feed to a string (SOLVED)
How do you add a line feed to a string (SOLVED)
Last edited by ddumas on Tue Dec 10, 2019 1:11 am, edited 1 time in total.
Re: How do you add a line feed to a string?
Last edited by Jaymer on Mon Dec 09, 2019 8:47 pm, edited 1 time in total.
Click Here to see a collection of my tips & hacks on this forum. Or search for "JaymerTip" in the search bar at the top.
Jaymer
Aware Programming & Consulting - Tampa FL
Jaymer
Aware Programming & Consulting - Tampa FL
Re: How do you add a line feed to a string?
I read the entire forum post as best I could. I think the summary was to use '\n'
Does not work. I have tried that before from my last post:
'this is my string' + '\n' + SendMemberMessages .Message
That just adds the literal \n to this is my string
So the string just becomes: this is my string\n
Dave
Does not work. I have tried that before from my last post:
'this is my string' + '\n' + SendMemberMessages .Message
That just adds the literal \n to this is my string
So the string just becomes: this is my string\n
Dave
Re: How do you add a line feed to a string?
I even tried adding an attribute SystemSettings.LineFeedChar, and saved a \n into it.
Same result:
'this is my string' + SystemSettings.LineFeedChar + SendMemberMessages .Message
just adds the literal \n to this is my string
the string just becomes: this is my string\n
Same result:
'this is my string' + SystemSettings.LineFeedChar + SendMemberMessages .Message
just adds the literal \n to this is my string
the string just becomes: this is my string\n
Re: How do you add a line feed to a string?
Version 8.5 - Windows using MySql 8 and SQL Server - 64bit
Re: How do you add a line feed to a string?
I looked at that post, and the only difference I saw is a suggestion to go into system settings and hit a carriage return in the SystemSettings.CR attribute, and save.
I tried that, and did not get a line feed.
Dave
I tried that, and did not get a line feed.
Dave
Re: How do you add a line feed to a string?
have to tried this
'this is my string <<SystemSettings.LineFeedChar>> <<SendMemberMessages.Message>>'
'this is my string <<SystemSettings.LineFeedChar>> <<SendMemberMessages.Message>>'
Version 8.5 - Windows using MySql 8 and SQL Server - 64bit
Re: How do you add a line feed to a string?
no no no no no no no
ok, my bad, Dave.
I incorrectly posted a link to the entire thread instead of just my post.
All you need is MY POST in that thread - I have updated the link above - you just needed to make a CR field in System Settings and update it as specified in my post.
done
PS _ While you're at it, go ahead and make SQ and DQ for Single Quote and Double Quote, you'll need them eventually.
Set them with a ' and "
ok, my bad, Dave.
I incorrectly posted a link to the entire thread instead of just my post.
All you need is MY POST in that thread - I have updated the link above - you just needed to make a CR field in System Settings and update it as specified in my post.
done
PS _ While you're at it, go ahead and make SQ and DQ for Single Quote and Double Quote, you'll need them eventually.
Set them with a ' and "
Click Here to see a collection of my tips & hacks on this forum. Or search for "JaymerTip" in the search bar at the top.
Jaymer
Aware Programming & Consulting - Tampa FL
Jaymer
Aware Programming & Consulting - Tampa FL
Re: How do you add a line feed to a string?
same result.
Re: How do you add a line feed to a string?
not sure what your issue is - if you have a char(13) in your CR MSSQL field, then this is a working example of how I build a text string at the top of an invoice to show Customer details.
tmp_Customer_Addr_Block is a large Text field in the User table.
Before I print the report, I call this to build the string:
LoggedInStaffMembers.tmp_Customer_Addr_Block=
EstimateCont.ob_Contact2.ob_Customer.BusName+SystemSettings.CR+
EstimateCont.ob_Contact2.Address+SystemSettings.CR+
EstimateCont.ob_Contact2.City+', '+EstimateCont.ob_Contact2.State+' '+EstimateCont.ob_Contact2.ZipCode+SystemSettings.CR+
EstimateCont.ob_Contact2.ContactName+SystemSettings.CR+
EstimateCont.ob_Contact2.EmailAddress+SystemSettings.CR+
'Office: '+EstimateCont.ob_Contact2.PhoneOff+' / Mobile:'+EstimateCont.ob_Contact2.PhoneMobile
tmp_Customer_Addr_Block is a large Text field in the User table.
Before I print the report, I call this to build the string:
LoggedInStaffMembers.tmp_Customer_Addr_Block=
EstimateCont.ob_Contact2.ob_Customer.BusName+SystemSettings.CR+
EstimateCont.ob_Contact2.Address+SystemSettings.CR+
EstimateCont.ob_Contact2.City+', '+EstimateCont.ob_Contact2.State+' '+EstimateCont.ob_Contact2.ZipCode+SystemSettings.CR+
EstimateCont.ob_Contact2.ContactName+SystemSettings.CR+
EstimateCont.ob_Contact2.EmailAddress+SystemSettings.CR+
'Office: '+EstimateCont.ob_Contact2.PhoneOff+' / Mobile:'+EstimateCont.ob_Contact2.PhoneMobile
Click Here to see a collection of my tips & hacks on this forum. Or search for "JaymerTip" in the search bar at the top.
Jaymer
Aware Programming & Consulting - Tampa FL
Jaymer
Aware Programming & Consulting - Tampa FL
Re: How do you add a line feed to a string?
I had used AwareIM SystemSettings editor to add the CR. I will try now, directly in a SQL update, and let you know.
Dave
Dave
Re: How do you add a line feed to a string (SOLVED)
Solved!
Dave
Dave
Re: How do you add a line feed to a string (SOLVED)
solved how, sql god?
Click Here to see a collection of my tips & hacks on this forum. Or search for "JaymerTip" in the search bar at the top.
Jaymer
Aware Programming & Consulting - Tampa FL
Jaymer
Aware Programming & Consulting - Tampa FL
Re: How do you add a line feed to a string (SOLVED)
Ha!
I edited my post, and put this at the top of my post...:
SOLVED - Here is how you do it :
Jaymer and another user, forgot name... helped
Create a new column in SystemSettings - through the app is fine. Mine is LineFeedChar varchar(10)
For SQL Server:
update [dbo].[SYSTEMSETTINGS]
set LineFeedChar = char(13) + char(10)
Then this works:
'this is my string' + SystemSettings.LineFeedChar + SendMemberMessages .Message
and this works:
'this is my string <<SystemSettings.LineFeedChar>> <<SendMemberMessages .Message>>'
Thanks again to all who contributed.
Dave
I edited my post, and put this at the top of my post...:
SOLVED - Here is how you do it :
Jaymer and another user, forgot name... helped
Create a new column in SystemSettings - through the app is fine. Mine is LineFeedChar varchar(10)
For SQL Server:
update [dbo].[SYSTEMSETTINGS]
set LineFeedChar = char(13) + char(10)
Then this works:
'this is my string' + SystemSettings.LineFeedChar + SendMemberMessages .Message
and this works:
'this is my string <<SystemSettings.LineFeedChar>> <<SendMemberMessages .Message>>'
Thanks again to all who contributed.
Dave