- Timestamp:
- Feb 3, 2009 4:45:55 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sans/Dev/trunk/NCNR_User_Procedures/Analysis/WriteModelData_v40.ipf
r473 r474 84 84 if(dialog) 85 85 PathInfo/S catPathName 86 fullPath = A_DoSaveFileDialog("Save data as",fname=NameofWave(ywave)+".txt")86 fullPath = DoSaveFileDialog("Save data as",fname=NameofWave(ywave)+".txt") 87 87 If(cmpstr(fullPath,"")==0) 88 88 //user cancel, don't write out a file … … 101 101 End 102 102 103 // returns the path to the file, or null if the user cancelled104 // fancy use of optional parameters105 //106 // enforce short file names (26 characters)107 // DUPLICATE of similar-named function in WriteQIS (including starts a bad dependency chain)108 Function/S A_DoSaveFileDialog(msg,[fname,suffix])109 String msg,fname,suffix110 Variable refNum111 // String message = "Save the file as"112 113 if(ParamIsDefault(fname))114 // Print "fname not supplied"115 fname = ""116 endif117 if(ParamIsDefault(suffix))118 // Print "suffix not supplied"119 suffix = ""120 endif121 122 String outputPath,tmpName,testStr123 Variable badLength=0,maxLength=26,l1,l2124 125 126 tmpName = fname + suffix127 128 do129 badLength=0130 Open/D/M=msg/T="????" refNum as tmpName131 outputPath = S_fileName132 133 testStr = ParseFilePath(0, outputPath, ":", 1, 0) //just the filename134 if(strlen(testStr)==0)135 break //cancel, allow exit136 endif137 if(strlen(testStr) > maxLength)138 badlength = 1139 DoAlert 2,"File name is too long. Is\r"+testStr[0,25]+"\rOK?"140 if(V_flag==3)141 outputPath = ""142 break143 endif144 if(V_flag==1) //my suggested name is OK, so trim the output145 badlength=0146 l1 = strlen(testStr) //too long length147 l1 = l1-maxLength //number to trim148 //Print outputPath149 l2=strlen(outputPath)150 outputPath = outputPath[0,l2-1-l1]151 //Print "modified ",outputPath152 endif153 //if(V_flag==2) do nothing, let it go around again154 endif155 156 while(badLength)157 158 return outputPath159 End
Note: See TracChangeset
for help on using the changeset viewer.