Search found 819 matches

by Bugala
Fri Oct 04, 2019 11:54 am
Forum: General programming
Topic: Is there way to have reference that survives CopyTable()?
Replies: 1
Views: 64

Is there way to have reference that survives CopyTable()?

Had a nasty bug to hunt until I realised where the problem was. here is an example code which illustrates the problem: reftable = { a="1" } tabletwo = { reftable = reftable } tabletwo.reftable.a = 2 DebugPrint(reftable.a) tablethree = CopyTable(tabletwo) tablethree.reftable.a = 3 DebugPrint(reftable...
by Bugala
Fri Oct 04, 2019 8:10 am
Forum: General programming
Topic: Any way to save current eventhandler option?
Replies: 9
Views: 190

Re: Any way to save current eventhandler option?

In case someone needs the possibility to save or even manually start one of the event functions, here is a small test based upon SamuraiCrows suggestion: global t_EventHandlers = {} funccopy = InstallEventHandler InstallEventHandler = Function (table) ForEach(table, Function (ID, item) t_EventHandle...
by Bugala
Thu Oct 03, 2019 8:20 pm
Forum: General programming
Topic: Any way to save current eventhandler option?
Replies: 9
Views: 190

Re: Any way to save current eventhandler option?

hmm.. That is an interesting thought.

I was about to settle for another solution, but now that you mention that, going to give some thought about that one, for that would also solve one problem why i was about to move away from the original idea of saving OnMouseUp temporarily.
by Bugala
Thu Oct 03, 2019 8:47 am
Forum: General programming
Topic: Any way to save current eventhandler option?
Replies: 9
Views: 190

Re: Any way to save current eventhandler option?

I still don't see how I can get it if I don't know it? That lets put it like this, first there is this part of code that I cant access nor know: rando = rnd(2) if rando=0 InstallEventHandler({OnMouseUp=func1}) else InstallEventHandlet({OnMouseUp=func2}) endif supposing I have no access to "rando", I...
by Bugala
Wed Oct 02, 2019 10:58 pm
Forum: General programming
Topic: Create tables
Replies: 8
Views: 164

Re: Create tables

Actually it is possible to affect Global variables names in Hollywood since all variables are stored in table "_G":

Code: Select all

_G["test"] = 1
DebugPrint(test)
However, I do recommend sticking on multiple dimension table rather.
by Bugala
Wed Oct 02, 2019 9:55 pm
Forum: General programming
Topic: Any way to save current eventhandler option?
Replies: 9
Views: 190

Re: Any way to save current eventhandler option?

Thats what I think too, but how?

for when using command:

Code: Select all

InstallEventHandler(  {  OnMouseUp = function  }  )
There is clearly table going there, but where is the table?

it looks like it could be accessible through TableX.OnMouseUp, but what is the TableX?
by Bugala
Wed Oct 02, 2019 4:25 pm
Forum: General programming
Topic: Any way to save current eventhandler option?
Replies: 9
Views: 190

Re: Any way to save current eventhandler option?

Otherwise yeah, but then my class wouldnt be independent anymore. I am trying to keep that class independent so I can move it from one program to another. If I have to keep track of it manually, then I might forget to do that one time, and will have great difficulty in figuring out why something isn...
by Bugala
Wed Oct 02, 2019 11:35 am
Forum: General programming
Topic: Any way to save current eventhandler option?
Replies: 9
Views: 190

Any way to save current eventhandler option?

What I would like to do is following: InstallEventHandler(OnMouseUp, Function () Resume EndFunction) What however worries me is that maybe I have another Eventhandler already done and now this would be replacing the old one, even I didnt mean to, since this one is meant to be in use only temporarily...
by Bugala
Sat Sep 28, 2019 9:01 am
Forum: General programming
Topic: Anyone done script system that is written to a file?
Replies: 14
Views: 453

Re: Anyone done script system that is written to a file?

Almost forgot to comment back. Yes I took a look at your code and it was useful look. I decided to take for my current script system a different approach, mainly because in your script system there was need to having defined each command as keywords for it to recognise them, and this was problematic...