GCFH

Would you like to react to this message? Create an account in a few clicks or log in to continue.
GCFH

Geomike's Hacks And Bots


5 posters

    Snippet Bank.

    avatar
    J4cK
    Global Moderator


    Posts : 151
    Reputation : 14
    Join date : 2011-12-19
    Age : 25
    Location : Australia (The land of Beaches, BBQS and Boobs)

    Snippet Bank. Empty Snippet Bank.

    Post by J4cK Fri May 04, 2012 3:00 am

    Warning! Still in progress!
    Well, i thought i should create a thread of handy snippets and tutorials and links.
    so here it is!

    Splitting a string or text into two parts.
    Code:
    dim mainvar as string = "word abc"
    Dim var1 as string = mainvar.substring(o,mainvar.indexof(" "))
    dim var2 as string = mainvar.substring(mainvar.indexof(" ") 1)
    the output for this would be: var1= "word' var2="abc"


    Want to request a snippet/code? pm me and i'll find it!
    rlenskens
    rlenskens
    Trusted Member
    Trusted Member


    Posts : 142
    Reputation : 3
    Join date : 2012-01-26
    Age : 26
    Location : The Netherlands

    Snippet Bank. Empty Re: Snippet Bank.

    Post by rlenskens Fri May 04, 2012 5:56 am

    Well, I am learning c++ kinda (as u know). I use Microsoft visual C++ express. And in some snippets there is like #include "windows.h" But everytime I copy that and then try to run it (ctrl f5) it gives an error that it doesnt have like that header fil or something IDK. How to download or IDK get those?
    BTW: do I always have to include "stdafx.h" ?
    avatar
    J4cK
    Global Moderator


    Posts : 151
    Reputation : 14
    Join date : 2011-12-19
    Age : 25
    Location : Australia (The land of Beaches, BBQS and Boobs)

    Snippet Bank. Empty Re: Snippet Bank.

    Post by J4cK Fri May 04, 2012 7:09 am

    lol dude, i have no idea what your talking about. i use c++ sometimes but i never get those errors, and post them in the c++ section!
    rlenskens
    rlenskens
    Trusted Member
    Trusted Member


    Posts : 142
    Reputation : 3
    Join date : 2012-01-26
    Age : 26
    Location : The Netherlands

    Snippet Bank. Empty Re: Snippet Bank.

    Post by rlenskens Fri May 04, 2012 10:26 am

    J4cK wrote:lol dude, i have no idea what your talking about. i use c++ sometimes but i never get those errors, and post them in the c++ section!

    sorry... But i am just learning... for like 2 days
    IbrahimAyad
    IbrahimAyad
    Global Moderator


    Posts : 11
    Reputation : 0
    Join date : 2011-12-21
    Age : 30

    Snippet Bank. Empty Re: Snippet Bank.

    Post by IbrahimAyad Fri May 04, 2012 5:41 pm

    rlenskens wrote:Well, I am learning c++ kinda (as u know). I use Microsoft visual C++ express. And in some snippets there is like #include "windows.h" But everytime I copy that and then try to run it (ctrl f5) it gives an error that it doesnt have like that header fil or something IDK. How to download or IDK get those?
    BTW: do I always have to include "stdafx.h" ?

    From what I know, you probably need to.
    rlenskens
    rlenskens
    Trusted Member
    Trusted Member


    Posts : 142
    Reputation : 3
    Join date : 2012-01-26
    Age : 26
    Location : The Netherlands

    Snippet Bank. Empty Re: Snippet Bank.

    Post by rlenskens Sat May 05, 2012 5:26 am

    IbrahimAyad wrote:
    rlenskens wrote:Well, I am learning c++ kinda (as u know). I use Microsoft visual C++ express. And in some snippets there is like #include "windows.h" But everytime I copy that and then try to run it (ctrl f5) it gives an error that it doesnt have like that header fil or something IDK. How to download or IDK get those?
    BTW: do I always have to include "stdafx.h" ?

    From what I know, you probably need to.

    okay, also thought so.
    BTW: U're also learning via www.learningcpp.com he? what chapter r u now?
    Geo_Andy
    Geo_Andy
    Runescape Coder


    Posts : 46
    Reputation : 6
    Join date : 2012-04-21
    Location : Pumopolis

    Snippet Bank. Empty Re: Snippet Bank.

    Post by Geo_Andy Sat May 05, 2012 1:03 pm

    Does the snippet thing appear invisible until highlighted to anyone else? Or is that just me?
    rlenskens
    rlenskens
    Trusted Member
    Trusted Member


    Posts : 142
    Reputation : 3
    Join date : 2012-01-26
    Age : 26
    Location : The Netherlands

    Snippet Bank. Empty Re: Snippet Bank.

    Post by rlenskens Sat May 05, 2012 5:45 pm

    Geo_Andy wrote:Does the snippet thing appear invisible until highlighted to anyone else? Or is that just me?
    Not just u man... Just noticed it now u say so -_-. Thougt there was nothing in there.
    [GCFH] geomike
    [GCFH] geomike
    Admin


    Posts : 68
    Reputation : 3
    Join date : 2012-01-02

    Snippet Bank. Empty Re: Snippet Bank.

    Post by [GCFH] geomike Sat May 05, 2012 5:59 pm

    Include your libraries in c++ like this: #include <windows.h>


    Use the <> for the main headers and the "" for your own headers.
    avatar
    J4cK
    Global Moderator


    Posts : 151
    Reputation : 14
    Join date : 2011-12-19
    Age : 25
    Location : Australia (The land of Beaches, BBQS and Boobs)

    Snippet Bank. Empty Re: Snippet Bank.

    Post by J4cK Sat May 05, 2012 6:33 pm

    Uhmm, put this in the c++ thread?
    Geo_Andy
    Geo_Andy
    Runescape Coder


    Posts : 46
    Reputation : 6
    Join date : 2012-04-21
    Location : Pumopolis

    Snippet Bank. Empty Re: Snippet Bank.

    Post by Geo_Andy Sat May 05, 2012 7:06 pm

    Oh good call J4ck

    Sponsored content


    Snippet Bank. Empty Re: Snippet Bank.

    Post by Sponsored content


      Current date/time is Thu Mar 28, 2024 7:42 am