In VB, you use ControlChars.Cr Lf (or better, ControlChars.Ne wLine).
In C/C++, we are used to using merely "\n" (or at least I am). It
appears "\n" is good enough for RichTextBoxes. Does it matter? I am
so used to typing "\n" that I don't think this habit will change
anyday soon.
Zytan 8 12940
On 2 Mar 2007 14:21:03 -0800, Zytan wrote:
In VB, you use ControlChars.Cr Lf (or better, ControlChars.Ne wLine).
In C/C++, we are used to using merely "\n" (or at least I am). It
appears "\n" is good enough for RichTextBoxes. Does it matter? I am
so used to typing "\n" that I don't think this habit will change
anyday soon.
Zytan
Probably not -- but its good practice to use Environment.New Line
--
Bits.Bytes http://bytes.thinkersroom.com
Probably not -- but its good practice to use Environment.New Line
Will do, thanks.
Zytan
On Mar 2, 5:12 pm, "Rad [Visual C# MVP]" <nos...@nospam. comwrote:
Probably not -- but its good practice to use Environment.New Line
--
Bits.Byteshttp://bytes.thinkersr oom.com
Why exactly is this this the preferred practice?
sherifffruitfly <sh************ *@gmail.comwrot e:
Probably not -- but its good practice to use Environment.New Line
Why exactly is this this the preferred practice?
Well indeed. From my point of view, Environment.New Line should be used
whenever you're writing a text file to be viewed on the current system,
but lots of people seem to use it whenever they want a new line,
regardless of the context.
I know various Windows controls *require* \r\n, but different platforms
and UI libraries may well use a different new line to what the platform
usually uses for text files.
--
Jon Skeet - <sk***@pobox.co m> http://www.pobox.com/~skeet Blog: http://www.msmvps.com/jon.skeet
If replying to the group, please do not mail me too
On Sat, 3 Mar 2007 07:18:02 -0000, Jon Skeet [C# MVP] wrote:
sherifffruitfly <sh************ *@gmail.comwrot e:
>>Probably not -- but its good practice to use Environment.New Line
Why exactly is this this the preferred practice?
Well indeed. From my point of view, Environment.New Line should be used
whenever you're writing a text file to be viewed on the current system,
but lots of people seem to use it whenever they want a new line,
regardless of the context.
I know various Windows controls *require* \r\n, but different platforms
and UI libraries may well use a different new line to what the platform
usually uses for text files.
I would still think it's a good idea to use it, like in the scenario the OP
raised. I've not used Mono but I would not be surprised if the equivalent
control for the rich text box required a \n on its own, in which case using
\r\n might break the code if compiled for Mono
Personaly i do it that way not for issues of cross platform compatibility
but because I invariably forget one slash...
--
Bits.Bytes http://bytes.thinkersroom.com
Rad [Visual C# MVP] <no****@nospam. comwrote:
I know various Windows controls *require* \r\n, but different platforms
and UI libraries may well use a different new line to what the platform
usually uses for text files.
I would still think it's a good idea to use it, like in the scenario the OP
raised. I've not used Mono but I would not be surprised if the equivalent
control for the rich text box required a \n on its own, in which case using
\r\n might break the code if compiled for Mono
On the other hand, Mono may well have emulated Windows Forms as closely
as possible, in which case using Environment.New Line may well break
text areas etc (in that you wouldn't get a new line). I feel sorry for
the Mono team on issues like that...
Personaly i do it that way not for issues of cross platform compatibility
but because I invariably forget one slash...
That must be pretty obvious when it happens though.
--
Jon Skeet - <sk***@pobox.co m> http://www.pobox.com/~skeet Blog: http://www.msmvps.com/jon.skeet
If replying to the group, please do not mail me too
sherifffruitfly wrote:
On Mar 2, 5:12 pm, "Rad [Visual C# MVP]" <nos...@nospam. comwrote:
>Probably not -- but its good practice to use Environment.New Line
Why exactly is this this the preferred practice?
Network protocols : use \r\n no matter what platform it is.
Files : use Environment.New Line and have the platform
translate that to \r\n or \n or something third.
Multi line controls in screens : read the documentation very
carefully - I would expect \r\n to be the correct way no
matter what platform.
Arne This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: BJörn Lindqvist |
last post by:
I think it would be cool if you could refer to instance variables
without prefixing with "self." I know noone else thinks like me so
Python will never be changed, but maybe you can already do it with
Python today?
..import sys
..
..def magic():
.. s = ""
.. for var in sys._getframe(1).f_locals.__dict__:
|
by: Alexander Bartzas |
last post by:
I'm trying to compile route.cpp part of the NetBench Suite (UCLA) and...:
> g++ packet.cpp radix.cpp route.cpp -o route
There is no problem in the compilation of the code but when I try to run
it...
Segmentation fault (core dumped)
I've located where the problem is... It is part of the following function's
|
by: KENNY L. CHEN |
last post by:
Dear experts,
I have two tables in my Oracle 8i database: TEST (COL1,COl2,REC_NO)
and TEST1 (COL1,COL2,REC_NO).
Both tables are unique-indexed on (COL1,COL2,REC_NO).
I think the following SQL commands will return the same result but one
of my friends don't think so. He said "QUERY 1" will return 1 unsorted
record (ROWNUM < 2 ) first then sort the result (ORDER BY COL1 ASC,
|
by: Erik R.N. |
last post by:
Hi
I have a ACCESS2002 table with a date-field in format "dd-mm-yyyy"
which I "export" to a txt-file ( ; and " " )
and upload the txt-file to a MYSQL-table
where the datefield is a varchar-field.
I want to sort on the MYSQL-date-field.
How do I get a MYSQL-date-formated "yyyy-mm-dd" field
which I can sort on ??
|
by: napi |
last post by:
I think you would agree with me that a C compiler that directly
produces Java Byte Code to be run on any JVM is something that is
missing to software programmers so far. With such a tool one could
stay with C and still be able to produce Java byte code for
platform independent apps. Also, old programs (with some tweaking)
could be re-compiled and ported to the JVM.
We have been developing such a tool over the last 2 years and currently...
| |
by: SenthilSS |
last post by:
My application produces XML Data files which have XML namespace qualified XML
elements (nodes), but the namespace itself is not declared in the data file.
My task is to read these data files in a C# app for viewing purposes. I am
using "XmlDocument" and "DataSet" for displaying the XML data in the Data
grid.
Problem:
If I add the Namespace declaration to the data file itself (by manually
opening the file and adding a new Root element...
|
by: Bernd Hohmann |
last post by:
I have a question about using "*" in (sub)queries.
This example query counts the number of records for a certain customer
starting with record "80172" and stops after 10 rows.
SELECT PK_ORDER,PK_CUSTOMER FROM
(SELECT PK_ORDER,PK_CUSTOMER, ROW_NUMBER() OVER() AS rn
FROM CUSTOMER_ORDERS_HD WHERE PK_CUSTOMER='10649'
ORDER BY PK_ORDER DESC) AS T2
WHERE T2.rn <= 80172 FETCH FIRST 10 ROWS ONLY
|
by: SharpCoderMP |
last post by:
hi,
i'm writing a console application and i would like to be able to safely
retrive password from the user, so noone can see how it is being typed.
consider this scenario:
Console.Write("Enter password:");
string pass = Console.ReadLine()
when this is called and user types, his passsword is displayed on the
screen. i would like to avoid that, and do not print any characters or
|
by: matheussousuke |
last post by:
Hello, I'm using tiny MCE plugin on my oscommerce and it is inserting my website URL when I use insert image function in the emails.
The goal is: Make it send the email with the URL http://mghospedagem.com/images/controlpanel.jpg
instead of
http://mghospedagem.comhttp://mghospedagem.com/images/controlpanel.jpg
As u see, there's the website URL before the image URL.
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look !
Part I. Meaning of...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
| |
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms.
Adolph will...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert into image.
Globals.ThisAddIn.Application.ActiveDocument.Select();...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...
| |