Home | Reviews | GUIpedia | Forum | Fun500
ksr | ReflowI'm going to steal aguma's idea and post all Reflow updates in this thread. Feel free to post comments.
Yesterday I implemented file handling in TNT. There are five functions inspired by their Tcl equivalents: open, close, read, getf and putf. getf returns one line at a time while read returns the entire file as a string. putf works just like the put function (which is used to write to the screen). Some example code:
[code]#demonstrates file handling
set file1 [open fstest.txt w] #open test1 for writing
#file1 contains the file idenitifier
putf $file1$ Hello #write "Hello"
putf -nonewline $file1$ World #write "World" directly after
close $file1$ #close
set file1 [open fstest.txt r] #open the same file for reading
put [read $file1$] #write the contents of the file directly
#to the screen
close $file1$ #close[/code]
Plan for this week: implement arrays, more string manipulation functions, and start work on a QML reader. | 2009-03-23 | 3:56 PM |
ksr | Re:Reflow development threadArrays are done. This involved quite a major change: to get the value of a variable you do this : instead of $variable$ as before. This means you can nest variables like this: returns the value of variable array, which depends on what the value of x is. Example code:
[code]
#crude for loop (i might add a {for } construct later)
set x 0
{ while [< 10]
set x [+ 1]
set array [* ] #fill array with square numbers
}
set x 0
{ while [< 10]
set x [+ 1]
put #print each element
}
[/code]
Because of this nesting which is a key characteristic of TNT, there are many possibilities. Multi-dimensional arrays are done by putting the subscripts next to each other:
[code]set array "value"[/code]
You can have an array of arrays (currently trying to think if this might ever be useful):
[code]set array "value" #x arrays of n arrays each[/code]
This functionality isnt really built-in, or specifically coded for. It just comes about because of how TNT handles variables. So if you wanted, you can have the subscripts at the front (array) or in the middle, or the subscripts can be text, instead of numeric.
PS: Brandon, what happened to syntax highlighting? | 2009-03-29 | 8:03 AM |
Brandon | Re:Reflow development threadThe forum upgrade turned it of, should it be on?
Your GUI is looking good in concept :P | 2009-03-29 | 8:20 AM |
ksr | Re:Reflow development thread - console inputThere will be two different types of application in reflow, console and gui. This is set by the interface console or interface gui command at the top of the source code. At the moment as there is no GUI to speak of, only console applications are supported.
To get input in a console app you use the get command. This is like INPUT in BASIC - it will halt the script (although other running scripts will execute as normal) until the enter key is pressed.
An optional -s flag waits for a single keypress instead of a enter-terminated string, and doesn't print to the screen unlike normal get.
Plan for this week: string manip, QML reader. | 2009-03-30 | 6:19 PM |
Brandon | Re:Reflow development thread - console inputSo would a possibly at version 1 be a Console, 1 task at a time version for limited systems? | 2009-03-30 | 6:36 PM |
ksr | Re:Reflow development thread - console inputThe first public release will certainly be console-only. Multitasking is already fully implemented though, so there will probably be some task-swapping or screen-sharing facility. | 2009-03-30 | 6:49 PM |
Brandon | Re:Reflow development thread - console inputCool, I'm liking the idea so far, and from past experience, it seems you make a quality product. | 2009-03-30 | 7:46 PM |
ksr | Re:Reflow development - release 0.01This first release is console only as promised, and is essentially just a preview of the scripting language. It features a very basic QML reader (no hyperlinks yet, I'm working on it). There are some example 'applications' in the apps folder too. To run them, change the startup line in sysconfig.ini. You can actually list multiple startup apps, but they will run on top of each other.
If you are actually using DOS, rename wget.exe.dos in the sys folder to wget.exe.
Use w and s to scroll up/down in the QML browser.
Download: http://www.file-pasta.com/file/rf0.01.zip
More soon | 2009-04-03 | 8:28 PM |
pharoah | Re:Reflow development - release 0.01I'm getting a page fault in DosBox with CWSDPMI. | 2009-04-03 | 8:44 PM |
ksr | Re:Reflow development - release 0.01Yeah I'm not sure why it doesn't work in DOSBox. Are you on Windows? Can you try running it in a command prompt window? | 2009-04-03 | 8:51 PM |
pharoah | Re:Reflow development threadJust rebooted it, very impressive! I like the scripting language, one of the best I've seen. Also I believe you're the 3rd person in the world to write a QML reader :).
You need to make a homepage for it. | 2009-04-03 | 8:53 PM |
Brandon | Re:Reflow development threadIt won't run in DOSEMU either. | 2009-04-03 | 9:21 PM |
ksr | Re:Reflow development threadI'll try and investigate what is making it crash. In the meantime, Brandon, can you try it in Windows? | 2009-04-04 | 8:43 AM |
Brandon | Re:Reflow development threadI hate the devil, I think I can get out my thin client (which currently runs FreeDOS) and try it a little later. | 2009-04-04 | 10:06 AM |
ksr | Re:Reflow development threadI've stopped it crashing in DOSBox so hopefully it will work in DOSEMU now too. I didn't realise that DOSBox has no network support though so it's pretty useless.
d/l: http://file-pasta.com/file/rf0.02.zip | 2009-04-04 | 10:13 AM |
Brandon | Re:Reflow development threadPerhaps it would have worked in DOSEMU if I was smart enough to rename the WGET files :P Anyways, it does seem to work pretty well, considering it was made in a scripted language. I'm excited to see what comes next. | 2009-04-04 | 10:46 AM |
ksr | Re:Reflow development threadI've been 'porting' Reflow to GUI/graphics mode (release 0.03 coming soon..) and everything is working fine apart from this bit of code:
[code]
shell "sys/wget -q -O etc/url " + px
[/code]
For some reason, when wget is called, the I get a garbled screen. The -q means it shouldn't output anything to the screen, and I've tried sticking > nul on the end too. Anyone have any ideas? It works just fine (although extreeeemeely sloooowly) in DOSBox. | 2009-04-17 | 6:35 PM |
ksr | Re:Reflow development threadI'm not sure whether this is a bug with wget, FB or what. Running it on my laptop doesn't garble the screen but it distorts it, and you have to change screenmodes to correct it - not very convenient. Could you please run the attached wt.exe file and see what happens?
http://file-pasta.com/file/wget.zip | 2009-04-17 | 6:58 PM |
Brandon | Re:Reflow development threadIt worked for me in DOSBox. And in FreeDOS.
No garbling :P | 2009-04-17 | 7:01 PM |
ksr | Re:Reflow development threadWell, the wget in the zip is the Windows version, so that's maybe why it's working in FreeDOS (as it won't have executed wget). | 2009-04-17 | 7:10 PM |
Brandon | Re:Reflow development threadlol, that is very funny. Why'd you include the windows version? | 2009-04-17 | 7:44 PM |
ksr | Re:Reflow development threadBecause that's what I'm developing on :P
The DOS version of wget seems to work ok - it must be just a quirk with the Windows version, which is a shame.
Do you know of a wget alternative available for windows and dos? | 2009-04-18 | 10:43 AM |
Brandon | Re:Reflow development threadNope. Who cares if the Windows one has a quirk? It won't be there in the actual GUI, which will be on DOS. | 2009-04-18 | 10:51 AM |
pharoah | Re:Reflow development threadI'm trying to keep tabs on all the QML reader projects. How is this one going? | 2009-04-26 | 10:43 PM |
GUIs
2021 Brandon Cornell