PlanetSquires Forums

Support Forums => Other Software and Code => Topic started by: Exploration Gaming on September 09, 2010, 07:12:11 PM

Title: VB to FF
Post by: Exploration Gaming on September 09, 2010, 07:12:11 PM
Would anyone be interested in a VB to FF/PB conversion app? I am well on my way to creating something that will rebuild VB references to PowerBASIC/ FF Syntax. Are there many users out there converting from VB?

I created this because of the size of my project, but I could see this expanding to a nice FF tool.

Input

.Left = 3
MainForm.textbox.Left = 55
saveX = MainForm.textbox.Left
MainForm.textbox.Left = List1.ItemData(4)
List1.ItemData(33) = List1.ListIndex
Main(4).List1.ListIndex = 4
saveI = MainFrm.List1(x).ListIndex
List1.ItemData(List2.ListIndex) = List3.ListIndex
MsgBox List1.List(List3.ListIndex)


OutPut

FF_Control_SetLeft(HWND_, 3)
FF_Control_SetLeft(HWND_MAINFORM_TEXTBOX, 55)
saveX = FF_Control_GetLeft(HWND_MAINFORM_TEXTBOX)
FF_Control_SetLeft(HWND_MAINFORM_TEXTBOX, pb_Control_GetItemData(HWND_LIST1,(4)))
pb_Control_SetItemData(HWND_LIST1,(33), FF_Control_GetCurSel(HWND_LIST1))
FF_Control_SetCurSel(HWND_MAIN(4)_LIST1, 4)
saveI = FF_Control_GetCurSel(HWND_MAINFRM_LIST1(X))
pb_Control_SetItemData(HWND_LIST1, (FF_Control_GetCurSel(HWND_LIST2)), FF_Control_GetCurSel(HWND_LIST3))
MsgBox List1.List(FF_Control_GetCurSel(HWND_LIST3))


It uses multiple iterations, but its really quick. I am working on the Width block and general keyword references.. But overall I think this converter will save me a great deal of editing time.. And Form Arrays are probably a no no...

Also needed to make a pb_GetControlLeft() as a single pull from FF_GetControl_Pos() but once the wrappers are made, large VB projects could be moved to VB fairly smoothly..


BTW: I noticed when creating a control array.. If you make an array of 10 buttons, you can't click button(5) to build the BN_CLICKED() event. The editor forces you to click on button(0) else the sub routine is not created.. Was this done on purpose?

more to come..
Title: Re: VB to FF
Post by: Paul Squires on September 09, 2010, 08:25:15 PM
Hi Tye,

Not sure how popular such a tool would be. Could be a big hit or could be a lot of work for little reward. You should probably post a message over on the PB forum to gauge interest.

Quote
BTW: I noticed when creating a control array.. If you make an array of 10 buttons, you can't click button(5) to build the BN_CLICKED() event. The editor forces you to click on button(0) else the sub routine is not created.. Was this done on purpose?

That was not on purpose. I will have to fix that.

Title: Re: VB to FF
Post by: Rolf Brandt on September 10, 2010, 01:41:35 AM
Sounds interesting when I think of the amount of my VB projects!

Rolf
Title: Re: VB to FF
Post by: José Roca on September 10, 2010, 06:58:44 AM
Quote
You should probably post a message over on the PB forum to gauge interest.

There was a project two years ago. Then, silence...
See: http://www.powerbasic.com/support/pbforums/showthread.php?t=37585&highlight=converter
Title: Re: VB to FF
Post by: Rolf Brandt on September 10, 2010, 07:18:05 AM
I imagine it is pretty tedious work.
Title: Re: VB to FF
Post by: Exploration Gaming on September 15, 2010, 08:27:37 PM
The routine I have can catch a decent quality of edits to get your app in PB.. But as I continued to analyze the idea, I saw a way to make the code look more elegant..

No offense Paul, but the FF_ function convention always bothered me.. I would have preferred a SetProperty() function in which the function detected the class type.

I am considering designing something like this, but right now its not a priority. I need to simply move my project to FF.. I don't care if the code isn't cute.. I'm not buying it a drink & trying to get the digits.. ;)