en en en en en en en en en en en en en en en en en en en en en en en en en en en en en en en en en en en en en en en en en en en en en en en en en en en nl en en en en en en en de en en en en en nl en en en en en en en en fr en da en en en en en en en nl en en en en en en en en en en en en nl en en en en en en mwl en en en mwl en en en en en en en en en en en es en en en en de en en en fr en en en en en en en en en pt en en en en en en
By logging into your account, you agree to our Privacy Policy, personal data processing and storage practices as described therein.
Forgot password or user name?
Search in titles only Search in PowerBASIC for Windows only
You are not logged in. You can browse in the PowerBASIC Community, but you must click Login (top right) before you can post. If this is your first visit, check out the FAQ or Sign Up.
All Time Today Last Week Last Month
All Discussions only Photos only Videos only Links only Polls only Events only
Join Date: Jul 2006
22 Jan 2008, 02:28 PM
I've been using PB/CC for several months now, have written a couple of (simple) utilities for use at work and really like the product. However, I'm also looking at converting several of my programs to Windows and am wondering if the code itself - I realize I go from procedural to event/object in the conversion - will be pretty much 'cut and paste' or if I'll have to do more than minimal rewriting.
From comparing the two environments I see the delta in terms of functions and functionality ... and my guess is that the code will transfer pretty much 'as is' during the conversion - again, realizing I'm going to an event-based environment - but would like to hear from y'all to be sure.
Join Date: Aug 1998
22 Jan 2008, 02:52 PM
All your user interface code will have to be re-written from scratch .. there are no "equivalent" functions in PB/Windows for LOCATE, PRINT, LINE INPUT, INSTAT, etc.
All your non-UI code, however, is identical.
Hopefully you have not just bundled all your UI and non-UI code together.
Port Washington WI USA
Join Date: Jul 2006
23 Jan 2008, 09:29 AM
Thanks, Michael. No, I've kept everything separate ... and don't mind rewriting the UI stuff - which I expected to have to do - but didn't want to have to rewrite all the algorithms, etc.
Have a good day!
Join Date: Feb 1999
23 Jan 2008, 10:47 AM
Most, if not all non-UI code can be reused when porting from PBCC to PBWin.
The thing to do, is start moving non-UI code into a separate include file, of which can be used later in your PBWin app. Document the routines well (ie. comment explaining how to use the routine).
Remove all references to the UI in routines which are mostly non-UI code, but have a few UI references.
Say a routine does a calculation and then prints the value to the screen.
Move the calculation code into a separate routine and have the original routine call it for the calculation and then print the results. Now the calculation routine can be moved to the include file for non-UI routines.
By rewriting the existing PBCC app, so only UI code is in the main BAS file and nearly all of the non-UI code is in a separate library (include), you will be able to test all your non-UI code routines to make sure they work as intended. Now you are ready to port the app to PBWin. Now you create the UI (now GUI) from scratch and then use the non-UI library code as needed.
SUB CalcSomething(BYVAL A&, BYVAL B&) LOCAL C&, I& C&=0 FOR I&=1 TO A& C&=C&+(B&^3) NEXT I& PRINT STR$(C&) END SUB
' put this kind of routine on non-UI library code FUNCTION CalcLoop3(BYVAL A&, BYVAL B&) AS LONG LOCAL C&, I& C&=0 FOR I&=1 TO A& C&=C&+(B&^3) NEXT I& FUNCTION=C& END FUNCTION ' SUB CalcSomething(BYVAL A&, BYVAL B&) PRINT STR$(CalcLoop3(A&,B&)) END SUB
Last edited by Chris Boss; 23 Jan 2008, 10:49 AM.
Copyright © 1998-2022 PowerBASIC Tools, LLC - All Rights Reserved.
Powered by vBulletin® Version 5.7.0
Copyright © 2022 vBulletin Solutions, Inc. All rights reserved.
All times are GMT-5. This page was generated at 05:31 AM.
We process personal data about users of our site, through the use of cookies and other technologies, to deliver our services, and to analyze site activity. For additional details, refer to our Privacy Policy.
By clicking "I AGREE" below, you agree to our Privacy Policy and our personal data processing and cookie practices as described therein. You also acknowledge that this forum may be hosted outside your country and you consent to the collection, storage, and processing of your data in the country where this forum is hosted.