rc wrote:

Docs are wrong, or bug as shown…

' DEMO
// Doc Says: folderName $ = files$( _CFURLRefFolder, [typeListString$], [promptString$], [@]cfURLRefVar )
// Correct result for file…shows TEXT files, has correct Select Slide Folder...
dim as CFURLRef  dirURL
long if ( files$( _CFURLRefOpen, "TEXT" , "Select Slide Folder" , @dirURL ) )
beep
end if
 
// InCorrect for folder…uses TEXT as prompt…why? See below.
long if ( files$( _CFURLRefFolder,  "TEXT" , "Select Slide Folder" , @dirURL ) )
beep
end if
' END DEMO

In FilesDollarFunction.c (Build Goodies)

case kFBCFURLRefFolder:
 
// Wrong if ( typeList[0] ) options.message = CFStringCreateWithPascalString( NULL, typeList, kCFStringEncodingMacRoman );
NavCreateChooseFolderDialog( &options, NULL, NULL, NULL, &dialogRef );
break;

SHOULD BE:
if ( prompt[0] ) options.message = CFStringCreateWithPascalString( NULL, prompt, kCFStringEncodingMacRoman );


FB4 did something weird with the typeListString and prompt params. _FSSpecSave made typeListString param the prompt and prompt param the saveFileName! I'm guessing the params for _XxxxSave _XxxxFolder were kept the same as FB4 to avoid breaking existing apps.
From FB4 help:
folderName$ = FILES$(_FSSpecFolder,[prompt$],,FSSpec)

btw, for anyone using _CFURLRefOpen, _CFURLRefFolder & _CFURLRefSave, don't forget to release the returned url.



--
To unsubscribe, send ANY message to: futurebasic-unsubscribe@... To access the list archives, go to: http://freegroups.net/groups/futurebasic/