218Views7Replies

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

The forums are retiring in 2021 and are now closed for new topics and comments.
0
g-one
g-one

Best Answer 11 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"

0
sharlston
sharlston

Answer 11 years ago

whats the vbcrlf for?

0
g-one
g-one

Answer 11 years ago

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

0
geekvig
geekvig

10 years ago

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

0
NachoMahma
NachoMahma

11 years ago

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

0
Re-design
Re-design

11 years ago


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

0
sharlston
sharlston

Answer 11 years ago

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