Creating a turminal for other programming languages

starcraft

Centurion
Joined
Jun 29, 2003
Messages
167
Location
Poway CA
I would like to make a terminal for the scripting language 'Auto It' Cause i'm tired of using notepad which wont show u errors in the script. So i would like to make a terminal that would show me things like misspelled items, alow easy access to window titles, easy variable selection. But how do i do all this? I assume i would put the scripting commands into an array but how do i tell it to CONSTANTLY scan the spelling to tell the user when something is misspelled of incorrect?
 
This is no easy task... First, use a RichTextBox, for flexibility. I would suggest splitting the textbox into it's lines (just use the TextBox1.Lines collection), check the current line (RTB.GetCharFromPos, then RTB.GetLineFromCharIndex), and only scan that line on KeyPress. That'll make it faster.

You'll also need to detect if you pasted code into textbox (I guess by comparing the number of newline characters before and after the KeyPress event goes through) and if code *was* pasted, you need to scan the whole thing, rather than just the current line.

If you have any further, more specific problems, you should post here, but really, there's no right/wrong way to do it. Just optimize it as best you can.
 
yeah i have another one.:p Sence i will have an easy build method built in, i have buttons to add spacific code. BUT, how to i make an input box come up here they enter a value. EXAMPLE! Ok they click 'button1' it enters the text "hello" into richtextbox1 it then pops up and input box saying "Please indicate the expresion you wish to use" When the user presses ok it will take the info from input box1 and then add the current line in richtextbox1
 
You could make your own form with a TextBox and an OK and a
Cancel button, and overload the ShowDialog method so that it
accepts the question and returns a string of what the user
entered. You then have complete control over the dialog and how
it displays. For example, in a dialog with a TextBox, Label, and two
command buttons (with their DialogResult properties set to OK
and to Cancel):

Visual Basic:
Public Overloads Sub ShowDialog(query As String) As String
  Dim result As DialogResult

  Label1.Text = query ' Set the query so it shows up on the label

  result = Me.ShowDialog() ' Show the dialog

  If result = DialogResult.OK Then ' the user clicked OK
    Return TextBox1.Text ' return the textbox's value
  Else ' otherwise...
    Return Nothing ' Return Nothing (duh)
  End If
End Sub

Then, from another form:
Visual Basic:
Dim inputFrm As New InputForm() ' InputForm = whatever your named the dialog

Dim boyName As String = inputFrm.ShowDialog("What's your name little boy?")

MessageBox.Show("Why hello, " & boyName)

Or something. :p
 
Back
Top