Login ProductsSalesSupportDownloadsAbout |
Home » Technical Support » Elevate Web Builder Technical Support » Support Forums » Elevate Web Builder General » View Thread |
Messages 1 to 7 of 7 total |
Compiling const array literals |
Wed, Sep 28 2016 2:27 AM | Permanent Link |
Michael Dreher | In the help/Introduction/Literals there are two examples of the array value type:
- ['This','is','a','string','array','literal'] - [100,2,45] So I tried const s1 = ['This','is','a','string','array','literal']; s2 = [100,2,45]; and get a compiler error - "[Error]: Duplicate identifier declaration array of ". Of what? There is a training blank in the error string. Where is my mistake? Michael Dreher Attachments: CodeExampleConstArray.zip |
Wed, Sep 28 2016 4:01 AM | Permanent Link |
Matthew Jones | Michael Dreher wrote:
> const Shouldn't that be var? -- Matthew Jones |
Wed, Sep 28 2016 4:55 AM | Permanent Link |
Michael Dreher | "Matthew Jones" wrote:
// > const // Shouldn't that be var? In the library code I've found examples, where array literals are assigned to local vars (WebCore.isDay for example). But then the help defines: // <Constant Declaration> = // <Constant Name> = <Expression> // // The <Expression> element can be any valid expression that does not contain any variable, function, // or procedure references. In other words, the expression can only contain other constant references, // or literal expressions. And on a global scope I'd ensure the values are not modified, hence const. Interesting: s1 and s2 can be compiled without errors, but mutually exclusive and not together. Michael Dreher |
Wed, Sep 28 2016 5:27 AM | Permanent Link |
Matthew Jones | Michael Dreher wrote:
> Interesting: s1 and s2 can be compiled without errors, but mutually > exclusive and not together. In which case, report it to Tim via email with a sample project. Sounds like a compiler issue. -- Matthew Jones |
Wed, Sep 28 2016 5:44 AM | Permanent Link |
Michael Dreher | "Matthew Jones" wrote:
// In which case, report it to Tim via email with a sample project. Sounds // like a compiler issue. That's why I already attached the project code in my first post of this thread Michael Dreher |
Mon, Oct 3 2016 1:05 PM | Permanent Link |
Tim Young [Elevate Software] Elevate Software, Inc. timyoung@elevatesoft.com | Michael,
<< In the help/Introduction/Literals there are two examples of the array value type: - ['This','is','a','string','array','literal'] - [100,2,45] So I tried const s1 = ['This','is','a','string','array','literal']; s2 = [100,2,45]; and get a compiler error >> Those are variable examples, and apparently the compiler is having an issue with using them in a const section. I'll check it out. Tim Young Elevate Software www.elevatesoft.com |
Mon, Oct 3 2016 1:26 PM | Permanent Link |
Tim Young [Elevate Software] Elevate Software, Inc. timyoung@elevatesoft.com | Michael,
No, it wasn't the const section, it was the way that the compiler was naming array types that are created "on-the-fly" for use in one-offs like consts. It's now fixed. Tim Young Elevate Software www.elevatesoft.com |
This web page was last updated on Thursday, December 5, 2024 at 07:37 AM | Privacy PolicySite Map © 2024 Elevate Software, Inc. All Rights Reserved Questions or comments ? E-mail us at info@elevatesoft.com |