We use cookies to ensure that we give you the best experience on our website. If you continue to use this site we will assume that you are happy with it.

read CSV – Local variables

Home Forums General Questions read CSV – Local variables

  • This topic has 3 replies, 2 voices, and was last updated 1 year ago by kdv.
Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #62036
    radek
    Customer

    Hi.
    Verge 4.3.0

    I am trying to load data from a .csv file and use it in different places in the application.

    Variables defined inside puzzle “load data” are local. Is there a special reason for this? How can I use the “Products” variable defined inside the puzzle “load data” outside the puzzle “load data”?

    In this case, the variable “Products” has a null value if it is outside the puzzle “load data”

    Attachments:
    You must be logged in to view attached files.
    #62039
    kdv
    Participant

    The first variant is correct, in the second variant you are trying to read the variable before it has been defined. this variable is not local, it’s just undefined yet. once ready do slots are not just for fun and beauty, they are used in functions which take some time to complete all actions.

    How can I use the “Products” variable defined inside the puzzle “load data” outside the puzzle “load data”?

    you can do it right after data have been loaded. for example, you can use a time delay to read this variable in 1-2-3 seconds

    Puzzles and JS. Fast and expensive.

    If you don’t see the meaning in something it primarily means that you just don’t see it but not the absence of meaning at all.

    #62077
    radek
    Customer

    OK, thanks.

    I actually thought that the next puzzle in the sequence is only triggered in the program if the previous puzzle is completed. just like a line in a program.

    #62080
    kdv
    Participant

    In general it works as you described. But some function (async, Promise) require some time to be completed and they run in parallel threads while other functions continue running in the main thread one by one. Such as load scene, load data, append scene, replace texture etc.

    Puzzles and JS. Fast and expensive.

    If you don’t see the meaning in something it primarily means that you just don’t see it but not the absence of meaning at all.

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.