Post Reply 
self modifying code
04-04-2019, 06:40 PM
Post: #1
self modifying code
It occurred to me today that self modifying code is easily done in PPL. Save the following program as HiBye and run it a few times from Home.

Code:
EXPORT HiBye()
BEGIN
 LOCAL source;
 
 source:=Programs("HiBye");
 IF INSTRING(source,"He"+"llo") THEN
  source:=REPLACE(source,"He"+"llo","Good"+"bye");
 ELSE
  source:=REPLACE(source,"Good"+"bye","He"+"llo");
 END;
 Programs("HiBye"):=source;
 RETURN "Hello";
END;


hee hee.
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
self modifying code - Wes Loewer - 04-04-2019 06:40 PM
RE: self modifying code - Carlos295pz - 04-04-2019, 10:43 PM
RE: self modifying code - Wes Loewer - 04-05-2019, 12:14 PM
RE: self modifying code - Carlos295pz - 04-05-2019, 01:02 PM



User(s) browsing this thread: