Discussion:
Questions from a possible soon-to-be.
(too old to reply)
NadCixelsyd
2010-10-12 16:34:42 UTC
Permalink
Raw Message
Three days ago, I had never heard of PowerBasic (Hereinafter: PB).
I've been writing a VisualBasic_6 programs off-and-on for several
years. I have one 4000 line program that has one feature that scans
through a file looking for certain text. If the file is small, it's
trivial. For a large file, it takes about 12 seconds to scan through
400k records of a 30mb file. Someone suggested PB would greatly solve
that problem. Actually, his comments were more like, "You absolutely
MUST consider PB."

Even though the code is almost 4000 lines, I would consider converting
everything to PB if I could substantially reduce 12 seconds. My
primary question is: How difficult is the conversion? Where can I
find the source differences between VB6 and PB. The PB website talks
of 95% compatibility, but that's kind of vague. What ARE the
differences? How difficult is it to convert from VisualBasic_6 to PB
for Windows?

One thing I noticed: With VB6, I use "OPTION EXPLICIT" and "DEFtype"
everywhere. Unfortunately, PB ignores DEFtype, if "OPTION EXPLICIT"
is specified. With PB, I would have to go back and modify all my DIM
statements to include type. This is the kind of logic differences I'm
trying to discover. Surely, someone must have documented them, but I
can't find them anywhere online.

I also have scores of old QuickBasic programs that I have been slowly
converting to VB6. Should I convert these to PB_Console, or can I
easily convert them to PB_Windows?

Lastly, older versions of PB sell for far less that the current
versions. I'm considering buying the older versions to see if they
meet my needs and then upgrading if they do meet my needs. How recent
is PB_Windows version 9? VB6 is 10 years old. Would PB_Windows
version 8 be a good place to start?
Auric__
2010-10-13 16:02:30 UTC
Permalink
Raw Message
Post by NadCixelsyd
Three days ago, I had never heard of PowerBasic (Hereinafter: PB).
I've been writing a VisualBasic_6 programs off-and-on for several
years. I have one 4000 line program that has one feature that scans
through a file looking for certain text. If the file is small, it's
trivial. For a large file, it takes about 12 seconds to scan through
400k records of a 30mb file. Someone suggested PB would greatly solve
that problem. Actually, his comments were more like, "You absolutely
MUST consider PB."
Even though the code is almost 4000 lines, I would consider converting
everything to PB if I could substantially reduce 12 seconds. My
primary question is: How difficult is the conversion? Where can I
find the source differences between VB6 and PB. The PB website talks
of 95% compatibility, but that's kind of vague. What ARE the
differences? How difficult is it to convert from VisualBasic_6 to PB
for Windows?
It's not difficult, but there are a lot of gotchas. A *lot*. Certainly more
than I'm willing to detail in a single message.

Rosetta Code would be a good place to see some differences, using actual
code:
http://rosettacode.org/wiki/Category:PowerBASIC

There doesn't appear to be a lot of PB examples there, but... some.
Post by NadCixelsyd
One thing I noticed: With VB6, I use "OPTION EXPLICIT" and "DEFtype"
everywhere. Unfortunately, PB ignores DEFtype, if "OPTION EXPLICIT"
is specified. With PB, I would have to go back and modify all my DIM
statements to include type. This is the kind of logic differences I'm
trying to discover. Surely, someone must have documented them, but I
can't find them anywhere online.
No surprise, really; that would be a lot of work. *I* wouldn't unless
someone paid me to do it.

For the most part, it's really just a matter of trying it. I ported
significant parts of one of my VB6 programs to PB/Win several years ago. It
took me... hmm... probably about a day to get everything working, and I was
*just* starting with PB at that point. (Of course, it's a fairly small
project, around 1900 lines; your program would almost certainly take
longer.)
Post by NadCixelsyd
I also have scores of old QuickBasic programs that I have been slowly
converting to VB6. Should I convert these to PB_Console, or can I
easily convert them to PB_Windows?
PB/CC is somewhat closer (and that's its main reason for existing, porting
DOS code to Windows), but if there's no graphical output (no drawing
stuff), it shouldn't be *too* hard to do it in PB/Win.
Post by NadCixelsyd
Lastly, older versions of PB sell for far less that the current
versions. I'm considering buying the older versions to see if they
meet my needs and then upgrading if they do meet my needs. How recent
is PB_Windows version 9? VB6 is 10 years old. Would PB_Windows
version 8 be a good place to start?
PB/Win 8 should be just fine for your needs. v9 has some nice things in it,
but for someone just starting, they're not really necessary.
--
Overheard in Hell:
At least I don't have to worry about going to Hell any more.
H-Man
2010-10-13 22:28:56 UTC
Permalink
Raw Message
Post by NadCixelsyd
Three days ago, I had never heard of PowerBasic (Hereinafter: PB).
I've been writing a VisualBasic_6 programs off-and-on for several
years. I have one 4000 line program that has one feature that scans
through a file looking for certain text. If the file is small, it's
trivial. For a large file, it takes about 12 seconds to scan through
400k records of a 30mb file. Someone suggested PB would greatly solve
that problem. Actually, his comments were more like, "You absolutely
MUST consider PB."
Even though the code is almost 4000 lines, I would consider converting
everything to PB if I could substantially reduce 12 seconds. My
primary question is: How difficult is the conversion? Where can I
find the source differences between VB6 and PB. The PB website talks
of 95% compatibility, but that's kind of vague. What ARE the
differences? How difficult is it to convert from VisualBasic_6 to PB
for Windows?
One thing I noticed: With VB6, I use "OPTION EXPLICIT" and "DEFtype"
everywhere. Unfortunately, PB ignores DEFtype, if "OPTION EXPLICIT"
is specified. With PB, I would have to go back and modify all my DIM
statements to include type. This is the kind of logic differences I'm
trying to discover. Surely, someone must have documented them, but I
can't find them anywhere online.
I also have scores of old QuickBasic programs that I have been slowly
converting to VB6. Should I convert these to PB_Console, or can I
easily convert them to PB_Windows?
Lastly, older versions of PB sell for far less that the current
versions. I'm considering buying the older versions to see if they
meet my needs and then upgrading if they do meet my needs. How recent
is PB_Windows version 9? VB6 is 10 years old. Would PB_Windows
version 8 be a good place to start?
Another option may be to just port the search code to PB and call it as a
.DLL. Not ideal, but often time sensitive code can be ported this way. I
usually prefer PureBasic, the other PB, but PowerBasic does AFAIK, handle
strings very well. In PureBasic, you'd be best off using direct memory
access instead of string functions. It's faster, but it can get kinda
complicated.

If you started with just porting the time consuming code, you'd get a start
to porting the works once you got comfortable. In steps like this things
can become much more manageable.

BTW, for clarity, I don't actually own a copy of PowerBasic, but I do
follow the product. AFAIK, PowerBasic is a mature, high quality product.
--
HK
Tony Toews
2010-10-14 20:23:58 UTC
Permalink
Raw Message
On Tue, 12 Oct 2010 09:34:42 -0700 (PDT), NadCixelsyd
Post by NadCixelsyd
Three days ago, I had never heard of PowerBasic (Hereinafter: PB).
I've been writing a VisualBasic_6 programs off-and-on for several
years. I have one 4000 line program that has one feature that scans
through a file looking for certain text. If the file is small, it's
trivial. For a large file, it takes about 12 seconds to scan through
400k records of a 30mb file.
How long does it take to copy that 30 Mb file using Windows Explorer?
From another hard drive to that hard drive. Don't use the same hard
drive. That's the theoretical fastest possible time.

If that time is eight seconds then your scanning and overhead is
adding four seconds. So it is worth it?

OTOH if that time is two seconds then the scanning/overhead time is
ten seconds so it might be worth while trying to spead that up.

Tony
--
Tony Toews, Microsoft Access MVP
Tony's Main MS Access pages - http://www.granite.ab.ca/accsmstr.htm
Tony's Microsoft Access Blog - http://msmvps.com/blogs/access/
For a convenient utility to keep your users FEs and other files
updated see http://www.autofeupdater.com/
software.engineer
2010-10-16 14:02:21 UTC
Permalink
Raw Message
I have converted many projects to RealBasic. RealBasic provides a path
and utilities to convert VB6 to RB. I own PowerBasic, RealBasic,
PureBasic and KBasic.

Both RealBasic and PureBasic provide:
Demos,
Forum member who can help answer your conversion questions.

I suggest you get a demo of either and ask forum members to help you
write a critical time test.

While I like PowerBasic, the other versions of basic have a bigger
user base, 64bit support and are growing - while PowerBasic seems to
be dying.

If you convert all that code and 64bit processors become standard,
PowerBasic will leave you with another rewrite.

Ask people at the RealBasic and PureBasic forms for a way to demo and
speed test your longest routines and see if you get good results.

RealBasic would be your fastest rewrite.
PureBasic costs so little, I got it and really don't do much with it,
but am still glad I did.

Eric
H-Man
2010-10-18 15:34:42 UTC
Permalink
Raw Message
Post by software.engineer
I have converted many projects to RealBasic. RealBasic provides a path
and utilities to convert VB6 to RB. I own PowerBasic, RealBasic,
PureBasic and KBasic.
Demos,
Forum member who can help answer your conversion questions.
I suggest you get a demo of either and ask forum members to help you
write a critical time test.
While I like PowerBasic, the other versions of basic have a bigger
user base, 64bit support and are growing - while PowerBasic seems to
be dying.
If you convert all that code and 64bit processors become standard,
PowerBasic will leave you with another rewrite.
Ask people at the RealBasic and PureBasic forms for a way to demo and
speed test your longest routines and see if you get good results.
RealBasic would be your fastest rewrite.
PureBasic costs so little, I got it and really don't do much with it,
but am still glad I did.
Eric
I personally found RealBasic really slow. Rather applications created by
RealBasic were really slow. I was using RealBasic 5.5 Standard at the time
so maybe things have improved some since then.
--
HK
Auric__
2010-10-18 16:31:41 UTC
Permalink
Raw Message
Post by H-Man
Post by software.engineer
I have converted many projects to RealBasic. RealBasic provides a path
and utilities to convert VB6 to RB. I own PowerBasic, RealBasic,
PureBasic and KBasic.
Demos,
Forum member who can help answer your conversion questions.
I suggest you get a demo of either and ask forum members to help you
write a critical time test.
While I like PowerBasic, the other versions of basic have a bigger
user base, 64bit support and are growing - while PowerBasic seems to
be dying.
If you convert all that code and 64bit processors become standard,
PowerBasic will leave you with another rewrite.
Ask people at the RealBasic and PureBasic forms for a way to demo and
speed test your longest routines and see if you get good results.
RealBasic would be your fastest rewrite.
PureBasic costs so little, I got it and really don't do much with it,
but am still glad I did.
Eric
I personally found RealBasic really slow. Rather applications created by
RealBasic were really slow. I was using RealBasic 5.5 Standard at the time
so maybe things have improved some since then.
I rather like RB. It was my prefered cross-platform BASIC until I found
FreeBASIC. I still have one non-trivial project written in RB 5.5.5.

But yeah, it can be slow sometimes.
--
Fear makes companions of us all.
Karl E. Peterson
2010-10-18 22:00:56 UTC
Permalink
Raw Message
Post by NadCixelsyd
Three days ago, I had never heard of PowerBasic (Hereinafter: PB).
I've been writing a VisualBasic_6 programs off-and-on for several
years. I have one 4000 line program that has one feature that scans
through a file looking for certain text. If the file is small, it's
trivial. For a large file, it takes about 12 seconds to scan through
400k records of a 30mb file. Someone suggested PB would greatly solve
that problem. Actually, his comments were more like, "You absolutely
MUST consider PB."
Even though the code is almost 4000 lines, I would consider converting
everything to PB if I could substantially reduce 12 seconds.
Have you actually considered trying to optimize the code in VB first?
I find it astounding that *any* search of 30MB of text could take 12
seconds. Even on an old 80386 running Windows 95. Well, okay, maybe
on one of those, if it only had 16MB of RAM, but I digress. Surely
you're running on systems that can slurp up 30MB of data in a moment,
no? If these are fixed-width records, I can envision an algorithm (if
you can even call it that) which would pinpoint hits almost
instantaneously. And it'd only be a few dozen lines of code. (You're
aware of Instr, right?)

Not trying to talk you out of considering PowerBASIC, not at all! It's
a great langauge, and definitely one any BASIC programmer should be
aware of. But this seems like taking a sledgehammer to an ant, given
the information you've offered.
--
.NET: It's About Trust!
http://vfred.mvps.org
hutch--
2010-12-06 03:30:30 UTC
Permalink
Raw Message
NadCixelsyd,

I have used PBCC since it was introduced years ago and it is a good
tool if you know your way around it. Its like anything else, the more
you know about it the better results you get and with old DOS code its
usually faster to simply rewrite it than port it. The PBCC classic
version is very cheap last I heard so you probably won't go bust
buying it. Too much to describe here but its capable of producing very
fast code if you know how to write it and it has an excellent inline
assembler if you know what you are doing there. The later version has
larger capacity and some additional runtime library functions but as
an introduction the classic PBCC compiler will keep you out of trouble
for a long time to come.

hutch.
Robert Wolfe
2011-11-05 03:51:02 UTC
Permalink
Raw Message
Post by hutch--
NadCixelsyd,
I have used PBCC since it was introduced years ago and it is a good
tool if you know your way around it. Its like anything else, the more
you know about it the better results you get and with old DOS code its
usually faster to simply rewrite it than port it. The PBCC classic
version is very cheap last I heard so you probably won't go bust
buying it. Too much to describe here but its capable of producing very
fast code if you know how to write it and it has an excellent inline
assembler if you know what you are doing there. The later version has
larger capacity and some additional runtime library functions but as
an introduction the classic PBCC compiler will keep you out of trouble
for a long time to come.
hutch.
Admittedly, I bought a license to the current 6.x version after trying a
copy of the 5.x version I grabbed a while back. So far, I love it! I
am currently rewriting our office supply database at work (currently a
hacked together Oracle-Access 2007 job) in PBCC 6 and from what I have
released so far, those that use the application like it far better than
the sticky point-and-clickiness of the old hackjob :)
John H. Guillory
2012-04-10 01:41:17 UTC
Permalink
Raw Message
Post by Robert Wolfe
Admittedly, I bought a license to the current 6.x version after trying a
copy of the 5.x version I grabbed a while back. So far, I love it! I
am currently rewriting our office supply database at work (currently a
hacked together Oracle-Access 2007 job) in PBCC 6 and from what I have
released so far, those that use the application like it far better than
the sticky point-and-clickiness of the old hackjob :)
Get PowerSync SQL Tools 3.0 and possibly PowerBasic 10.0. I have PBCC
5.0 and PB 8.0-10.0 with SQLTools 2.0 and 3.0. With SQL Tools 3.0 and
PB 10, you can have all the database libraries builtin to the EXE
files with no external files except the database itself. Use any
database software the client has on their computer!

Loading...