Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

Dx8 Error [Easy Question!]


Jumbofile
 Share

Recommended Posts

That solves it. Check the code again. Type mismatch occurs when an invalid type is passed or tried to stored in a variable. Since the error occurs when your calling a sub, cross check ur parameters and the arguments of the sub. If they are the same type then I am not sure what the error can be. Otherwise it might fix your problem.
Link to comment
Share on other sites

'Evilbunnie's DrawnChat system

Public Sub DrawChat()

Dim i As Integer

For i = 1 To 6

RenderText Font_Default, Chat(i).Text, Camera.Left + 10, (Camera.Bottom - 20) - (i * 20), Chat(i).Text, Chat(i).Colour

Next

End Sub

'Evilbunnie's DrawChat system

Public Sub ReOrderChat(ByVal nText As String, nColour As Long)

Dim i As Integer

For i = 19 To 1 Step -1

Chat(i + 1).text = Chat(i).text

Chat(i + 1).Colour = Chat(i).Colour

Next

Chat(1).text = nText

Chat(1).Colour = nColour

End Sub

Public Sub AddText(ByVal Msg As String, ByVal color As Integer)

Dim S As String

' If debug mode, handle error then exit out

If Options.Debug = 1 Then On Error GoTo errorhandler

S = vbNewLine & Msg

frmMain.txtChat.SelStart = Len(frmMain.txtChat.Text)

frmMain.txtChat.SelColor = QBColor(color)

frmMain.txtChat.SelText = S

frmMain.txtChat.SelStart = Len(frmMain.txtChat.Text) - 1

'Evilbunnie's DrawnChat System

ReOrderChat Msg, QBColor(color)

' Error handler

Exit Sub

errorhandler:

HandleError "AddText", "modText", Err.Number, Err.Description, Err.Source, Err.HelpContext

Err.Clear

Exit Sub

End Sub
Link to comment
Share on other sites

Oh god. You still didn't understand did you? I'll check it and post the solution soon.

Replace this (Your code)

```

RenderText Font_Default, Chat(i).Text, Camera.Left + 10, (Camera.Bottom - 20) - (i * 20), Chat(i).Text, Chat(i).Colour

```
With this (My code)

```

RenderText Font_Default, Chat(i).Text, Camera.Left + 10, (Camera.Bottom - 20) - (i * 20), Chat(i).Colour

```
Rather than passing the color code you were passing a string (The second last parameter should be a number you were passing a string)
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...