Results 1 to 3 of 3

Thread: commands stored in a varible

  1. #1

    Thread Starter
    Member bcx7's Avatar
    Join Date
    May 1999
    Location
    Adelaide, South Australia, Australia
    Posts
    46

    Unhappy

    How can i execute a command which is stored in a varible?

    an example is making a program that the user can write commands in a textbox and the computer will execute them.

    (i am not making this program but i'm using it as an example. it wouldn't be a good program anyway)

    could somebody help me please?

  2. #2
    Guest
    well, obviously you will have to decide on some syntactical structure and then use the Left$() Mid$() etc... functions to extract the info. Its dead easy really if you write the code in a coherent fashion.

  3. #3
    _______ HeSaidJoe's Avatar
    Join Date
    Jun 1999
    Location
    Canada
    Posts
    3,946

    That's a big one.

    easier if you use option buttons.

    ie. opt 1 Close This Form Open Form Two
    opt 2 Close Form Two Open Form One

    Option Explicit

    Public OptionBtn as String

    Select Case OptionBtn
    Case "1"
    Call Close1
    Case "2"
    Call Close2
    End Select

    Public Sub Close1
    frmOne.visible = false
    frmTwo.visible = true
    End Sub

    Public Sub Close2
    frmTwo.visible = false
    frmOne.visible = true
    End Sub


    Private Sub cmdPerformTask_Click
    If Form1.opt1.Value = True Then OptionBtn = "1"
    If Form1.opt2.Value = True Then OptionBtn = "2"
    End Sub



    "A myth is not the succession of individual images,
    but an integerated meaningful entity,
    reflecting a distinct aspect of the real world."

    ___ Adolf Jensen

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width