Array declaration - Forum

Forum Navigation
You need to log in to create posts and topics.

Array declaration

Hi, I need to created an array using a variable inside.

How do you declare the [Titre (x)] array?

x here is a suite of number that increase or diminish

[Titre (x)] "My text" - x = 1

[Titre (x)] "My House" - x = 2

etc... up to whatever

Thanks!

Roger

@rocote, I don't understand your question. Anyway, have you seen this?:
https://webhelp.visualneo.com/VariableArrays.html

Regards.

Hi Luis...

Indeed I saw this page and I stayed all before noon.
For some reason, the value [Title (1)] "My House" does not want to appear in the Headline.

@rocote, for screen display you should use this syntax:

[Title|element:1]

Regards.

Oh yes, I have done this too

I have put the [Title|element:1] in the text property of the Headline object and nothing.

 

I send you an image of the error I have when using this statement.

Roger

 

Uploaded files:
  • You need to login to have access to uploads.

Here is an example (reduce) of what I am trying to do.

The previous and next buttons are adding or subtract the count by +1 or -1.

The variable x represent the number in memory.

Then, right under the number (in the big square) I want each title corresponding to each valut inside of [Title (1)] and [Title (2)] etc ... up to the last to show the name (under the number inside the big square) choose for each value.

I tried a container with the headline and paragraph objects and nothing appear.

Take a look at the example I send you

I also have a question.   Where is the best place to declare a variable to be Global or accessible through the application?

Usually, I'm using Project and Event.

Thanks for your help again!

Roger

 

Uploaded files:
  • You need to login to have access to uploads.

@rocote, I think you are trying to add items to a non existing Array. Also remember first item is allways under 0 index, not 1. Please take a look at my attached sample.

Uploaded files:
  • You need to login to have access to uploads.
Vadim has reacted to this post.
Vadim

You're right, I started at (1) and not (0). It changed everything. I was still doing it well, but because of that, it wasn't working good at all.

I am still surprised to see that this little problem was so important to make what I did work.
There are also the capital letters which must be taken care of.

Thank you Louis again!

I have another question for you Luis.

Is it possible to use a variable Array for the file name using CreateVideoPlay?

I tried a few things like:

CreateVideoPlayer "Container4" "C:\Users\rocote\Desktop\New 13\VideoApp Resources\"  [Title(x)] true true false false

As you can see, it is an idea but it doesn't work.

Do you have a solution for this?

Roger

@rocote please take a look at the attached sample.
Note that you will need to use a relative path instead of a absolute one.

This is not correct:

SetVar [myvideo] "c:\mypath\myvideo.mp4"
CreateVideoPlayer "Container1" "[vmyvideo]" true false false false

This is correct:

SetVar [myvideo] "./media/myvideo.mp4"
CreateVideoPlayer "Container1" "[myvideo]" true false false false

Note that, when using a variable to store the video file path VisualNEO will not include the video file automaticaly, so you will need to include it manually.

Uploaded files:
  • You need to login to have access to uploads.