vendredi 30 janvier 2015

C# RichTextBox Line-by-line scan

Hey Im creating my own coding language and I already have the entire application set up with save, open, close, new, etc.


In order for the "Run" part to work, I need a way to scan and test every single line in richTextBox1.


Maybe for past Java users, something along the lines of the "java-util-scanner," but easier to use for testing each line.


Does anyone know a way to do this, where a string "scannedString" would be tested as so:



if(scannedString == "#load(moduleFiles)") {
//action here
}
string scannedStringNextLine = ???
if(scannedStringNextLine = "") {
//action here
}


Eventually it would look more like this:



if(scannedString == "code1" || scannedString == "code2" etc... ) {
if(scannedString == "code1") {
//action here
}
} else {
//error message
}


hope this is enough information...


Aucun commentaire:

Enregistrer un commentaire