class Astro
  var $jd;
  var $dec;
  var $ra;
  var $sid;
  var $dra;
  var $rsum;
  function Astro()
    $this->jd   = 0.0;
    $this->dec  = array(0.0, 0.0, 0.0);
    $this->ra   = array(0.0, 0.0, 0.0);
    $this->sid  = array(0.0, 0.0, 0.0);
    $this->dra  = array(0.0, 0.0, 0.0);
    $this->rsum = array(0.0, 0.0, 0.0);
  function copyFrom(&$source)
    $this->jd   = $source->jd;
    $this->dec  = array_values($source->dec);
    $this->ra   = array_values($source->ra);
    $this->sid  = array_values($source->sid);
    $this->dra  = array_values($source->dra);
    $this->rsum = array_values($source->rsum);

this the php script i need this script to translate in vb 6.0 i am really confuse on certian area how to bring this code in vb can any body please help out


I'm not 100% sure what is happening in the PHP Script. It looks to me like it defines some variables, and has a constructor function (called Astro), which does nothing but assign the value 0 to the members of the astro class. 1 scalar and 5 arrays. Then, there is a function (method) called copyFrom, which takes a source value (I'm guessing it's another instance of the same class), and sets the current instances values to the same thing. While this is nifty, it's not plausible in Vb6. The reason, is because arrays are not allowed as public members of a class. So, even when passed, the values stay encapsulated, and can not be referenced from another class (there may be a workaround using addressof, but I haven't been able to pull one off yet).

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.