Indigo Rose Software

Professional Software Development Tools

 
Results 1 to 9 of 9
  1. #1
    Join Date
    Feb 2004
    Posts
    4

    DIsplay Variable

    Sorry for posting such an arcane question, but I am picking up AMS5 ob the fly coming from AMS 3......

    I want to display the user's OS on my menu. In AMS3 I simply did assign it to a variable thisOS and put %thisOS% on my menu.

    How is this done in AMS5. I am not clear on how to pull this off.

    Thanks!
    basehitter10

  2. #2
    Join Date
    Oct 2002
    Location
    RealFake, RF
    Posts
    403
    Variables in AMS5 are anything (with a few exceptions) that you define as such. For instance, to declare a variable (to set it up) you simply type:

    MyVariable = "123";

    In AMS3/4 you would have used %MyVariable%. Now when you want to display what the variable represents, you simply tell the program to display MyVariable.

    if you try to tell the program to display "MyVariable" it will literally display the text MyVariable and not 123 (in this case). If you tell the program to display %MyVariable%, it will likely come up with an error because it thinks you're trying to display a variable labeld %MyVariable% which hasn't been declared (set up).

    Now here's the AMS5 code to set a label object with their OS Name:


    OSName = System.GetOSName();
    Label.SetText("Name of Label Object", OSName);


    Before you try and run the code, you'll need to define the Label Object which in this example is temporarily called "Name of Label Object". That is to say, you'll need to actually have a Label Object somewhere on your page called "Name of Label Object".

    What the above code did was to first get the OSName from the user's system. Then it placed that value (OS Name) in a variable called OSName. Now you can do whatever you want with that.

    Where you need to remember is to look at the drag and drop functions carefully. Sometimes the value they return is a Table. In AMS3/4, you actually had to manually place values into tables. In AMS5 (depending on the function) it will do whatevers best for the code (it thinks ahead and uses what it thinks you will want). This makes the code a lot smarter (smaller in total size), but can be a wee bit confusing to users of older versions at first.
    Last edited by Protocol; 12-21-2004 at 02:18 PM.
    "White-colla-AMS-gangsta."

  3. #3
    Join Date
    Oct 2002
    Location
    RealFake, RF
    Posts
    403
    If it does insert the value into a table, you can do any number of things to extract the value from the table and treat it as a variable. Although, this is another topic. Just remember to use the "Learn more about this function" links and see what type of return it's going to give you.

    In the above mentioned case, the function "System.GetOSName();" returns a value. That value can be named whatever you want. I called it OSName in order to be clever and throw off every coder out there.

    Let me know if you need any more help getting acclimated. Trust me...it's well worth the effort!


    Protocol
    Last edited by Protocol; 12-21-2004 at 02:30 PM.
    "White-colla-AMS-gangsta."

  4. #4
    Join Date
    Feb 2004
    Posts
    4
    When I insert a label object it wants to display the text "thisOS" rather than the variable value - I am still confused.

    basehitter10

  5. #5
    Join Date
    Dec 2003
    Location
    Location! Location!
    Posts
    6,137
    If you are interested in learning more about the embedded language (LUA) from the perspective of Indigo Rose's documentation I would recommend either printing off (or buying such from them) the manual for AMS 5.

    Also, take a look at the Computer Based Training--3-CD set on www.speedytraining.com that I.R. representative Corey personally did for the AMS community. The price is much cheaper (but the quality and ease-of-use are still top-notch!) than other training CD-ROMS I have purchased. I enjoy the one's I have and recommend them for those that want to "get serious" with AMS 5.

    Don't forget to use this Website's SEARCH feature to find code snippets to help you along the way!

    When all is said and done I believe that AMS built-in LUA language is MUCH easier to grasp and use over say C++!

    Sincerely,
    Intrigued

  6. #6
    Join Date
    Jul 2002
    Location
    USA
    Posts
    3,959
    Make sure you don't enclose the variable in quotes (" ")

    When you enclose a variable in quotes, AMS will display what has is enclosed within the quotes. I'll bet that if you remove the quotes from around your variable, you'll get the results your looking for.

  7. #7
    Join Date
    Oct 2002
    Location
    RealFake, RF
    Posts
    403
    Yeah...

    Basicly, AMS5 doesn't use the % symbol for variables anymore. Instead, you just say this=that. Actually you'd type:

    this = that;



    So...this is the correct code:

    ThisOS = System.GetOSName();
    Label.SetText("Name of Label Object", ThisOS);

    The above code will display the name of the OS.



    and this is the incorrect code:

    ThisOS = System.GetOSName();
    Label.SetText("Name of Label Object", "ThisOS");

    This code will display the actual text "ThisOS"



    When you put anything in quotes...it means display exactly what is in the quotes. This is an important distinction in AMS5. Although this was also true n oder versions as well. If you typed "%Variable%" with the quotes, it too would have displayed the text %Variable% and not the value of the variable itself.

    Just don't use quotes or the percentage signs in your variables.

    Let me know if ya still need help...
    "White-colla-AMS-gangsta."

  8. #8
    Corey is offline Indigo Rose Staff Alumni
    Join Date
    Aug 2002
    Posts
    9,746
    Thanks for the plug I-man.

  9. #9
    Join Date
    Feb 2004
    Posts
    4
    Thanks all - I got it. It is a bit different than AMS3, but once you get the gist of it it's straightforward.

    I got a copy of the training CD when I bought the software. Now I'll actually load it up and use it....lol

    basehitter10

Similar Threads

  1. problem with variable
    By UweGeercken in forum Setup Factory 6.0
    Replies: 2
    Last Post: 07-12-2004, 04:15 AM
  2. Variable in a variable name??
    By GurkGager in forum Setup Factory 6.0
    Replies: 1
    Last Post: 05-18-2004, 02:31 PM
  3. Can't copy files with variable??
    By SonG0han in forum AutoPlay Media Studio 5.0
    Replies: 1
    Last Post: 03-06-2004, 03:58 AM
  4. HOWTO: Display Conditional Text Based Upon a List Box Selection
    By Support in forum AutoPlay Media Studio 4.0 Examples
    Replies: 0
    Last Post: 10-15-2002, 10:54 AM
  5. Validation of custom variable references?
    By John Schacher in forum Setup Factory 5.0
    Replies: 1
    Last Post: 07-18-2000, 01:26 PM

Posting Permissions

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