using a DFREF in the concatenate function

Hi all,

I have a question, regarding the communication between folders. I have been looking through the exchange, but haven't found a solution. Perhaps you can help me:

I use the loadallfilesinfolder.ipf from Hrodstein to load several datafiles from one folder on my hard drive into their respective folders in my Igor project.

Within the larger loadallfilesinfolder there is the Loadonefile() function. In that function, I have put in some code of myself, as shown below:

LoadWave/J/D/W/A/K=0/L={7,8,0,0,0} "$dfname"

make/N=(1) Average1,Sdev1

Wavestats /M=2/Q/R=[0,90] :X_mv
Average1=(V_avg)
Sdev1=(V_sdev)

Concatenate /KILL/NP=0 {Average1},root:'3006_014':summary:Signal


Since the folder 3006_014 changes per experiment, I would like to change that together with the experiment. I thought I could use DFREF to create a folder reference that I can program by executing it every time I run the loadallfilesinfolder:

Function LoadAllFilesInFolder()

DFREF baseDFR=GetDatafolderDFR()

newdatafolder/S Summary

DFREF summarydfr=GetDatafolderDFR()

make/N=(1) Signal


Setdatafolder basedfr

//and then the rest of the code, not interesting now


Then, the way I understand it, I could use, in the first snippet of code:
Concatenate /KILL/NP=0 {Average1},summarydfr:Signal

to concatenate the value to the wave "Signal" in the specific folder location root:'3006_014':summary:Signal. In stead of writing it specifcally:
Concatenate /KILL/NP=0 {Average1},root:'3006_014':summary:Signal


But if I try to compile this, I get the following error:
Expected a keyword or an object name.
And the Signal is highlighted.

Any simple thing I am not seeing here?

Thanks for the help.
When debugging a complex problem, it is best to create a simple, self-contained example which isolates the crux of the issue. Usually you will find the problem just by attempting to create the simple, self-contained example. If you do not find it, others can easily run the simple, self-contained example and debug it.

Here is my attempt to create a simple, self-contained example that you can run. It works. Perhaps by examining it, you can see what the problem is with your function:
Function Test()
    SetDataFolder root:
   
    KillDataFolder/Z root:TestDataFolder
   
    Make/O/N=3 rootWave = p
   
    NewDataFolder root:TestDataFolder
    DFREF dfr = root:TestDataFolder
    Make/N=3 dfr:testWave = 3+p
   
    Concatenate/KILL/NP=0 {rootWave}, dfr:testWave
End

Thanks for the quick help!

I realized that I had made the DFREF call in one function that contains a loop (func1), and was asking for the DFR in another function (func2) inside the loop of func1. Apparently, that doesn't work. Now that I have made the DFREF call in the function (func2) that I am using the DFR in, it works like a charm!



Regards,

Maarten