Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

detecting carriage return in vb.net

Posted on 2010-09-17
5
Medium Priority
?
395 Views
Last Modified: 2012-05-10
Hello Experts
I am trying to check if the field is empty using the statement below

If (OT.DecMessage = "" Or OT.DecMessage Is Nothing )Then
    pnlOTDecMessagee.Visible = False
End if

But when I have a carriage return (blank lines) in the Message, its not returning True.

How can I include this in my condition please?

Thanks
S
0
Comment
Question by:newbie27
5 Comments
 
LVL 6

Assisted Solution

by:charlie324
charlie324 earned 800 total points
ID: 33702373
try
if Val(OT.DecMessage= Val(vbCrLf) then
' your statement
end if
0
 
LVL 17

Assisted Solution

by:Zhaolai
Zhaolai earned 200 total points
ID: 33702389
Try this:

if OT.DecMessage = vbCrLf then
    pnlOTDecMessagee.Visible = True
ElseIf (OT.DecMessage = "" OrElse OT.DecMessage Is Nothing )Then
    pnlOTDecMessagee.Visible = False
End if

0
 
LVL 9

Accepted Solution

by:
Hawkvalley1 earned 800 total points
ID: 33702451
OrElse OT.DecMessage.Contains(Environment.Newline)
0
 
LVL 8

Author Comment

by:newbie27
ID: 33703088
Hello Folks

Thanks for your input, for somereason only this statement works

OrElse OT.DecMessage.Contains(Environment.Newline)

Thanks Hawkvalley1
0
 
LVL 8

Author Comment

by:newbie27
ID: 33711194
Sorry folks, I have accidentally closed the question, I wanted to actually award points to above experts and closed.

Please can you revert back?

Thanks
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Today is the age of broadband.  More and more people are going this route determined to experience the web and it’s multitude of services as quickly and painlessly as possible. Coupled with the move to broadband, people are experiencing the web via …
User art_snob (http://www.experts-exchange.com/M_6114203.html) encountered strange behavior of Android Web browser on his Mobile Web site. It took a while to find the true cause. It happens so, that the Android Web browser (at least up to OS ver. 2.…
This course is ideal for IT System Administrators working with VMware vSphere and its associated products in their company infrastructure. This course teaches you how to install and maintain this virtualization technology to store data, prevent vuln…
Integration Management Part 2

926 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question