In recent weeks I've been writing a long program (1205 lines currently). For the window your code is executed in, I use the GameWindow of the Data extension. So this way you get advanced features with your code. This program is a basic programming language like small basic. Here are a few features and stuff that help make up the program:
• I use an array when declare variables. This would be the code to use: "variable(example, "value")" when writing your program
• To keep compiling, I use a while loop. Here's the small basic code I used:
While File.ReadLine(filepath, i) <> "" Or File.ReadLine(filepath, i+1) <> "" Or File.ReadLine(filepath, i+2) <> ""
• Inside of this while loop is a HUGE if statement. So if the user types an object in and compiles it, I use text.startswith to get the object, then use the if to call a subroutine, which then has another huge if statement.
• On the first line of your code, you always declare your type: "type="Library or Application"". So if you declare the type as library, this allows you to create your own functions and properties to use. When using these custom libraries in small basic, I just create a new subroutine using the FC extension, then evaluate the code inside of the library file (i use dll too) which is found in the lib folder in the directory of this program. So here's an example of a code you could use:
/So here I just create a new object
New Property("propertyname", "currentvalue")
***This is like the xml. You just type your summary here
/Returns the value of a variable or string
/basic code to execute. Could be a property to set the title of the window
Functions and events don't work yet.
• There is a list of objects, functions, properties and events in a list like small basic to the right of the window. So far it only lists the stuff that is in the library I make.
• Intellisense is alright, but you press Ctrl+Alt to open it. RightShift to scroll down the list, RightShift to scroll up.
It's a working progress, but it's coming along great so far. Please post here any suggestions you may have for me, and when I'm done, I'll post the import code if it is not to big to be published, and you can try it out.
- Changed type AirWaves Saturday, February 26, 2011 8:59 AM