An option to turn "on"/"off" user libs

Got an idea for enhancing PureBasic? New command(s) you'd like to see?
techjunkie
Addict
Addict
Posts: 1126
Joined: Wed Oct 15, 2003 12:40 am
Location: Sweden
Contact:

An option to turn "on"/"off" user libs

Post by techjunkie »

An option to turn "on"/"off" user libs "on the fly"

Very often when you try a snipet from the Forum, you have to temporarily rename a userlib's folder and restart PB, due to the fact that some functions, structures collides.

It would be a very handy feature if you could switch "on"/"off" userlibs from PB IDE.
Last edited by techjunkie on Tue May 22, 2007 9:55 pm, edited 1 time in total.
Image
(\__/)
(='.'=) This is Bunny. Copy and paste Bunny into your
(")_(") signature to help him gain world domination.
PB
PureBasic Expert
PureBasic Expert
Posts: 7581
Joined: Fri Apr 25, 2003 5:24 pm

Re: An option to turn "on" and "off" use

Post by PB »

@Freak: This is what I meant by my "Safe Mode" compile option. ;)
I compile using 5.31 (x86) on Win 7 Ultimate (64-bit).
"PureBasic won't be object oriented, period" - Fred.
techjunkie
Addict
Addict
Posts: 1126
Joined: Wed Oct 15, 2003 12:40 am
Location: Sweden
Contact:

Re: An option to turn "on" and "off" use

Post by techjunkie »

PB wrote:@Freak: This is what I meant by my "Safe Mode" compile option. ;)
Aha - where is that thread? :wink: but did Freak mean that all user libs should be "off" in "Safe Mode"? I'll guess so...

I would like a feature where you could check / uncheck specific user libs.
Image
(\__/)
(='.'=) This is Bunny. Copy and paste Bunny into your
(")_(") signature to help him gain world domination.
PB
PureBasic Expert
PureBasic Expert
Posts: 7581
Joined: Fri Apr 25, 2003 5:24 pm

Re: An option to turn "on" and "off" use

Post by PB »

I asked Freak to see if a compile option could be added (called "Safe Mode")
whereby no userlibs or custom residents files would be included when doing
the compile, to avoid situations where broken libs cause problems and so on.
But the consensus was that if some code needed a lib, then disabling it would
defeat the purpose of running the code, and I was asked for an example to
show when this might NOT be the case. So if you have an example, please
post it here as I've got nothing to back up my wish. :)
I compile using 5.31 (x86) on Win 7 Ultimate (64-bit).
"PureBasic won't be object oriented, period" - Fred.
freak
PureBasic Team
PureBasic Team
Posts: 5940
Joined: Fri Apr 25, 2003 5:21 pm
Location: Germany

Re: An option to turn "on" and "off" use

Post by freak »

techjunkie wrote:
PB wrote:@Freak: This is what I meant by my "Safe Mode" compile option. ;)
Aha - where is that thread? :wink:
I could tell you... but then i'd have to shoot you :P
quidquid Latine dictum sit altum videtur
AND51
Addict
Addict
Posts: 1040
Joined: Sun Oct 15, 2006 8:56 pm
Location: Germany
Contact:

Post by AND51 »

> I could tell you... but then i'd have to shoot you
Jonny English? :roll: :wink:
PB 4.30

Code: Select all

onErrorGoto(?Fred)
User avatar
Kaeru Gaman
Addict
Addict
Posts: 4826
Joined: Sun Mar 19, 2006 1:57 pm
Location: Germany

Post by Kaeru Gaman »

a "safe mode"-option sounds REALLY good for me.

the point is, two years ago a Mate had problems
compiling my code that was written without using libs,
but he had an additional "2D-drawing" lib installed,
and it produced an error.

that was a point for me when I became a "Lib Hater".

if there had been a "safe mode" option, I would never have learned to hate UserLibs... ;)

just an example.

the "copy that expansionless file to the folder and it will be always present"-way is not very emancipated....

it's not very practicable to rename the Lib-folder to compile without them...
oh... and have a nice day.
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 »

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
Dare
Addict
Addict
Posts: 1965
Joined: Mon May 29, 2006 1:01 am
Location: Outback

Re: An option to turn "on" and "off" use

Post by Dare »

freak wrote:I could tell you... but then i'd have to shoot you :P
:D
Dare2 cut down to size
techjunkie
Addict
Addict
Posts: 1126
Joined: Wed Oct 15, 2003 12:40 am
Location: Sweden
Contact:

Re: An option to turn "on" and "off" use

Post by techjunkie »

freak wrote:I could tell you... but then i'd have to shoot you :P
:lol: :lol: Okay, but only in the foot! OK? :wink:
Image
(\__/)
(='.'=) This is Bunny. Copy and paste Bunny into your
(")_(") signature to help him gain world domination.
techjunkie
Addict
Addict
Posts: 1126
Joined: Wed Oct 15, 2003 12:40 am
Location: Sweden
Contact:

Post by techjunkie »

ts-soft wrote:I use PureLibManager: http://www.purebasic.fr/english/viewtopic.php?t=24658
:shock: Will try it right away! Thanks! :D
Image
(\__/)
(='.'=) This is Bunny. Copy and paste Bunny into your
(")_(") signature to help him gain world domination.
techjunkie
Addict
Addict
Posts: 1126
Joined: Wed Oct 15, 2003 12:40 am
Location: Sweden
Contact:

Post by techjunkie »

techjunkie wrote:
ts-soft wrote:I use PureLibManager: http://www.purebasic.fr/english/viewtopic.php?t=24658
:shock: Will try it right away! Thanks! :D
Works like a charm! :D but I'll guess I have to switch to jaPBe, so I don't have to Restart Compiler myself... (I'm soooo lazy! :lol: )
[EDIT]
I think I'm getting old... :cry: :cry: I already had PureLIBManager in my PB folder - just forgot about it... :cry: I think the few brain cells that I have left are occupied with other stuff than PB... :wink:
Image
(\__/)
(='.'=) This is Bunny. Copy and paste Bunny into your
(")_(") signature to help him gain world domination.
C64
Enthusiast
Enthusiast
Posts: 151
Joined: Sat Dec 18, 2010 4:40 am

Re: An option to turn "on" and "off" use

Post by C64 »

I think a commandline option like "/safemode" (or "/nativemode") would be good for the times when you need to run PureBasic in its native form without third-party libraries and residents and so on (like PB said) for testing, because at the moment you need to have a separate clean install of PureBasic (in another folder and use "/portable") if you want to test something without going to the hassle of moving out those libraries and other stuff. That way I could have a batch file in my PureBasic folder to launch another instance of PureBasic just like it was freshly installed. Would be awesome! And the workload to add it would be minimal.

Team, please seriously consider doing this. Especially for when we help newbies here, one of the first things we can ask them when they have "buggy" code is: "Have you tried that snippet in safe mode?" 8) Just so we know that an outdated (or faulty) third-party library isn't causing their "bug" (assuming they aren't using one with their code).
Zach
Addict
Addict
Posts: 1675
Joined: Sun Dec 12, 2010 12:36 am
Location: Somewhere in the midwest
Contact:

Re: An option to turn "on"/"off" user libs

Post by Zach »

I don't understand why they don't switch it so that you have to explicitly call a library, in order to load/use it.
At that point you could even stick the thing in its own Namespace, and even if you loaded two libraries that might not play nice, the Namespace separation would cancel out the conflict??

Or maybe I'm just having a Python relapse.... :?
Post Reply