Changeset 1228


Ignore:
Timestamp:
Dec 2, 2019 12:31:53 PM (3 years ago)
Author:
srkline
Message:

correction to the conditional compilation of the XML utilities to ensure that VSANS will always compile correctly.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sans/Dev/trunk/NCNR_User_Procedures/Common/NIST_XML_v40.ipf

    r1215 r1228  
    33#pragma IgorVersion=6.1 
    44 
    5 //#if( exists("XmlOpenFile") && exists("NCNR_VSANS") ) 
    6 #if ( exists("XmlOpenFile") ) 
     5 
     6// condtional compile to keep the XML functions from compiling 
     7// if the XOP was not loaded. dummy function are defined instead 
     8 
     9#if (exists("XmlOpenFile")) 
    710 
    811#include "cansasXML", version >= 1.10 
     
    820823         
    821824        //write confirmation of write operation to history area 
    822         Print "Averaged XML File written: ", GetFileNameFromPathNoSemi(fullPath) 
     825        Print "Averaged XML File written: ", XML_GetFileNameFromPathNoSemi(fullPath) 
    823826        KillWaves/Z tempShortProto 
    824827        Return(0) 
     
    10651068        writeNISTXML(fullpath,nf) 
    10661069        //write confirmation of write operation to history area 
    1067         Print "XML File written: ", GetFileNameFromPathNoSemi(fullPath) 
     1070        Print "XML File written: ", XML_GetFileNameFromPathNoSemi(fullPath) 
    10681071        KillWaves/Z tempShortProto 
    10691072         
     
    10731076End 
    10741077 
    1075  
    1076  
    1077  
    1078 #else   // if( Exists("XmlOpenFile") ) 
     1078#else 
     1079// the dummy definitions for the case where the XML XOP doesn't exist 
     1080 
     1081 
    10791082        // No XMLutils XOP: provide dummy function so that IgorPro can compile dependent support code 
    10801083//      FUNCTION LoadNISTXMLData(fileName,doPlot) 
     
    11791182                return(-6) 
    11801183        end      
    1181          
    1182          
    1183 #endif 
     1184 
     1185#endif    
     1186 
     1187 
     1188 
     1189/// these functions always compile whether the XMLxop exists or not 
     1190 
     1191 
    11841192 
    11851193//AJJ 12/5/08 
     
    12771285 
    12781286end 
     1287 
     1288 
     1289//**** a simple duplication of GetFileNameFromPathNoSemi so that VSANS will not  
     1290// accidentaly try to compile the XML block and fail since VSANS version is named 
     1291// V_GetFileNameFromPathNoSemi 
     1292// 
     1293//returns a string containing filename (WITHOUT the ;vers) 
     1294//the input string is a full path to the file (Mac-style, still works on Win in IGOR) 
     1295//with the folders separated by colons 
     1296// 
     1297// called by MaskUtils.ipf, ProtocolAsPanel.ipf, WriteQIS.ipf 
     1298// 
     1299Function/S XML_GetFileNameFromPathNoSemi(fullPath) 
     1300        String fullPath 
     1301         
     1302        Variable offset1,offset2 
     1303        String filename="" 
     1304        //String PartialPath 
     1305        offset1 = 0 
     1306        do 
     1307                offset2 = StrSearch(fullPath, ":", offset1) 
     1308                if (offset2 == -1)                              // no more colons ? 
     1309                        fileName = FullPath[offset1,strlen(FullPath) ] 
     1310                        //PartialPath = FullPath[0, offset1-1] 
     1311                        break 
     1312                endif 
     1313                offset1 = offset2+1 
     1314        while (1) 
     1315         
     1316        //remove version number from name, if it's there - format should be: filename;N 
     1317        filename =  StringFromList(0,filename,";")              //returns null if error 
     1318         
     1319        Return filename 
     1320End 
Note: See TracChangeset for help on using the changeset viewer.