943,987 Members | Top Members by Rank

Ad:
May 20th, 2006
0

PHP Script Translate To VB 6.0

Expand Post »
HI
Visual Basic 4 / 5 / 6 Syntax (Toggle Plain Text)
  1. class Astro
  2. {
  3. var $jd;
  4. var $dec;
  5. var $ra;
  6. var $sid;
  7. var $dra;
  8. var $rsum;
  9. function Astro()
  10. {
  11. $this->jd = 0.0;
  12. $this->dec = array(0.0, 0.0, 0.0);
  13. $this->ra = array(0.0, 0.0, 0.0);
  14. $this->sid = array(0.0, 0.0, 0.0);
  15. $this->dra = array(0.0, 0.0, 0.0);
  16. $this->rsum = array(0.0, 0.0, 0.0);
  17. }
  18. function copyFrom(&$source)
  19. {
  20. $this->jd = $source->jd;
  21. $this->dec = array_values($source->dec);
  22. $this->ra = array_values($source->ra);
  23. $this->sid = array_values($source->sid);
  24. $this->dra = array_values($source->dra);
  25. $this->rsum = array_values($source->rsum);
  26. }
  27. };

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
Last edited by Comatose; May 20th, 2006 at 7:11 am.
Reputation Points: 10
Solved Threads: 0
Newbie Poster
SYEDHANIF is offline Offline
1 posts
since May 2006
May 21st, 2006
0

Re: PHP Script Translate To VB 6.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).
Team Colleague
Reputation Points: 361
Solved Threads: 214
Taboo Programmer
Comatose is offline Offline
2,413 posts
since Dec 2004

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in Visual Basic 4 / 5 / 6 Forum Timeline: Beep
Next Thread in Visual Basic 4 / 5 / 6 Forum Timeline: Exporting Recordset into txt delimited





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC