Self modify program

Blitz3D Forums/Blitz3D Beginners Area/Self modify program

splinux(Posted 2005) [#1]
Does anyone know how to make a program wich can modify itself?


splinux(Posted 2005) [#2]
I tryed modifying an included file, but it don't work,...


Beaker(Posted 2005) [#3]
You can't do it. Include files are compiled into your exe so modifying them will just change your source code.


splinux(Posted 2005) [#4]
I'll not make an exe, but run by the compiler.


Beaker(Posted 2005) [#5]
Same thing.


splinux(Posted 2005) [#6]
Is there anythings wich i can do?


Beaker(Posted 2005) [#7]
Learn assembly/machine language. But why bother?


splinux(Posted 2005) [#8]
I've got an idea:
i'll not make a program that will modify itself but a program that will modify, for example an html file.


Beaker(Posted 2005) [#9]
Another option is to use something like BVM.


splinux(Posted 2005) [#10]
In which way?


BobR3D(Posted 2005) [#11]
You CAN'T write a program in Blitz which modifys ITSELF, but you CAN write an "interpreter" in Blitz which executes a script (text file), and the script could modify the script.


GfK(Posted 2005) [#12]
You CAN'T write a program in Blitz which modifys ITSELF
Yes you can. ;) To a point, anyway.


splinux(Posted 2005) [#13]
In wich way i can?


splinux(Posted 2005) [#14]
I found a method which doesn't use BVM.
Simply the program(source code) write itself and then, using blitzcc.exe, it compile the its source code and end itself.
So, i can write a program wich modify itself.


DH(Posted 2005) [#15]
Sounds a bit long winded (write a program to execute the blitz compiler on a file that you are modifying - with the program - and re-run the new program)...

Just use BVM or F. Tayler's BlitzScript.


splinux(Posted 2005) [#16]
no, for my programs BVM isn't convenient...


Beaker(Posted 2005) [#17]
You won't be able to distribute them tho.


DH(Posted 2005) [#18]
You won't be able to distribute them tho.

BINGO!


splinux(Posted 2005) [#19]
The program i would like to create will use the technique of modifying itself to be able to learn and improve their code, like genetics and evolution.
In fact they will be able to evolve!


Damien Sturdy(Posted 2005) [#20]
Splinux... How about BlitzScript? Sorry, i dont have a link right here, but i did get to play with it once, and it was bloody amazing how it worked. Should be around the forum somewhere...


splinux(Posted 2005) [#21]
But, is possible with blitzscript exec a file only when a blitzbasic program asks?