Ignore:
Timestamp:
Jul 22, 2019 4:16:46 PM (3 years ago)
Author:
krzywon
Message:

Create a method to open or create a new file for all NXcanSAS writers.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sans/Dev/branches/nxcansas_writer/NCNR_User_Procedures/Reduction/USANS/WriteUSANSNXcanSAS.ipf

    r1174 r1187  
    4848        Variable refNum,integer,realval 
    4949                 
    50         if(dialog || stringmatch(fullpath, "")) 
    51                 fileID = NxCansas_DoSaveFileDialog() 
    52         else 
    53                 fileID = NxCansas_CreateFile(fullpath) 
    54         Endif 
    55          
    56         if(!fileID) 
    57                 abort "Unable to create file at " + fullpath + "." 
    58         else 
    59                 //*****these waves MUST EXIST, or IGOR Pro will crash, with a type 2 error**** 
    60                 WAVE qvals = $(destStr + ":Qvals") 
    61                 WAVE inten = $(destStr + ":DetCts") 
    62                 WAVE sig = $(destStr + ":ErrDetCts") 
    63         endif 
     50         
     51        fileID = NXcanSAS_OpenOrCreate(dialog,fullpath,base) 
     52                 
     53        //*****these waves MUST EXIST, or IGOR Pro will crash, with a type 2 error**** 
     54        WAVE qvals = $(destStr + ":Qvals") 
     55        WAVE inten = $(destStr + ":DetCts") 
     56        WAVE sig = $(destStr + ":ErrDetCts") 
    6457         
    6558        //check each wave 
     
    171164        Variable refNum,integer,realval 
    172165                 
    173         if(dialog || stringmatch(fullpath, "")) 
    174                 fileID = NxCansas_DoSaveFileDialog() 
    175         else 
    176                 fileID = NxCansas_CreateFile(fullpath) 
    177         Endif 
    178          
    179         if(!fileID) 
    180                 abort "Unable to create file at " + fullpath + "." 
    181         else 
    182                 //*****these waves MUST EXIST, or IGOR Pro will crash, with a type 2 error**** 
    183                 WAVE qvals =$(destStr + "Q_dsm") 
    184                 WAVE inten=$(destStr + "I_dsm") 
    185                 WAVE sig=$(destStr + "S_dsm") 
    186         endif 
     166 
     167        fileID = NXcanSAS_OpenOrCreate(dialog,fullpath,base) 
     168         
     169        //*****these waves MUST EXIST, or IGOR Pro will crash, with a type 2 error**** 
     170        WAVE qvals =$(destStr + "Q_dsm") 
     171        WAVE inten=$(destStr + "I_dsm") 
     172        WAVE sig=$(destStr + "S_dsm") 
    187173         
    188174        //check each wave 
Note: See TracChangeset for help on using the changeset viewer.