easiest way to convert a visual basic program to corona?

I have a program I made in visual basic i really want to port onto corona… What do you think the best method of this is? i was using visual basic 6 [import]uid: 22559 topic_id: 24842 reply_id: 324842[/import]

There are almost no elements of commonality between the two environments.
You will rewrite it almost from scratch, apart from possibly data structures.
What did it do? [import]uid: 108660 topic_id: 24842 reply_id: 100775[/import]

It’s a fairly simple program. It downloaded a webpage from kitco.com containing the current gold spot. then i had to cut out all the unneeded information. then used that number to break down how much 10k, 14k, 18k, etc is worth per gram. can corona download pages and cut out unwanted text from it?

I was afraid I’d have to rewrite it :frowning: but that’s ok. [import]uid: 22559 topic_id: 24842 reply_id: 100861[/import]

i would say you cant port it two total different languages and by the way VB is only calling functions. [import]uid: 86417 topic_id: 24842 reply_id: 100873[/import]

app is possible but will have to recode no porting [import]uid: 7911 topic_id: 24842 reply_id: 100881[/import]

It depends how much you know about VB6 or programming in general. As an example, I had no clue about LUA when I started porting my game Wonder Witches from C#/XNA to Corona. It just took a few weekends.

In your case its mostly about web requests and parsing the results. Does kitco return JSON or XML, or is it just HTML? Try to find some standardized web service - avoid programming against HTML! LUA is really straight forward, and has many parsers available, and if you liked the simplicity of VB6 you will like LUA. :slight_smile:

Most of all, the community here is great, and people are always happy to help each other out!

Happy coding!

–wunderwuzzi [import]uid: 118947 topic_id: 24842 reply_id: 100887[/import]

Sounds like there isn’t much that is VB specific about your original code.

In Corona, you do a network request on the web page to retrieve the data as a string.

In that string, I have outlined the data I think you are looking for below:
…stuff

Live Spot Gold

Spot Market IS CLOSED
opens in 16 hrs. 42 mins.

Apr 13, 2012 17:15 NY Time

|
Bid/Ask |
1658.50 - |
…stuff

So you might take the string, and find the first occurrence of
Discard the portion of the string before that point

Then find the first occurrence of Bid/Ask |
Discard everything including that point

Then the first occurrence of >

After that, keep everything up to the first - character

[import]uid: 108660 topic_id: 24842 reply_id: 100933[/import]

The HTML was lost in that post

Ill try again:

<!-- LIVE SPOT GOLD -->

  

Live Spot Gold
  

  
<!--<div class="market_status"><span class="green"><font color="black" size="2" face="Verdana, Arial, Helvetica, sans-serif"><b>Spot Market IS CLOSED</b></font><br><font size="1" face="Verdana, Arial, Helvetica, sans-serif"> opens in 16 hrs. 42 mins.</font></span></div>-->  

<font color="black" size="2" face="Verdana, Arial, Helvetica, sans-serif"><b>Spot Market IS CLOSED</b></font>  
<font size="1" face="Verdana, Arial, Helvetica, sans-serif"> opens in 16 hrs. 42 mins.</font>
  

Apr 13, 2012 17:15 NY Time
  

  
|  
 Bid/Ask |  
 1658.50 - |  

[import]uid: 108660 topic_id: 24842 reply_id: 100934[/import]