*Hi guys...I am currently working on a really basic scripting langauge that gets the first 4 letters of a textbox's content (in a Windows Form project) and compares it to a in-program list of keywords and then uses the remaining characters to form an argument to the keywords...
I was wondering weather you had some code ideas on how to go about placing the first 4 letters in one variable and then the remaining characters into another.

My langauge will be single command.. i.e you will only be able to run one command per program.


4 Years
Discussion Span
Last Post by tinstaafl

Sorry guys, I apologise for the beginner question...This is my answer

Dim codefunction As String
Dim intxtbox As String
codefunction=Left(intxtbox, intxtbox.length -4)

I am yet to test this so please tell me if the code would be incorrect!


The Left function you're looking for isn't there anymore, but each string has a substring method, that basically combines the functionality of Left, Right and Mid from VB6, that will do the job:

codefunction=intxtbox.Substring(0, 4)

Edited by tinstaafl

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.