Results 1 to 3 of 3

Thread: Declaring an array to achieve global scope

  1. #1

    Declaring an array to achieve global scope

    Hello

    Sorry for yet another newbie lscript question:

    I can declare variables to get global scope (Templates / Generic - placed under '// global values go here').

    But I get a syntax error if I try to place an array there. The same array declaration placed elsewhere, however, doesn't produce the syntax error. (But then it doesn't have the global scope I need it to have).

    Why can't I declare a global array as I can with variables? How to do so?

    Thanks!

  2. #2
    automator of tasks xchrisx's Avatar
    Join Date
    Jul 2003
    Location
    Nevada
    Posts
    593
    Blog Entries
    6
    Below I have 2 examples. One is initializing an empty array and the other is initializing an array with values. The first array is then set in the generic part of the script. Finally one value from each array is displayed using info. I hope this answers your question.

    Code:
    @warnings
    @version 2.2
    @script generic
    
    myArray;
    myArrayB = @"d","e","f"@;
    
    generic
    {
    		myArray = @"a","b","c"@;
    		info(myArray[1] + " " + myArrayB[3]);    
    }
    My Lscript Collection | LinkedIn
    3D Generalist IGT

  3. #3
    It works, thank-you!

Bookmarks

Posting Permissions

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