nathan5420 0 Posted October 12, 2021 Hi, I have a variable in my top class (Let's call it myVar). I want to pass myVar to my node tasks (which I've done), then have the task use and edit the variable, and return and update the variable. So then the updated variable can be passed onto the next task. Long story short, I'm able to pass the variable to the node, but can't return the variable back. Here's an example: Public class MyFirstClass extends Taskscript{ int myVar = 0; @Override public void onStart() { addNodes(firstTask(myVar),secondTask(myVar); } } Thanks,
camelCase 304 Posted October 13, 2021 i keep global variables in a singleton class 'Config' use setters and getters to pass change it in each tasknode see https://github.com/milasoft/looter/tree/31d590192b8f2b2fe795ea78eff3a5482aa19515/src/milasoft/looter for an example of this setup
Recommended Posts
Archived
This topic is now archived and is closed to further replies.