Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Z function :)
#11
Aga, about the idea, just keep it in mind for the future as a good thing to automate.
*****
Reply
#12
arrr
Peace cannot be obtained without war. Why? If there is already peace, it is unnecessary for war. If there is no peace, there is already war."

Visit www.neobasic.net to see rubbish in all its finest.
Reply
#13
Code:
sub evaluate (n$)
open "thing.bas" for output as #1
print #1, "PRINT "; n$
close #1

chain "thing.bas"
end sub
Big Grin

(If the value needs to be returned to the main program, thing.bas could write the answer to a file, and evaluate() could read it back.)
Reply
#14
RST,

Great idea! Agamemnus and I had the exact same idea on the Expression Evaluator Challenge, that is, pass the expression to a Basic program and let it evaluate it. It's foolproof that way, and handles all the complexities and functions that Basic accepts.

However, the 3 of us are alone in this thinking.
*****
Reply
#15
Then what are the arguements against using it? If CHAIN doesn't work in compiled programs, it seems like you'd be able to use SHELL to compile thing.bas and run it from there.

Not that Aga's code isn't good. I don't think I'd have been able to do it that way....

EDIT:
Just read the thread in the challenges section. Sorry about the redundancy, you don't need to respond.
Reply
#16
I don't know what the arguments are against using it. In my version you will note, that I generate the dummy program, shell to compile it, and then shell to run it. No worrying about doing a CHAIN.
*****
Reply
#17
Well, I would not use it in a real, big app, mainly 'cause of memory issues. QB itself or the BC compile take much memory. Running this method from within a QB program will probably cause an out of memory error.
SCUMM (the band) on Myspace!
ComputerEmuzone Games Studio
underBASIC, homegrown musicians
[img]http://www.ojodepez-fanzine.net/almacen/yoghourtslover.png[/i
Reply
#18
Nathan,
Yuo're probably right about problems doing this in a QB program. But what if you compiled the program to an .EXE, and ran the .EXE which shells to the compiler? This way should be stable, don't you think?
*****
Reply
#19
Well, I've had problems. In a big program (~100 Kb EXE) I implemented a DOS shell. In the DOS shell, typing MEM I got a read of more or less 200 Kb of free memory (My EXE and its arrays were on memory).

As I said, the sollution could not work when used from within a BIG program. It is cool if the program itself is small, but as fast as some arrays are set, some depth of SUB calling is added, and the EXE is big, you won't have enough memory to call BC to compile.
SCUMM (the band) on Myspace!
ComputerEmuzone Games Studio
underBASIC, homegrown musicians
[img]http://www.ojodepez-fanzine.net/almacen/yoghourtslover.png[/i
Reply
#20
Nathan,
You're probably right, if the expression evaluator module was part of a large program.

However, I think that using the expression evaluator within a large program is probably the least common usage and actually quite seldom. The most common usage is an expression evaluator program that's standalone, and this usage should not have memory problems doing a shell to compile or run.

¿Estás de acuerdo?........Do you agree?
*****
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)