Integrated Program - Passing Variable Problem

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • BTDog
    New Member
    • Sep 2006
    • 1

    #1

    Integrated Program - Passing Variable Problem

    I am currently attempting to write an integrated program with a MapInfo application and am having a problem with what should be a very simple process in VB 6.

    I cannot seem to pass the contents of a string variable to a variable within MapInfo's integral coding system, MapBasic. It works perfectly well if I call out the variable as an integer and it also works if the text string is "hard" coded into the command line.

    The error message I am receiving is "Variable or Field ______ Not Defined.

    I'm sure that it must be something to do with the syntax I am using, but I just cannot crack it.

    Code:
    Dim roadnamex As String
    
    roadnamex = Text2.Text
    
    mi.do "dim Cname as string"
    
    'mi.do "Cname = ""textstring"" "    ' HARD CODED - THIS WORKS
    
    mi.do "Cname =  " & roadnamex & " "    'WITH VARIABLE - THIS DOES NOT WORK
    Many thanks for any help offered.
Working...