187Views7Replies

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?

Discussions

0
user
g-one

Best Answer 8 years ago

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"

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

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")

. 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")


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

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