>From: Lars Gafvert <gafvert@...> >Reply-To: futurebasic@... >To: futurebasic@... >Subject: Re: [FB] preferences file >Date: Fri, 11 Aug 2000 18:47:16 +0200 > > > LOCAL FN GetPrefsFolder% > > prefsVolRef% = SYSTEM (_sysVol) > > LONG IF SYSTEM(_sysVers) > 699 'only system 7 and higher > > prefsVolRef% = FOLDER ("Preferences", prefsVolRef%) > > XELSE > > 'System 6.... no preferences folder > > END IF > > END FN = prefsVolRef% > > > > It had it all laid out in a nice little function. > > I could even store my preferences file in the system folder... > > > > So, am I correct with this? > >It will work, but the best way for you to do it is by getting the >preferences >folder's VolRef% directly. (I know this has been up before) Because that >will >work on non-english systems where the preference folder isn't called >"Preferences". Anyway, here's what I use: > >CLEAR LOCAL >DIM pBlock;128 >DIM pBlk&;128 >DIM @CreateFlag,@Drive%,@DirID&,@Vref% >LOCAL FN GetPrefVol% >Drive% = 0 >CreateFlag = _kDontCreateFolder > >LONG IF FN FINDFOLDER >(_kOnSystemDisk,_kPreferencesFolderType,CreateFlag,Drive%,DirID&) = _NoErr >pBlk& = @pBlock >pBlk&.ioVRefNum% = Drive% >pBlk&.ioWDDirID& = DirID& >IF FN OPENWD (pBlk&) = _noErr THEN Vref% = pBlk&.ioVRefNum% >END IF >END FN = Vref% > >I probably found it in some STAZ exemple or something. > >/Lars Gafvert I'll be honest. I don't understand a bit of it. The compiler is fooled too... heres the errors it brought up: Error: Number of Parameters expected here = 5 in file StarshipsII.*:STARSHIPSII.INCL at line 48 in GETPREFVOL% �LONG IF FN FINDFOLDER� Error: End of Statement expected here... in file StarshipsII.*:STARSHIPSII.INCL at line 49 in GETPREFVOL% �(�_kOnSystemDisk,_kPreferencesFolderType,CreateFlag,Drive%,DirID&) = _NoErr Error: Missing '=' or BEGIN ENUM when defining a constant in file StarshipsII.*:STARSHIPSII.INCL at line 49 in GETPREFVOL% (�_kOnSystemDisk�,_kPreferencesFolderType,CreateFlag,Drive%,DirID&) = _NoErr Considering I can barely figure out its purpose (well.. ;) I have no clue how to fix it... is it something that is FB2 only, so I need to figure out how to change it to FB3? Or were you being generic on the function and its not really a ready-to-go thing? -Peter Dempsey ________________________________________________________________________ Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com