Where are the preferences stored?

Working on new editor enhancements?
Derek
Addict
Addict
Posts: 2354
Joined: Wed Apr 07, 2004 12:51 am
Location: England

Where are the preferences stored?

Post by Derek »

I can't find where the preferences for the editor (4.1 beta) are stored, done a quick search but didn't find anything, it's just that everything was fine last night and then tonight I load PB and everything has been reset. :cry:
User avatar
ts-soft
Always Here
Always Here
Posts: 5756
Joined: Thu Jun 24, 2004 2:44 pm
Location: Berlin - Germany

Post by ts-soft »

Code: Select all

Procedure.s GetSpecialFolder(CSIDL.l)
  Protected *itemid.ITEMIDLIST
  Protected location.s = Space(#MAX_PATH)

  If SHGetSpecialFolderLocation_ (0, CSIDL, @*itemid) = #NOERROR
    If SHGetPathFromIDList_(*itemid, @location)
      If Right(location, 1) <> "\" : location + "\" : EndIf
      ProcedureReturn location
    EndIf
  EndIf
EndProcedure

RunProgram("notepad", GetSpecialFolder(#CSIDL_APPDATA) + "PureBasic\PureBasic.prefs", "")
:wink:
PureBasic 5.73 | SpiderBasic 2.30 | Windows 10 Pro (x64) | Linux Mint 20.1 (x64)
Old bugs good, new bugs bad! Updates are evil: might fix old bugs and introduce no new ones.
Image
Derek
Addict
Addict
Posts: 2354
Joined: Wed Apr 07, 2004 12:51 am
Location: England

Post by Derek »

Great, thanks. Will be able to copy them from one computer to the other.
PB
PureBasic Expert
PureBasic Expert
Posts: 7581
Joined: Fri Apr 25, 2003 5:24 pm

Re: Where are the preferences stored?

Post by PB »

This is from http://www.purebasic.fr/english/viewtopic.php?t=27343 :

Code: Select all

 - For Vista compatibility nothing is written in the PureBasic dir anymore
 - The temporary exe is placed in the Windows temp dir
 - The Preferences location was moved to %App Data%\PureBasic\ for all preferences
   NOTE: This cann still be changed with the /P, /A, /T commandline switches to specify different
         locations for the preferences files.
 - New commandline switch /PORTABLE which puts all preferences in the PureBasic dir (as before),
   and disables the creation of the .pb extension for USB sticks and such.
I compile using 5.31 (x86) on Win 7 Ultimate (64-bit).
"PureBasic won't be object oriented, period" - Fred.
Derek
Addict
Addict
Posts: 2354
Joined: Wed Apr 07, 2004 12:51 am
Location: England

Post by Derek »

Must of missed that, thanks, still haven't any idea why my prefs were lost though.
Trond
Always Here
Always Here
Posts: 7446
Joined: Mon Sep 22, 2003 6:45 pm
Location: Norway

Re: Where are the preferences stored?

Post by Trond »

Derek wrote:I can't find where the preferences for the editor (4.1 beta) are stored, done a quick search but didn't find anything, it's just that everything was fine last night and then tonight I load PB and everything has been reset. :cry:
Copy *.prefs from the PureBasic directory into %APPDATA%\PureBasic.
Derek
Addict
Addict
Posts: 2354
Joined: Wed Apr 07, 2004 12:51 am
Location: England

Post by Derek »

BTW, what I meant was that I couldn't find them anywhere on my computer, it was like they were deleted. Thanks to everyone anyway.
Post Reply