- Timestamp:
- Feb 3, 2009 4:45:55 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sans/Dev/trunk/NCNR_User_Procedures/Reduction/USANS/WriteUSANSData.ipf
r473 r474 53 53 if(dialog) 54 54 PathInfo/S catPathName 55 fullPath = U_DoSaveFileDialog("Save data as")55 fullPath = DoSaveFileDialog("Save data as") 56 56 If(cmpstr(fullPath,"")==0) 57 57 //user cancel, don't write out a file … … 199 199 End 200 200 201 // returns the path to the file, or null if the user cancelled202 // fancy use of optional parameters203 //204 // enforce short file names (26 characters)205 //DUPLICATE of similar-named function in WriteQIS (including starts a bad dependency cascade)206 Function/S U_DoSaveFileDialog(msg,[fname,suffix])207 String msg,fname,suffix208 Variable refNum209 // String message = "Save the file as"210 211 if(ParamIsDefault(fname))212 // Print "fname not supplied"213 fname = ""214 endif215 if(ParamIsDefault(suffix))216 // Print "suffix not supplied"217 suffix = ""218 endif219 220 String outputPath,tmpName,testStr221 Variable badLength=0,maxLength=26,l1,l2222 223 224 tmpName = fname + suffix225 226 do227 badLength=0228 Open/D/M=msg/T="????" refNum as tmpName229 outputPath = S_fileName230 231 testStr = ParseFilePath(0, outputPath, ":", 1, 0) //just the filename232 if(strlen(testStr)==0)233 break //cancel, allow exit234 endif235 if(strlen(testStr) > maxLength)236 badlength = 1237 DoAlert 2,"File name is too long. Is\r"+testStr[0,25]+"\rOK?"238 if(V_flag==3)239 outputPath = ""240 break241 endif242 if(V_flag==1) //my suggested name is OK, so trim the output243 badlength=0244 l1 = strlen(testStr) //too long length245 l1 = l1-maxLength //number to trim246 //Print outputPath247 l2=strlen(outputPath)248 outputPath = outputPath[0,l2-1-l1]249 //Print "modified ",outputPath250 endif251 //if(V_flag==2) do nothing, let it go around again252 endif253 254 while(badLength)255 256 return outputPath257 End
Note: See TracChangeset
for help on using the changeset viewer.