#N canvas 199 25 1063 590 12;
#X declare;
#X declare;
#X obj 23 10 declare;
#X text 90 9 - set environment for loading patch;
#X text 20 271 -lib;
#X text 20 288 -stdlib;
#X text 20 235 -path;
#X text 20 252 -stdpath;
#X text 536 501 BUG: The name "-stdpath" is confusing \, as it has a quite different effect from "-stdpath" on the pd command line., f 73;
#X text 108 237 add to search path \, relative to the patch or user paths, f 56;
#X text 108 273 load a library \, relative to the patch or user paths, f 56;
#X text 108 255 add to search path \, relative to Pd (the 'extra' folder), f 56;
#X text 108 290 load a library \, relative to Pd (the 'extra' folder), f 56;
#X text 854 562 updated for Pd version 0.52;
#X text 524 115 It is a current best practice to just use [declare] instead of permanently adding paths to the user search paths or libs to startup. With [declare] you can better manage and avoid conflicts with externals from different libraries that have the same name by using it to call the right library you want., f 74;
#X obj 664 321 bng 19 250 50 0 empty empty empty 17 7 0 10 #dfdfdf #000000 #000000;
#X text 17 317 (For any of these you may use a full pathname such as "/tmp/dir" or \, in Windows \, "C:/garbage" instead of a relative path)., f 69;
#X text 524 52 Since the 'extra' folder is the last in the search priority \, other paths are searched before. You can use [declare -stdpath ./] to ensure that 'extra' has search priority. Note that the order you specify '-path' flags also specify the search priority., f 74;
#N canvas 798 148 456 264 open-manual 0;
#X obj 101 59 inlet;
#X obj 101 190 pdcontrol;
#X obj 101 130 pdcontrol;
#X msg 101 105 dir;
#X msg 101 159 browse \$1/../1.manual/x4.htm;
#X text 205 94 this window opens the html manual link via the [pdcontrol] object., f 25;
#X connect 0 0 3 0;
#X connect 2 0 4 0;
#X connect 3 0 2 0;
#X connect 4 0 1 0;
#X restore 664 349 pd open-manual;
#X msg 879 452 \; pd compatibility \$1;
#X msg 879 391 0.46;
#X text 922 393 earlier (buggy);
#X msg 892 420 0.47;
#X text 930 421 new (correct);
#X text 17 51 Compiled external libraries come either as a single binary pack (the "classic" library format) or as a set of separate binaries and/or abstractions. A single binary pack is what we refer to as a 'library' and needs to be pre loaded - whereas external libraries that have separate binaries/abstractions can be loaded by simply adding its directory to the search path. Adding a directory to the path is also needed if you want to load things like audio and text files that are in it., f 69;
#X obj 4 39 cnv 1 1055 1 empty empty empty 8 12 0 13 #000000 #000000 0;
#N canvas 676 214 618 221 reference 0;
#X obj 8 42 cnv 5 600 5 empty empty INLETS/OUTLETS: 8 18 0 13 #202020 #000000 0;
#X obj 7 195 cnv 5 600 5 empty empty empty 8 18 0 13 #202020 #000000 0;
#X obj 8 80 cnv 2 600 2 empty empty ARGUMENTS: 8 12 0 13 #202020 #000000 0;
#X obj 7 105 cnv 1 600 1 empty empty flags: 8 12 0 13 #7c7c7c #000000 0;
#X obj 24 14 declare;
#X text 91 14 - set environment for loading patch.;
#X text 156 53 NONE;
#X text 75 113 -path <symbol> - add to search path \, relative to the patch or user paths., f 73;
#X text 54 132 -stdpath <symbol> - add to search path \, relative to Pd (the 'extra' folder)., f 76;
#X text 82 150 -lib <symbol> - load a library \, relative to the patch or user paths., f 72;
#X text 61 168 -stdlib <symbol> - load a library \, relative to Pd (the 'extra' folder)., f 75;
#X restore 881 9 pd reference;
#X text 974 9 <= click;
#X obj 4 551 cnv 1 1055 1 empty empty empty 8 12 0 13 #000000 #000000 0;
#X text 17 168 The [declare] object adds one or more directories to the search path and/or pre-loads one or more libraries ("externals") to Pd in preparation for opening the patch from a file. The usage is "declare [-flag value] [-flag value] ..." where the flag can be:, f 69;
#X text 17 354 For instance \, if you put abstractions and/or other supporting files in a subdirectory "more" \, you can put an object [declare -path more] to make sure Pd sees them when the patch is loaded. Or \, if you have files installed in the directory extra/stillmore (in the Pd installation) you can get it using [declare -stdpath stillmore]., f 69;
#X text 17 436 Paths declared with '-path' will have top search priority. Next priority is the relative path \, then user added search paths (set in "Preferences => Path") and finally the standard path (a.k.a the 'extra' folder). As of version 0.49 \, "-path" and "-lib" will fall back the other search paths if the relative path to the patch does not exist. To avoid checking further \, use an explicit relative path by prepending "./" or "../" to the path or lib name., f 69;
#X text 524 190 However \, note that when you load a library (with [declare -lib <symbol>] or via startup) \, all of its objects get pre loaded and prevail \, so using [declare -path <symbol>] cannot enforce loading priority. Hence \, you may need to adopt slash declarations as in [library/objectname]. Also Note that while '-path' will only add search paths for the patch that owns the [declare] object \, once a library is loaded \, it stays with Pd and will be able to be loaded in other patches without [declare]. For more details on this and how external loading works in Pd \, please refer to the chapter 4 of Pd's manual., f 74;
#X text 531 399 WARNING: as of version 0.47 \, "-path" and "-stdpath" inside abstractions take effect only within those abstractions. If Pd's compatibility version is set to 0.46 or earlier the old (buggy) behavior takes effect., f 42;
#X text 692 321 <-- click to open Pd's manual \, chapter 4;
#X connect 13 0 16 0;
#X connect 18 0 17 0;
#X connect 20 0 17 0;
