GBLoadwave only loads in Debug Mode

Hello,

I have a function that scans a directory for files with a specific header and then calls another function to load the file when a match is found

Function A
            if ((cmpstr(stringfromlist(itemsinlist(sProtocol,"\\")-1, sProtocol, "\\"),sProtocolMatch))==0)
//              sPrintf cmd, "ImportABF(sPath = \"%s\", sFile = \"%s\")", spath, fileName
//              execute cmd
                ImportABF(sPath=spath, sFile = fileName)
                ...


The importABF function loads an axon binary file with the command:

Function B
GBLoadwave/Q/B=1/V=(intlev)/N=ABFtemp/O/S=(dataOffset)/U=(numGapFreeSamps)/W=(numADCchannels)/T={16,4} fName


If I run Function A I get print outs to the command history generated by Function B that the waves loaded successfully however no waves were actually loaded. If I run everything in Debug mode then the waves load fine. If I run Function B directly from the command line then the waves load fine as well. I'm not sure how to fix this problem so that the waves load outside of the debugger when Function B is called by Function A. Using the commented out "cmd" approach yields the same result. Sorry if this is confusing...

Thank you for any assistance!
First I would try putting code such as
Print WaveExists($"<nameOfWaveYouExpectToExist>")

in various places. This may provide insight. You might find that the wave is being killed - for example by a window hook function or some such thing.

If that fails to shed light then try to create a simplified experiment that reproduces the problem and send it to WaveMetrics support or post it here. Include your OS, Igor version, any other file needed to reproduce the problem, and instructions.

hrodstein wrote:
First I would try putting code such as
Print WaveExists($"<nameOfWaveYouExpectToExist>")

in various places. This may provide insight. You might find that the wave is being killed - for example by a window hook function or some such thing.

If that fails to shed light then try to create a simplified experiment that reproduces the problem and send it to WaveMetrics support or post it here. Include your OS, Igor version, any other file needed to reproduce the problem, and instructions.


Thank you! I will try that and see where the waves might be getting killed. If I can't find the spot I'll put together the simplified version.
Many thanks!