Results 1 to 6 of 6

Thread: parallel control arrays

  1. #1

    Thread Starter
    New Member
    Join Date
    Oct 2000
    Posts
    2
    Hello all,

    I am trying to write a simple app which has parallel arrays. One array has option buttions and the other array
    has images. I want to move an image to a larger image based on the option selected.

    My click event for the options buttons is;


    Private Sub Option_Click(Index As Integer)
    imgPicture.Picture = Image(Index).Picture
    End Sub

    Why do I get an error of 'invalid qualifier'?

    Gary
    Gary

    trying to convert from mf to object O tech

  2. #2
    Frenzied Member sebs's Avatar
    Join Date
    Sep 2000
    Location
    Aylmer,Qc
    Posts
    1,606
    How do you declare your array of picture?

    You have to set each element in your array as picture.

    ex:set array(2).picture = "c:\allo.bmp"

  3. #3
    transcendental analytic kedaman's Avatar
    Join Date
    Mar 2000
    Location
    0x002F2EA8
    Posts
    7,221
    Use stdpictures instead of pictureboxes if their only purpose is to store the picture contents that will show up when you click the option. You get invalid qualifier because you didn't use Set as sebs showed you. Set should be used to set any object variables.
    Use
    writing software in C++ is like driving rivets into steel beam with a toothpick.
    writing haskell makes your life easier:
    reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
    To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.

  4. #4

    Thread Starter
    New Member
    Join Date
    Oct 2000
    Posts
    2

    Question more confused

    Thanks for the reply but I am more confused.

    Each image property in the image array has a picture
    defined. All I want to do is move one of these pictures
    to the big image box on the form.

    My text book says to make the arrays parallel. What does
    that mean. Do I have to do something special to make
    the arrays parallel.

    Gary

    trying to convert from mf to object O tech

  5. #5
    transcendental analytic kedaman's Avatar
    Join Date
    Mar 2000
    Location
    0x002F2EA8
    Posts
    7,221
    Nothing special with parallell arrays, you just know that both arrays contain related data for each element independently, that means when you add something to the first, you also add to the other, that goes from removing, moving and swapping the data.

    I think you should use Stdpictures to save resources: declare the array as Stdpicture instead of picturebox and use the stdpicture directly when loading the bitmap:
    Code:
    Image(index) = Loadpicture("C:\Yourpic.bmp")
    Then to set the Image contents to the imagebox:
    Code:
    set imgPicture.Picture = Image(Index)
    Use
    writing software in C++ is like driving rivets into steel beam with a toothpick.
    writing haskell makes your life easier:
    reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
    To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.

  6. #6
    Frenzied Member sebs's Avatar
    Join Date
    Sep 2000
    Location
    Aylmer,Qc
    Posts
    1,606
    I don't know what you're doiing wrong, cuz i just try it
    and it works great.

    -I put an array of image
    -1 picture box
    -array of option button

    and here's my code:
    Code:
    Private Sub Option1_Click(Index As Integer)
    Picture1.Picture = Image1(Index).Picture
    End Sub
    it works!!!!

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