Pass parameter through selectFile()/selectFolder();

selectInput("Select a file to process:", "fileSelected");

How do I pass the parameter for a variable I wish to update in this type of function?

void fileSelected(File selection){
  if(selection != null)BMS.File.value = selection.getAbsolutePath();
};

Thanks

We can’t choose any callback’s parameters. Its signature is fixed for the caller! :telephone_receiver:

thanks for you reply

i’m just reading through the following trying to make sense of it, but its a bit above my current skills;

For now Ive opted to create a filewriter class which takes as parameter the class it will be updating, having a global variable where things are temporarily stored, and a boolean in the fielwriter class to check if its opened the menu.

Then if the boolean is true, a listening function in the other class can grab the global string value and then clear it. This should avoid conflicts with other filewriter instances.

as an alternative another class can be used to manage the folder/file variable instead of setting a global var.