What is this type of code called?
Posted: Wed May 18, 2011 7:51 pm
I asked a programming friend of mine what this is that I made and he said it sounded like self modifying code, however he didn't really understand what it was I had even done. Maybe some of you guys know and can tell me.
I call it useless, but I would really like to know.
I call it useless, but I would really like to know.
Code: Select all
Macro CreateConstant(ConstantName, Value)
#ConstantName = Value
EndMacro
CreateConstant(MyConstant, 1)
CreateConstant(MyButton, 2)
OpenWindow(#MyConstant, 0, 0, 200, 200, "Useless code in action!", #PB_Window_ScreenCentered | #PB_Window_SystemMenu)
ButtonGadget(#MyButton, 5, 5, 100, 50, "Some Button")
Repeat
Delay(10)
If WaitWindowEvent(1) = #PB_Event_Gadget
Select EventGadget()
Case #MyButton
MessageRequester("Message","Useless, I know")
EndSelect
EndIf
Until WaitWindowEvent(1) = #PB_Event_CloseWindow