Home | Reviews | GUIpedia | Forum | Fun500
Brandon | ReflowI see kyles new Reflow project. Whats with all the experienced coders and wacky ideas how the Computer should work.:P I think It might be need to see materialize (so I can steal all the cool stuff). | 2008-08-22 | 2:55 PM |
ksr | Re:ReflowYeah, I've sort of set the bar high for myself. It's gonna happen though - making smooth and fancy graphics is no problem anymore, thanks to FreeBASIC. And I'm really making progress with the scripting language. | 2008-08-22 | 3:02 PM |
Brandon | Re:ReflowGot a screenshot? When can we expect a Demo? | 2008-08-22 | 3:06 PM |
ksr | Re:ReflowHey, I haven't got it out of text mode yet lol. I'm not too far away from GUI mode though - I've just got to flesh out TNT with some commands, and then write the handlers. | 2008-08-22 | 3:21 PM |
Brandon | Re:ReflowWell I suppose Text mode is better than nothing. | 2008-08-22 | 3:26 PM |
ksr | Re:ReflowI've just got user subroutines (functions) working in TNT (the scripting language). This is the first part of the GUI back end, because events (such as button clicks, etc) are handled by special user functions. They work sort of like an interrupt: the locations of the handlers are kept in a vector table, and are jumped to when the event happens.
This means that you don't actually need a 'main loop' in TNT scripts - all the code could be in the handlers. This also means that the 'end' statement at the end of a script isn't implied like in BASIC: If you don't put it there, the script will still execute, waiting for an event. | 2008-09-16 | 5:33 PM |
ksr | Re:ReflowLatest power feature: functions and overloading.
When you define a function in TNT, you don't specify how many arguments it takes. You access them with the [i]arg n[/i] command, which returns the nth argument.
Here's an example of a put (print) replacement (useless as it itself uses the put command :P):
[code]{ function newput
{ if [= [arg 1] "-nonewline"]
put -nonewline [arg 2]
}
{ else
put [arg 1]
}
}
newput -nonewline "Hello"
newput "Hello"[/code]
As you can see, the function requires either 1 or 2 arguments, depending on the value of the first.
Here's a more realistic example of a better-designed function that replaces put, with an added "-caps" switch that causes the output to be in upper case:
[code]{ function newput
#textptr points to the argument which contains the text to be displayed
set textptr 1
#flags
set nonewline 0
set caps 0
#loop through first 3 arguments
set x 0
{ while [< $x$ 3]
set x [+ 1 $x$]
{ if [= [arg $x$] "-caps"]
set textptr [+ 1 $textptr$]
set caps 1
}
{ if [= [arg $x$] "-nonewline"]
set textptr [+ 1 $textptr$]
set nonewline 1
}
}
#dereference
set textptr [arg $textptr$]
#perform actions found and display
{ if [= $caps$ 1]
set textptr [upper $textptr$]
}
{ if [= $nonewline$ 1]
put -nonewline $textptr$
}
{ else
put $textptr$
}
}
#all valid
newput "Hello"
newput -caps "Hello"
newput -nonewline "Hello"
newput -caps -nonewline "Hello"
newput -nonewline -caps "Hello"[/code] | 2008-09-17 | 4:20 PM |
| Re:ReflowWhat exactly does the QBasic CHAIN command do? | 2008-09-17 | 6:20 PM |
jasonwoodland | Re:ReflowI think it's for Running BAS, EXE, BAT files. | 2008-09-17 | 6:37 PM |
Todd | Re:ReflowThat's amazing, Kyle! Functions and overloading are a big step in programming a programming language! I have ideas for making an online scripting language too to help speed up the web-design process as well as to instruct programming.
My ambitions are also to make a system-based, visual programming language. Similar to how VB can drag and drop window objects and create programs, I have a similar concept in mind. The only problem is that I'll be looking for something efficient to use. C++ and Delphi are pretty efficient but Delphi doesn't do SWITCHes with strings, only integers. :( So I'll be doing the old IF and ELSEIF statements for each command parsed.
I did actually make a BATCH-like Windows-based programming language called Visual Q. I made it a couple of years ago but if you're interested in seeing how it works, just let me know and I'll send you a copy. It had some minor flaws (i.e. a function within another in a single expression) that caused problems but overall it's a pretty powerful language. I made a calculator program in it. | 2008-09-17 | 9:22 PM |
ksr | Re:ReflowThat sounds very interesting, Todd. I'd appreciate a copy :) | 2008-09-18 | 12:13 PM |
ksr | Re:ReflowReflow is now being hosted at:
http://code.google.com/p/reflow/
I will add to it soon, with some wiki pages and maybe a sreenshot mockup I have. When the project gets going though, all downloads, bugs and feature requests will be handled through that site. | 2008-09-26 | 2:46 PM |
Todd | Re:ReflowSorry for not seeing that previous post, Kyle. I uploaded a copy of "Visual Q" which I called the language at that time. It's relatively simple to learn and in the "syntax.txt" file lists all the functions and commands. I never got around to making a well-flowing help and documentation file but I will be working on a VM-like programming language which I will document.
http://www.sixbynine.net/filequick/117
The "ds32.exe" file was just an experiment with a 32-bit interpreter which is still very riddled with bugs. | 2008-09-26 | 3:20 PM |
ksr | Re:ReflowWow, Todd, I'm impressed! How do you manage to compile EXEs? | 2008-09-26 | 3:35 PM |
Todd | Re:ReflowIt doesn't really compile EXEs since it's 16-bit and just an interpreter. I hope in the VM, I can have it compile EXEs into a VM-interpreted byte-code. | 2008-09-26 | 5:12 PM |
ksr | Re:ReflowAh, I see what it does now. Does it just create a copy of DSRUN.EXE, with the code attached as a resource or something?
edit: nevermind, now I see that the code's in the DLL :) | 2008-09-26 | 6:13 PM |
Todd | Re:ReflowYeah, that's the only choice I had. Which is why I plan to do 32-bit since I can write byte-code to the EXE and embed it so the EXE reads the byte-code and doesn't need any external files.
But to compile the code to machine code would require a lot of knowledge in Assembly. I know the innerworkings of Assembly but I just don't know the instructions for every A, B, C, and D tokens. | 2008-09-26 | 6:32 PM |
GUIs
2021 Brandon Cornell