Indigo Rose Software

Professional Software Development Tools

 
Results 1 to 5 of 5
  1. #1
    Join Date
    Aug 2004
    Location
    Gent, Belgium
    Posts
    74

    Peekaboo! Listbox calculus

    Hi,

    I have to make calculations with lisboxes that are spread over several pages. The user selects a text-item from the listbox (that is internally associated with a data item). These data items are numbers that have to be added to a running total. I take it that the data item is also a string ? How to convert it to an integer ?
    So I have to get the item that the user has selected and then from that item get the index and then the corresponding dataitem and then the numeric value of that data iitem. Seems rather complicated. What is the best way to do this ? (I have 20 listboxes ). AMS 5.0 pro.

    Sincerely,

    Georges

  2. #2
    Corey is offline Indigo Rose Staff Alumni
    Join Date
    Aug 2002
    Posts
    9,746
    Hi. Using functions you can encompass all those procedures into a single code block which can then be called with a single command, i.e. doCalc(); or getValue("Listbox1");

    For a solid intro to functions in AMS check out the free video clip on this page:

    http://speedytraining.com/site/cd3.php

    By clicking where it says, "Functions : An Easy Explanation [11:29] (Click here to view this video now!)"

    Hope that helps.

    Corey Milner
    Creative Director, Indigo Rose Software

  3. #3
    Join Date
    Sep 2002
    Location
    Sol 3
    Posts
    3,160
    George,

    First variables are global in nature. Once your user makes a selection in a listbox, you can get the selected items data and store that in a variable to be used later. Make sure that each variable is unique between your listboxes so you don't overwrite the value in the variable. maybe something like this

    nPage1LB1
    nPage2LB1
    nPage3LB1
    nPage4LB1
    nPage5LB1
    nPage6LB1
    nPage7LB1
    nPage8LB1

    To answer your question about coverting to an interger, there is an action String.ToNumber that will convert your data from a string to a number.

    then you can just add the items together.

    Code:
    value = nPage1LB1 + nPage2LB1 + nPage3LB1 + nPage4LB1 + nPage5LB1 + nPage6LB1 + nPage7LB1 + nPage8LB1
    Of I just had another thought where you could store all the values you have captured in a table and use a for loop to add them together.

    I hope these ideas help to get you started.

    Tigg

    Quote Originally Posted by Georges
    Hi,

    I have to make calculations with lisboxes that are spread over several pages. The user selects a text-item from the listbox (that is internally associated with a data item). These data items are numbers that have to be added to a running total. I take it that the data item is also a string ? How to convert it to an integer ?
    So I have to get the item that the user has selected and then from that item get the index and then the corresponding dataitem and then the numeric value of that data iitem. Seems rather complicated. What is the best way to do this ? (I have 20 listboxes ). AMS 5.0 pro.

    Sincerely,

    Georges
    TJ-Tigger
    "A common mistake that people make when trying to design something completely foolproof was to underestimate the ingenuity of complete fools."
    "Draco dormiens nunquam titillandus."
    Map of IR Forum Users - IR Project CodeViewer - Online Help - TiggTV - QuizEngine

  4. #4
    Join Date
    Aug 2004
    Location
    Gent, Belgium
    Posts
    74

    Peekaboo!

    Whaw,

    I am impressed with the speed , friendlyness and quality of the support on this forum. I was not aware of the power of this scripting engine in AMS. I worked with other form development systems before but once it comes to speed and flexibility (:=power) AMS beats them all especially in large multipage projects. I am amazed and impressed and will be delving deeper in the LUA like language for further developments.
    I am now working on a system that captures data and saves them in a database. I see that there is a SQL plugin available that could accomodate this (is that right ?). I have ordered the CD's that will simplify these early steps and if I got stuck somewhere well this forum is a fine place to come back to. maybe one day I will be able to post some things myself and contribute to the ongoing efforts.

    Really gratefull,

    Georges

  5. #5
    Corey is offline Indigo Rose Staff Alumni
    Join Date
    Aug 2002
    Posts
    9,746
    Cool!

    Corey Milner
    Creative Director, Indigo Rose Software

Similar Threads

  1. Example: Using the ListBox object
    By Ted Sullivan in forum AutoPlay Media Studio 5.0 Examples
    Replies: 0
    Last Post: 05-07-2004, 12:24 PM
  2. Listbox... how to? part 2
    By cold_fusion in forum AutoPlay Media Studio 4.0
    Replies: 7
    Last Post: 02-07-2004, 12:28 PM
  3. Dynamic ListBox
    By Bruce in forum AutoPlay Media Studio 5.0
    Replies: 7
    Last Post: 01-06-2004, 09:13 AM
  4. Continious play of MP3 in a ListBox
    By Alien in forum AutoPlay Media Studio 4.0
    Replies: 2
    Last Post: 08-06-2003, 07:55 AM
  5. From listbox to listbox to flash
    By Konradsen in forum AutoPlay Media Studio 4.0
    Replies: 5
    Last Post: 05-13-2003, 06:24 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