Announcement

Collapse
No announcement yet.

setGlobalValue() getGlobalValue()

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • setGlobalValue() getGlobalValue()

    Can the setGlobalValue()/getGlobalValue() be used to pass array() and or file object. Or are you limited to just scalar values as given in the examples?

  • #2
    scjohn
    Yes it can. See this thread with examples by JasonK and Steve Hare
    FYI I found it by searching for setGlobalValue AND array
    Alex

    Comment


    • #3
      At least as of the last time I tested it you could not store objects of any sort in Global Variables.

      Chris

      Comment


      • #4
        scjohn,

        Yes, they can be used to pass one or two dimensional arrays. Two dimensional arrays when passed become one dimensional (twice as long) on the receiving end. I found that passing arrays of objects overcomes that limitation however.

        One precaution... if you allow the numbers to have an excessive number of decimal points to the right, I have found you will run into problems. As a result, I ensure the numbers are transmitted with a maximum of 4 decimal points to the right (e.g. Slope.toFixed(4)*1). The toFixed(4) rounds to 4 decimal points and converts the number to a string. The *1 converts the string back into a number.

        edit - just posted a code snippet to my fileshare showing how to put together an array of objects
        Last edited by Guest; 03-23-2005, 08:20 AM.

        Comment


        • #5
          Oops, looks like I stand corrected by Alex

          Chris

          Comment

          Working...
          X