PureBasic Code-Archive v1.6

Share your advanced PureBasic knowledge/code with the community.
dmoc
Enthusiast
Enthusiast
Posts: 739
Joined: Sat Apr 26, 2003 12:40 am

Post by dmoc »

Andre, thanks for the code archive, it make's a great reference. Just one suggestion, how about a "What's new" section? Also noticed some graphics files missing (I'll take note which next time I use it).
User avatar
Andre
PureBasic Team
PureBasic Team
Posts: 2137
Joined: Fri Apr 25, 2003 6:14 pm
Location: Germany (Saxony, Deutscheinsiedel)
Contact:

Post by Andre »

dmoc wrote:Andre, thanks for the code archive, it make's a great reference. Just one suggestion, how about a "What's new" section? Also noticed some graphics files missing (I'll take note which next time I use it).
Probably I will add a "new" symbol to newly added codes in future versions.

Graphics are only included in the download archive, but (still) not listed on the website...
Bye,
...André
(PureBasicTeam::Docs & Support - PureArea.net | Order:: PureBasic | PureVisionXP)
high key
User
User
Posts: 23
Joined: Sun Jun 08, 2003 8:07 pm

Get Special folders

Post by high key »

I didn't find a code for special folders in André's CodeArchive, so I converted the example from the API-Guide:

Code: Select all

Declare.s GetSpecialfolder(CSIDL)


#CSIDL_DESKTOP = 0
#CSIDL_PROGRAMS = 2
#CSIDL_CONTROLS = 3
#CSIDL_PRINTERS = 4
#CSIDL_PERSONAL = 5
#CSIDL_FAVORITES = 6
#CSIDL_STARTUP = 7
#CSIDL_RECENT = 8
#CSIDL_SENDTO = 9
#CSIDL_BITBUCKET = $A
#CSIDL_STARTMENU = $B
#CSIDL_DESKTOPDIRECTORY = $10
#CSIDL_DRIVES = $11
#CSIDL_NETWORK = $12
#CSIDL_NETHOOD = $13
#CSIDL_FONTS = $14
#CSIDL_TEMPLATES = $15




Structure shItemID
    cb.l
    abID.b 
EndStructure

Structure ItemIDlist
    mkid.shItemID
EndStructure


a$= "Start menu folder: " + GetSpecialfolder(#CSIDL_STARTMENU)
b$= "Favorites folder: " + GetSpecialfolder(#CSIDL_FAVORITES)
c$= "Programs folder: " + GetSpecialfolder(#CSIDL_PROGRAMS)
d$= "Desktop folder: " + GetSpecialfolder(#CSIDL_DESKTOP)
e$= "Startup folder: " + GetSpecialfolder(#CSIDL_STARTUP)

   
MessageRequester("Info",a$+Chr(13)+b$+Chr(13)+c$+Chr(13)+d$+chr$(13)+e$,0)



Procedure.s GetSpecialfolder(CSIDL)
   
    r = SHGetSpecialFolderLocation_(0, CSIDL, @IDL.ITEMIDLIST)
    If r = #NOERROR
        Path$ = Space(512)
        r = SHGetPathFromIDList_(IDL\mkid\cb, Path$)
        folder$ = Trim(Path$)        
       Else
        folder$="" 
    EndIf
    
    ProcedureReturn folder$
    
EndProcedure
User avatar
Andre
PureBasic Team
PureBasic Team
Posts: 2137
Joined: Fri Apr 25, 2003 6:14 pm
Location: Germany (Saxony, Deutscheinsiedel)
Contact:

Post by Andre »

Thanks for this one ! Will be included in next release... :D

Normally I'm reading all the posts on english & german PB forum and include good codes in the archive.

If anyone of you want to see more of his own code examples (probably with needed [small!] gfx,sound files) in the code-archive, simply send to andre@purebasic.com Thanks !
Bye,
...André
(PureBasicTeam::Docs & Support - PureArea.net | Order:: PureBasic | PureVisionXP)
TronDoc
Enthusiast
Enthusiast
Posts: 310
Joined: Wed Apr 30, 2003 3:50 am
Location: 3DoorsDown

Post by TronDoc »

@André:
Don't get TOO MANY of these EXCELLENT examples in
your code archive! We will not have a reason to visit
the forums anymore nor the time to learn them all!
<joking> :lol: Joe
peace
[pI 166Mhz 32Mb w95]
[pII 350Mhz 256Mb atir3RagePro WinDoze '98 FE & 2k]
[Athlon 1.3Ghz 160Mb XPHome & RedHat9]
User avatar
Andre
PureBasic Team
PureBasic Team
Posts: 2137
Joined: Fri Apr 25, 2003 6:14 pm
Location: Germany (Saxony, Deutscheinsiedel)
Contact:

Post by Andre »

TronDoc wrote:@André:
Don't get TOO MANY of these EXCELLENT examples in
your code archive! We will not have a reason to visit
the forums anymore nor the time to learn them all!
<joking> :lol: Joe
Not my problem. :lol: I'm already collecting to reach the 1000... :D
Bye,
...André
(PureBasicTeam::Docs & Support - PureArea.net | Order:: PureBasic | PureVisionXP)
User avatar
eddy
Addict
Addict
Posts: 1479
Joined: Mon May 26, 2003 3:07 pm
Location: Nantes

Post by eddy »

Now... :!:
Code Archiv will become very (x3) usefull for me.
I really need some good examples to understand how to work the new PB features. (COM, interfaces, etc..) 8O

For example, I have a tip to use clipboard in a Webgadget by using PB function "CALLCOM".
Is this function obsolete ?
Is there new solution ?
Imagewin10 x64 5.72 | IDE | PB plugin | Tools | Sprite | JSON | visual tool
freak
PureBasic Team
PureBasic Team
Posts: 5940
Joined: Fri Apr 25, 2003 5:21 pm
Location: Germany

Post by freak »

> For example, I have a tip to use clipboard in a Webgadget by using PB function "CALLCOM".

I made an example of using IWebBrowser2 and WebGadget with the new
Interface stuff.

Here:
viewtopic.php?p=35682#35682

It should be easy to use for the clipboard stuff.

Timo
quidquid Latine dictum sit altum videtur
User avatar
Andre
PureBasic Team
PureBasic Team
Posts: 2137
Joined: Fri Apr 25, 2003 6:14 pm
Location: Germany (Saxony, Deutscheinsiedel)
Contact:

Post by Andre »

Just in case, you haven't noticed it: :wink:

CodeArchive is now available as V1.6 with 914 PureBasic code examples. Go to www.PureArea.net for downloading... :D
Bye,
...André
(PureBasicTeam::Docs & Support - PureArea.net | Order:: PureBasic | PureVisionXP)
dmoc
Enthusiast
Enthusiast
Posts: 739
Joined: Sat Apr 26, 2003 12:40 am

Post by dmoc »

Great stuff Andre, well done and thanks!
TronDoc
Enthusiast
Enthusiast
Posts: 310
Joined: Wed Apr 30, 2003 3:50 am
Location: 3DoorsDown

Re: Get Special folders

Post by TronDoc »

high key wrote:I didn't find a code for special folders in André's CodeArchive, so I converted the example from the API-Guide:

Code: Select all

MessageRequester("Info",a$+Chr(13)+b$+Chr(13)+c$+Chr(13)+d$+chr$(13)+e$,0) 

Code: Select all

MessageRequester("Info",a$+Chr(13)+b$+Chr(13)+c$+Chr(13)+d$+chr(13)+e$,0) 
chr$
I make this "mistake" too! :wink:
Joe
peace
[pI 166Mhz 32Mb w95]
[pII 350Mhz 256Mb atir3RagePro WinDoze '98 FE & 2k]
[Athlon 1.3Ghz 160Mb XPHome & RedHat9]
User avatar
eddy
Addict
Addict
Posts: 1479
Joined: Mon May 26, 2003 3:07 pm
Location: Nantes

Post by eddy »

@Andre
You can update or correct some codes ?
Imagewin10 x64 5.72 | IDE | PB plugin | Tools | Sprite | JSON | visual tool
User avatar
Andre
PureBasic Team
PureBasic Team
Posts: 2137
Joined: Fri Apr 25, 2003 6:14 pm
Location: Germany (Saxony, Deutscheinsiedel)
Contact:

Post by Andre »

eddy wrote:@Andre
You can update or correct some codes ?
Normally the CodeArchive will be released every 5-6 weeks in a new version.

If you have any suggestions, corrections or new codes to be added, simply send them me per email to andre@purearea.net Thanks!
Bye,
...André
(PureBasicTeam::Docs & Support - PureArea.net | Order:: PureBasic | PureVisionXP)
User avatar
eddy
Addict
Addict
Posts: 1479
Joined: Mon May 26, 2003 3:07 pm
Location: Nantes

for the next release ...

Post by eddy »

add :
- treeview editable
- listbox editable

viewtopic.php?t=10064
In the same post there's a link to a lisbox tip
Imagewin10 x64 5.72 | IDE | PB plugin | Tools | Sprite | JSON | visual tool
User avatar
Andre
PureBasic Team
PureBasic Team
Posts: 2137
Joined: Fri Apr 25, 2003 6:14 pm
Location: Germany (Saxony, Deutscheinsiedel)
Contact:

Post by Andre »

@Eddy: already noticed. :wink:

Next version will be released in April, but don't ask for a specific date :P
Bye,
...André
(PureBasicTeam::Docs & Support - PureArea.net | Order:: PureBasic | PureVisionXP)
Post Reply