Results 1 to 3 of 3

Thread: CopyMemory for types

  1. #1

    Thread Starter
    PowerPoster Fox's Avatar
    Join Date
    Jan 2000
    Location
    *afk*
    Posts
    2,088

    Post

    Is there a way to copy a Type? I have a player type and wanted to copy it around, but I don't know which size it is. Look what I mean:

    -
    Type tPlayer
    X as Long
    Y as Long
    DC as Long
    End Type

    Dim SrcPlayer(3) as Long 'Here are the original players stored
    Dim Player(10) as tPlayer 'And these are used in the game

    CopyMemory Player(0), SrcPlayer(1), SizeOf(tPlayer)

    'As you can see I try to add a new player and want to copy the whole values but I don't know the size of tPlayer.
    -

    Any help will be great!

    ------------------
    [email protected]
    ...
    Every program can be reduced to one instruction which doesn't work.


  2. #2
    Hyperactive Member
    Join Date
    Jan 2000
    Posts
    355

    Post

    er.. cant you just do:

    Player(0) = Player(1)
    u can just do that as long as the two variables are of the same type.
    im using that in my game with types - and it works
    im not sure if thats waht you wnat though..

    ------------------
    cintel rules
    www.cintelsoftware.co.uk

  3. #3

    Thread Starter
    PowerPoster Fox's Avatar
    Join Date
    Jan 2000
    Location
    *afk*
    Posts
    2,088

    Post

    Oh yes, thanks alot!

    As I remember it didn't work last time I tried this... maybe my mistake

    -Thanks again (You'll get my game for free ).

    ------------------
    [email protected]
    ...
    Every program can be reduced to one instruction which doesn't work.


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width