184Views7Replies

Author Options:

whats wrong with my vbs code? Answered

here it is:

MsgBox("virus detected")
MsgBox("windows will now perform system format to attempt to get rid of the virus")
MsgBox("formatting system...") 
MsgBox("warning
ram = failed
hard disk = failed
system firewall = failed
please shutdown the system and seek proffesional advice")


it says terminated string constant can someone please point out my mistake?

7 Replies

user
g-oneBest Answer (author)2009-10-10

MsgBox "virus detected"<br />MsgBox "windows will now perform system format to attempt to get rid of the virus"<br />MsgBox "formatting system..."<br />MsgBox "warning" & vbCrLf & _<br />"ram = failed" & vbCrLf & _<br />"hard disk = failed" & vbCrLf & _<br />"system firewall = failed" & vbCrLf & _<br />"please shutdown the system and seek proffesional advice"

Select as Best AnswerUndo Best Answer

user
sharlston (author)g-one2009-10-10
user
g-one (author)sharlston2009-10-10

This is a VBS constant which shows a line break in the box.

Select as Best AnswerUndo Best Answer

user
geekvig (author)2010-05-05

You can't have the last message spread out on multiple lines.  should be:

MsgBox("virus detected")
MsgBox("windows will now perform system format to attempt to get rid of the virus")
MsgBox("formatting system...")
MsgBox("warning" & vbNewLine & "ram = failed" & vbNewLine & "hard disk = failed" & vbNewLine & "system firewall = failed" & vbNewLine & "please shutdown the system and seek proffesional advice")

Select as Best AnswerUndo Best Answer

user
NachoMahma (author)2009-10-09

. I'm not a VBS programmer, but it looks to me like your probably failing at the CR/LF after<br /> MsgBox("warning<br />. Is there some way to concatenate the strings? Eg,<br /> MsgBox("warning" + "RAM=failed" + ... + "... advice")

Select as Best AnswerUndo Best Answer

user
Re-design (author)2009-10-09


Proffesional is not spelled right. It would look more professional if it were correct.

Select as Best AnswerUndo Best Answer

user
sharlston (author)Re-design2009-10-09

i dont care about spelling mistakes i want to know whats wrong with the code itself

Select as Best AnswerUndo Best Answer