Indigo Rose Software

Professional Software Development Tools

 
Results 1 to 8 of 8
  1. #1
    Join Date
    Aug 2003
    Posts
    2,427

    Really need help with referencing tables.

    I've been building a slider to control audio volume and I thought that I could use a whole series of hotspots and then control both an image position (like a little cursor) and also the volume by using HotSpot.GetPos in the 'On Enter' event of each hot spot.

    I just cannot get my head round referencing the table returned by the action. I always get a Type(Nil). Has anybody got a VERY simple example that I can look at.

    I'm sure I understand the concept of tables/arrays (great tutorial Corey wish I'd got you for some voice overs ) but where I am falling down is in accessing the HotSpot.GetPos data.

    I've actually done what I wanted by hard coding x,y positions and volume levels and it all works, but I need to know where I'm going wrong for the sake of my sanity.

  2. #2
    Join Date
    Aug 2003
    Posts
    2,427
    for instance what is wrong here, shouldn't the variables pos_x and pos_y be assigned the x,y co-ordinates of the button when the event fires? They remain of type 'Nil' so I'm obviously way off mark

    button_pos = Button.GetPos("Button1");
    pos_x=button_pos[x];
    pos_y=button_pos[y];

  3. #3
    Join Date
    Jul 2002
    Location
    USA
    Posts
    3,959
    You need to use button_pos.X and button_pos.Y

    GetPos returns an Associative table. You reference the table elements by using the associated name.

    Quote Originally Posted by longedge
    for instance what is wrong here, shouldn't the variables pos_x and pos_y be assigned the x,y co-ordinates of the button when the event fires? They remain of type 'Nil' so I'm obviously way off mark

    button_pos = Button.GetPos("Button1");
    pos_x=button_pos[x];
    pos_y=button_pos[y];

  4. #4
    Join Date
    Oct 2001
    Location
    Norway
    Posts
    939
    Tables in AMS can be a pain, but how useful they are when you can handle them! I have spent a lot of hours to be a friend with “tables and arrays”; this is indeed essential when working with AMS. It was a relief to read a post from Worm (last year), even that guy had a question about tables.

    Don’t misunderstand, Worm, it’s meant to be a compliment! At the time being I’m archiving your DLLs in \Gallery\DWL (“Dynamic Worms Library” – as proposed by Intrigued). I have to create a small .chm to have an overview of your DLLs. Your KEYSTROKE.DLL is incredible, thanks a lot.

  5. #5
    Join Date
    Jul 2002
    Location
    USA
    Posts
    3,959
    Thanks csd214, I'll accept an accolade in any form

    It took me a bit to get my head wrapped around the tables in AMS that is for sure. I'm still learning about them too. Once I think I have something locked down, I see a post from someone else that has done the same thing I'm doing, but they did it in half the steps and with much more clarity.

    As for the KeyStroke.DLL, the credit should go to William Burns from the PowerBASIC forums. He wrote the include file for PowerBASIC, I merely made a DLL that wraps the functionality for use in AMS.



    Quote Originally Posted by csd214
    Tables in AMS can be a pain, but how useful they are when you can handle them! I have spent a lot of hours to be a friend with “tables and arrays”; this is indeed essential when working with AMS. It was a relief to read a post from Worm (last year), even that guy had a question about tables.

    Don’t misunderstand, Worm, it’s meant to be a compliment! At the time being I’m archiving your DLLs in \Gallery\DWL (“Dynamic Worms Library” – as proposed by Intrigued). I have to create a small .chm to have an overview of your DLLs. Your KEYSTROKE.DLL is incredible, thanks a lot.

  6. #6
    Join Date
    Dec 2003
    Location
    Location! Location!
    Posts
    6,137
    Don't tell I.R. representatives (*wink), but I would probable pay a small fee to access this forum! However, I believe this forum is an excellent selling point as is; that I.R. or their clients/customers can share with others who are looking for an application such as AMS and that which has excellent, free, quick forum help!

    I have been active in the AMS forum for a short period (six months approximately) and I find that when adding the 'human element' combined with real-time solutions here in the forum it is the strong 'right-cross' to the two manual's 'left-jab' that makes AMS a one-two punch on my projects that make them much more professional and more quickly available to distribute! (and don't forget those Speedy Training CD-ROMS by Corey!)

    Worm's contributions (and other front runners here like, TJ, Corey, Brett, Adam, Lorne, and others) surely add that dynamic that applications for sale need in order to shine above the rest in the market segment they occupy, in my opinion.
    Intrigued

  7. #7
    Join Date
    Aug 2003
    Posts
    2,427
    Quote Originally Posted by Intrigued
    this forum is an excellent selling point
    Certainly made the buying decision easy for me. I'm sure that 'guests' just popping in for a 'look see' can't fail to be impressed at this level of support from IR staff and users alike.

    Obviously the software is great but the forum is the 'icing on the cake' for me - now then what was it I was going to try - oh yes .x NOT [x] - let's give it another go.... one day soon I hope I'll have one of those moments when it all becomes clear to me.

  8. #8
    Join Date
    Aug 2003
    Posts
    2,427
    Ahhhh grasshopper x<>X and neither does y=Y

    Now to try and work out why a button with attributes of -
    Left-200 Top -300
    Width-200 Height-50 returns values of 720 - X and 558 -y

    but that will do for another day - many thanks Worm.

Similar Threads

  1. Tables, CSV (Excel) and Database Reports
    By csd214 in forum AutoPlay Media Studio 5.0
    Replies: 1
    Last Post: 04-27-2004, 12:08 PM
  2. Using Tables and Memory resources handling
    By SUF6NEWBIE in forum AutoPlay Media Studio 5.0
    Replies: 3
    Last Post: 04-19-2004, 12:11 PM
  3. Tables and Text Files
    By morci in forum AutoPlay Media Studio 5.0
    Replies: 3
    Last Post: 03-04-2004, 05:47 PM
  4. Always confusing with tables
    By arnaud in forum AutoPlay Media Studio 5.0
    Replies: 3
    Last Post: 01-25-2004, 06:33 PM
  5. Working with Tables and Files
    By Desmond in forum AutoPlay Media Studio 5.0 Examples
    Replies: 0
    Last Post: 12-23-2003, 08:22 AM

Posting Permissions

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