PHP Script Translate To VB 6.0

Reply

Join Date: May 2006
Posts: 1
Reputation: SYEDHANIF is an unknown quantity at this point 
Solved Threads: 0
SYEDHANIF SYEDHANIF is offline Offline
Newbie Poster

PHP Script Translate To VB 6.0

 
0
  #1
May 20th, 2006
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.
Reply With Quote Quick reply to this message  
Join Date: Dec 2004
Posts: 2,413
Reputation: Comatose is a jewel in the rough Comatose is a jewel in the rough Comatose is a jewel in the rough Comatose is a jewel in the rough 
Solved Threads: 211
Team Colleague
Comatose's Avatar
Comatose Comatose is offline Offline
Taboo Programmer

Re: PHP Script Translate To VB 6.0

 
0
  #2
May 21st, 2006
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).
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC