I hope that someone can explain this for me.

I use an MsgBox to alert the user that the system is not responding with this code.
Code:
Dim pMsg As String * 80
dim InitSioxErrMess as string
pMsg = Space(80)
'initialize the system
PortNr = InitSioxBus(strComPort, intBaudrate)
InitSioxBusErrorMsg PortNr, pMsg    'pMsg returns error mess if the system is not responding, pMsg is a string*80 and when I'm testing it returns "The device is not open"

'trim of the returned error mess
InitSioxErrMess = Mid(pMsg, 1, Len(Trim(pMsg)))
MsgBox "The system could not get contact with the com-port" & vbCrLf & "Sioxerror : " & InitSioxErrMess & vbCrLf & "The program will close down!", vbOKOnly + vbCritical, "No contact with the com-port!"
End  Close the program
this code gives me the following msgbox:
*************
The system could not get contact with the com-port
Sioxerror : " & InitSioxErrMess
Critical icon & OK-button
*************

What I don't get is the third line:
The program will close down!

If I try this in a new project with this code:
Code:
Private Sub Command1_Click()
Dim InitSioxErrMess As String
InitSioxErrMess = "The device is not open"
MsgBox "The system could not get contact with the com-port" & vbCrLf & "Sioxerror : " & InitSioxErrMess & vbCrLf & "The program will close down!", vbOKOnly + vbCritical, "No contact with the com-port!"
End Sub
then I get the following msgbox:
******************
The system could not get contact with the com-port
Sioxerror : " & InitSioxErrMess
The program will close down!
Critical icon & OK-button
******************

This is the three lines of information I want.
Why does not my app give me three lines in the messagebox?
First I used pMsg in the msgbox but got only two lines of info, that's when I added the InitSioxErrMess-variable,
because I thougt the string exeeded the maximum length
for a msgbox. But with no result.

I hope someone has an idea.

[Edited by onerrorgoto on 05-15-2000 at 09:57 AM]