Re: TIB: Rewrite programs...?


[Prev][Next][Index][Thread]

Re: TIB: Rewrite programs...?




Well, you can use Define to create a BASIC program.  If you parse the Define 
and what you want in the program into a string, you can use Exec to generate 
the program.  I've used this to write a GUI generator that writes the 
interface according to the user's input.  It was kind of neat.  Do it like 
this:

Parse the string together so that the format is "Define 
ProgName(vars)=Prgm:program here:EndPrgm"-->A

There are a couple of ways to parse a string together like this.  Then do

Expr(A)

And the program (specified in ProgName) will be generated.  You don't need to 
store the sting into a variable, but most likely parsing it together will put 
it in a variable anyway.  The parsing is the hardest part by far.

And if you want to read a program and store that as a string to edit and 
Define back into a program....you can't.  Sorry.

                                            Grant Elliott
                                            <A 
HREF="http://www.crosswinds.net/~proganon">Programmers Anonymous</A> 

In a message dated 1/3/00 7:51:39 PM Eastern Standard Time, Raptor1MN@aol.com 
writes:

> I was wondering if there is any to have a basic program rewrite another 
basic 
> 
>  program...like a patch...
>  and on an unrelated topic, my game has 70-some downloads...yay for 
me...hehe.
> 
>  Raptor1MN@aol.com