Home | Reviews | GUIpedia | Forum | Fun500
aguma | Mod LogHere I'll post all the modifications I make to Spark.
Today I changed RAM to a string array, so putting a number will actually put STR$(number). This way a string won't take up the entire memory and I can write programs more easily.
Also I added LINFSTR and LINFNUM, line input instead of regular input functions. Then I copied and pasted (and wrote a bit of code to make use of) ksr's overlap / intersect function (don't worry, you get credit). I fixed a simple but really annoying error with closing programs where I forgot to delete the cmp result, which made running the next program not work properly.
Lastly I added a PRIORITY command which sets the number of instructions at a time that are executed for a script. (Default is 1) | 2009-03-21 | 7:38 PM |
aguma | Re:Mod LogQuick update: there's a new label, "GOCLOSED:", that must be in your program. The system automatically goes there when the user clicks the close button. Typically you would just put 'END' right after it but sometimes you might need to free memory, erase files, etc. before closing. | 2009-03-21 | 10:41 PM |
aguma | Re:Mod LogI've decided to add IFs to Spark's scripting language because all the GOTOs were making it slow and confusing to code. :P The high-level language is going to be cat-based (see http://cat-language.com/)--at least so far; maybe I'll change it later. That's about it for now. | 2009-03-23 | 6:46 PM |
pharoah | Re:Mod LogWhat I do for IFs is ignore them if the value is true, if it's false I do something like this (where next_word is a function that keeps grabbing the next word from the code):
[code]
x = 1
do
select case next_word
case "if"
x += 1
case "then"
x -= 1
end select
if x = 0 then exit do
loop
[/code]
It's not that hard, and it allows for nicely nested IFs. (By the way, to understand this code you need to know that in FORTH then ends an if block, like end if does in BASIC)
==============
EDIT:
Another language like cat you might want to check out is FACTOR. It's closer to FORTH and probably a bit simpler to implement. I'm a bit biased, though, because I'm not the biggest fan of general purpose functional languages and I hate the type system in Ocaml. | 2009-03-23 | 9:01 PM |
aguma | Re:Mod LogActually, I already did exactly what you wrote. I knew about FACTOR, although I didn't know anything about it, so I suppose I'll try implementing it...unless I find a better and easier one soon. Thanks! | 2009-03-23 | 9:13 PM |
aguma | Re:Mod LogOkay, I've decided that writing code using just the stack has gotten WAY TOO CONFUSING! lol and if I need memory, I have to allocate RAM, assign the result to ACCUM, add a value to ACCUM depending on which part of RAM I want to access (you can't just access 1 index in the array unless the program doesn't really do much), and then I have to get the ram and do something with it and then store it back and then retrieve it again so I can do more calculations with it...OMG!!! Too confusing!
So I'm adding some support for variables. | 2009-03-24 | 11:25 PM |
aguma | Re:Mod LogHow exactly would I do variables?
Never mind, I figured out why they weren't working. Spark has 3 new commands: VAR, SETV, and GETV. VAR makes a variable, SETV sets a variable's value, ad GETV gets a variable's value. This'll make programming SO much easier! | 2009-03-25 | 6:57 PM |
aguma | Re:Mod LogI just changed all the screenset commands to screenlock/screenunlock. It's slower on Windows because there's like 1000000 things I have to pass through to lock the screen, but in DOS it's a lot faster, plus I saved like 2mb because I don't have to use another page! | 2009-03-30 | 1:14 PM |
| Re:Mod LogSpark looks really interesting. Let me know when there's a new version out that has all these commands. I want to write a QGET based QML reader, although I will need some sort of array-type functionality (or just the old RAM system if you left it in). I can't remember if you have the ability to read files, but I will need that and a chr$( and asc( function, and mid as well to do this.
Your progress is really impressive! | 2009-03-30 | 2:00 PM |
aguma | Re:Mod LogOh my god, I just realized I forgot chr$ and asc...:P Well, I'll try to remember those later...I'm reading this really interesting book my dad gave to me. By the way, any tips for increasing the speed of a program? It's so darn slow right now. Well, not that slow but I want to make faster. | 2009-03-30 | 2:03 PM |
Brandon | Re:Mod LogWell make it do less in a loop :P
The less it does the faster it seems :P | 2009-03-30 | 3:56 PM |
aguma | Re:Mod LogWow, that really worked! Thanks for the help!
Ok I deleted all the commands, except for END and SHUTDOWN. Now it works lightning fast!!! Except of course, it doesn't do anything anymore.
(Not really)
Anyway just to get an idea, who would like to develop for Spark? | 2009-03-30 | 4:03 PM |
Brandon | Re:Mod LogIf its not like trying to write Japanese, I will. | 2009-03-30 | 4:20 PM |
aguma | Re:Mod LogI'll write a simple "compiler" that'll turn things like
blah 30,90,"It"
into
PUSH30
PUSH90
PSTRIt
BLAH
And I'll also write a window designer. That way it'll be like using an english-japanese translator instead of writing japanese :P | 2009-03-30 | 4:24 PM |
aguma | Re:Mod LogWow, I just finished the compiler and it was a lot easier than I thought! :P Now you can write programs without having to type like 1000 lines.
By the way, I just finished playing this insanely hard song on the piano and now the keyboard feels like I'm not pressing anything. (lol) | 2009-03-30 | 7:25 PM |
Brandon | Re:Mod LogThe compiler is a good idea, It should dummy things to my level. | 2009-03-30 | 7:52 PM |
pharoah | Re:Mod LogDo you happen to have a copy of that compiler? Still devving your QML reader :) | 2009-03-30 | 9:06 PM |
aguma | Re:Mod LogYep, and by the way you can do stuff like
if n > 30 then
blah blah blah...
else
blah blah blah...
endif
[url=http://xeneth.theguiblog.com/Download/compile.zip]Download here[/url] | 2009-03-30 | 9:29 PM |
aguma | Re:Mod LogI just fixed a bug in the windowing engine where it would select a window that was completely inside another window (you missed a spot, ksr :P). I'm almost ready to release again - it'll probably be out today. Maybe. lol | 2009-04-02 | 1:26 PM |
aguma | Re:Mod LogAccording to FB help: "The accuracy of Sleep is variable depending on the OS cycle time (Windows NT/2K/XP: 15 ms, 9x/Me: 50 ms, Linux 10ms, DOS 55 ms)." Is there any way I can do a delay and have it last the same amount of time in DOS and Windows?
btw: the timer thingy doesn't work in dos
EDIT: Being totally insane, I made a QB delay program and called it from my delay function! it works great, but it's sort of stupid. :P It's the only way I could do it though. | 2009-04-02 | 2:40 PM |
ksr | Re:Mod Log[b]aguma wrote:[/b]
[quote]I just fixed a bug in the windowing engine where it would select a window that was completely inside another window (you missed a spot, ksr :P). [/quote]
Good catch! As for a more accurate timer, try this: Have this code run at initialisation
[code]dim as single t1, t2
dim as long i, j
t1 = timer
for i = 0 to 100000000
next i
t2 = timer
j = 100000000 * .001 / (t2 - t1)
[/code]
Then for a delay of x milliseconds:
[code]
for i = 0 to j*x
next i
[/code] | 2009-04-02 | 2:53 PM |
aguma | Re:Mod Logwell i think the little dos delay program will do an adequate job :P | 2009-04-02 | 2:58 PM |
Brandon | Re:Mod LogUse the TIMER$ function (I think thats what its called), its seconds from midnight. | 2009-04-02 | 4:07 PM |
aguma | Re:Mod Logwell that's what my QB delay program does. it wouldn't work in FB. So weird. | 2009-04-02 | 4:14 PM |
pharoah | Re:Mod LogYour DOS delay program will have additional untimed delay resulting from the execution of a new program.
Really you are better off just using sleep. The resolution changes, but for most uses it's decent enough. A delay in multiples of 50 milliseconds will have negligible error. | 2009-04-02 | 7:00 PM |
aguma | Re:Mod Logi call the program when it starts, and record the time it takes to run it. then i subtract the time it takes for the program to load whenever I call the delay. | 2009-04-02 | 8:32 PM |
pharoah | Re:Mod LogSmart. The only problem I can think of in that case would be on an actual floppy disk based system, where the program might take 3 full seconds to load. Maybe you could put in a condition to forgo the delay or use something else if the load time is > the delay time. | 2009-04-02 | 9:23 PM |
aguma | Re:Mod LogI changed it to just use SLEEP when the call time is longer than the delay time. Thanks! | 2009-04-02 | 10:08 PM |
aguma | Re:Mod LogSpark 4 -
Right now the shell can execute commands! Yay! You can exit, get help, start a new shell, and even execute a program! Amazing! However the only 3 programs I have right now are shell, login, os :P
Anyway I've run into a small bug with the windowing engine: when you close a window, the window underneath doesn't get set as the active window. That's fixed easily though. :)
More later. | 2009-05-04 | 6:57 PM |
GUIs
2021 Brandon Cornell