Shannara Libs 0.1

Developed or developing a new product in PureBasic? Tell the world about it.
Shannara
Addict
Addict
Posts: 1808
Joined: Thu Oct 30, 2003 11:19 pm
Location: Emerald Cove, Unformed

Shannara Libs 0.1

Post by Shannara »

These are two simple libraries I put together. I am starting a collection of libraries of simple commands and such for PB users.. *shrugs*

AppPath = Returns applicaton path
FileExist(Filename$) = Returns whether given file exist or not.

http://www.pbcode.com/shannaralibs/ShannaraLibs0.1.rar

To Install: Extract libraries into your purebasic's UserLibraries directory, and restart the compiler.

These are free to use for any reason, except claiming they are yours :D

I'll be posting more libraries and updates as I find the time.
User avatar
NoahPhense
Addict
Addict
Posts: 2000
Joined: Thu Oct 16, 2003 8:30 pm
Location: North Florida

Re: Shannara Libs 0.1

Post by NoahPhense »

Shannara wrote:These are two simple libraries I put together. I am starting a collection of libraries of simple commands and such for PB users.. *shrugs*

AppPath = Returns applicaton path
FileExist(Filename$) = Returns whether given file exist or not.

http://www.pbcode.com/shannaralibs/ShannaraLibs0.1.rar

To Install: Extract libraries into your purebasic's UserLibraries directory, and restart the compiler.

These are free to use for any reason, except claiming they are yours :D

I'll be posting more libraries and updates as I find the time.
Nice, glad to see your contributions.

- np

(enjoyed your site btw)
Shannara
Addict
Addict
Posts: 1808
Joined: Thu Oct 30, 2003 11:19 pm
Location: Emerald Cove, Unformed

Post by Shannara »

What site? hehe. I gotta fix that...

Also, I know these are like, hardly any contribution but.. *shrugs* Still working on the AES/DES encryption library, and the WebCam library. I should be adding the screenshot library soon.
User avatar
NoahPhense
Addict
Addict
Posts: 2000
Joined: Thu Oct 16, 2003 8:30 pm
Location: North Florida

..

Post by NoahPhense »

Shannara wrote:What site? hehe. I gotta fix that...

Also, I know these are like, hardly any contribution but.. *shrugs* Still working on the AES/DES encryption library, and the WebCam library. I should be adding the screenshot library soon.
Excellent, I too have been punching out a enc/dec algo for about 2 years
now. It's usage will be endless, from data files, inet comms, but its
original intention is machine dependant software registration. I have a
team or two on standby to make their attempts on it. Upon them failing
which they will. ;) It will be released.

- np
PB
PureBasic Expert
PureBasic Expert
Posts: 7581
Joined: Fri Apr 25, 2003 5:24 pm

Re: Shannara Libs 0.1

Post by PB »

> FileExist(Filename$) = Returns whether given file exist or not.

You do know that if FileSize = -1 then the file doesn't exist, right?
(I'm thinking perhaps you're re-inventing the wheel for no reason).
Shannara
Addict
Addict
Posts: 1808
Joined: Thu Oct 30, 2003 11:19 pm
Location: Emerald Cove, Unformed

Post by Shannara »

Yep :) 1 a return of 1 for this function = false. Though, if there are any #True #False built in PB constants, I'll use those for returns...
Shannara
Addict
Addict
Posts: 1808
Joined: Thu Oct 30, 2003 11:19 pm
Location: Emerald Cove, Unformed

Post by Shannara »

Got done looking at the constants list for PB found @ http://purebasic-cvs.dyndns.org/index.c ... web-markup

Believe it or not, there are no #True and #False constants, thus no standard boolean.. erk!???

Will there be some boolean constants in PB coming up any time?
PB
PureBasic Expert
PureBasic Expert
Posts: 7581
Joined: Fri Apr 25, 2003 5:24 pm

Post by PB »

> Believe it or not, there are no #True and #False constants

:?: Yes there are... this works fine for me:

Code: Select all

Debug #TRUE ; Returns 1
Debug #FALSE ; Returns 0
Shannara
Addict
Addict
Posts: 1808
Joined: Thu Oct 30, 2003 11:19 pm
Location: Emerald Cove, Unformed

Post by Shannara »

Grr, another undocumented feature... PB really need some docs...

The FileExist library have been updated....grrr

Same URL.
Fred
Administrator
Administrator
Posts: 18531
Joined: Fri May 17, 2002 4:39 pm
Location: France
Contact:

Post by Fred »

As always, please use name convention which won't interfer with future PureBasic commands or your lib will be broken.
User avatar
blueznl
PureBasic Expert
PureBasic Expert
Posts: 6175
Joined: Sat May 17, 2003 11:31 am
Contact:

Post by blueznl »

shanarra, you're wrong there about booleans...

have a look here:

http://www.xs4all.nl/~bluez/datatalk/pu ... and_binary

and scroll down to 'test against zero'

- if it's zero, it's false
- if it's not zero, it's true

#True and #False are two standard constants

you CANNOT do:

if a = #true

as that is comparing a with 1, unless you have done a a = #true before :-)

you can do:

if a

or

if a <> #false

also, if you look into the x_lib file, you'll find a x_exist() function similar to what you propose, so... i guess everybody (including me :-)) is reinventing the wheel :-)
( PB6.00 LTS Win11 x64 Asrock AB350 Pro4 Ryzen 5 3600 32GB GTX1060 6GB - upgrade incoming...)
( The path to enlightenment and the PureBasic Survival Guide right here... )
Shannara
Addict
Addict
Posts: 1808
Joined: Thu Oct 30, 2003 11:19 pm
Location: Emerald Cove, Unformed

Post by Shannara »

Well, I come from a VB background :) App.Path and FileExist are two common functions from there :) So I sought to replicate the functions for PB. With as close of name to the VB counterpart as possible :)

The link I posted was supposed to be the most updated link for PB constants out there as it is in the cvs :) Turns out it is not so :(
User avatar
blueznl
PureBasic Expert
PureBasic Expert
Posts: 6175
Joined: Sat May 17, 2003 11:31 am
Contact:

Post by blueznl »

i think they were added after 3.81, as in 3.81 i had to define them myself :-)
( PB6.00 LTS Win11 x64 Asrock AB350 Pro4 Ryzen 5 3600 32GB GTX1060 6GB - upgrade incoming...)
( The path to enlightenment and the PureBasic Survival Guide right here... )
User avatar
NoahPhense
Addict
Addict
Posts: 2000
Joined: Thu Oct 16, 2003 8:30 pm
Location: North Florida

..

Post by NoahPhense »

blueznl wrote:i think they were added after 3.81, as in 3.81 i had to define them myself :-)
Interesting, so is there a 'current' list of constants? I have two older ones
floating around here.

- np
Post Reply