[Gambas-user] GAMBAS 0.57 Type mismatch...

Claus clschmid at ...17...
Sat May 31 21:31:37 CEST 2003


Hi, 

I have a problem with the EXEC Command in the GAMBAS-Version 0.57.
I' ve tried to execute a programm via the shell, but GAMBAS always shows 
the following error:

Type mismatch: wanted Sting[], got String instead

What is going wrong there ??

Claus





Here is the example Code with the Error-Line marked.

STATIC PUBLIC SUB Main()
myform AS Form
myform = NEW Ftest1
myform.show()
END


PRIVATE myProcess AS Process

'------------------------------------------------

PUBLIC SUB _new()
  ME.Title = "Working with EXEC"
  ComboBox1.add("gambas")
  ComboBox1.add("ls")
  ComboBox1.add("kwrite")


END

'------------------------------------------------
' start it

PUBLIC SUB btnFire_Click()
  IF Trim(ComboBox1.Text) <> "" THEN

'Trim strips the whitespaces from a string

    TextArea1.Text = ""
    TextArea2.Text = ""

' call it
' ************  Here comes the error *******************
    EXEC ComboBox1.Text FOR READ WRITE AS myProcess
  ELSE
    TextArea1.Text = "please choose or enter a program to execute"
  ENDIF
END

'-------------------------------------------------------------

PUBLIC SUB btnClose_Click()
  ME.Close()
END


'------------------------------------------------
' if something is coming back
' the event 'Process.Write' of the class process calls this function

PUBLIC SUB Process_Write(sData AS String)
  TextArea2.Text = " Process '" & myProcess.command & "' " & sData
END

'------------------------------------------------
' if an error occurrs
' the event 'Process.Error' of the class process calls this function

PUBLIC SUB Process_Error(sData AS String)
  TextArea1.Text = " Process '" & myProcess.command & "' " & sData
END

'------------------------------------------------
' if the process is killed
' the event 'Process.Kill' of the class process calls this function

PUBLIC SUB Process_Kill()
  myProcess = NULL
END





More information about the User mailing list