954,551 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

PHP Script Translate To VB 6.0

HI

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

regards
syedhanif

SYEDHANIF
Newbie Poster
1 post since May 2006
Reputation Points: 10
Solved Threads: 0
 

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).

Comatose
Taboo Programmer
Team Colleague
2,910 posts since Dec 2004
Reputation Points: 361
Solved Threads: 215
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You