PowerBASIC Forums
  PowerBASIC for Windows
  Tutorial (Page 1)

Post New Topic  Post A Reply
profile | register | preferences | faq | search

UBBFriend: Email This Page to Someone!
This topic is 2 pages long:   1  2 
next newest topic | next oldest topic
Author Topic:   Tutorial
Steve. T
Member
posted June 30, 2004 05:26 AM     Click Here to See the Profile for Steve. T     Edit/Delete Message   Reply w/Quote
Does anybody know of any quite basic tutorials for PB/Win ?

I used to use PB/DOS some time ago and got into it in a big way; I felt very competent at using it.

Looking at the newer Windows version, I'm almost completely stumped at where to start.

In my DOS stuff, I generally did it like so:

1. Set global variables.
2. Create screen with initial menu/display.
3. Jump straight to a menu handler.
4. This in turn jumped to a 'sub' depending on which menu option had been selected.
5. Clean up and exit.

I just can't seem to relate this to the Windows version in quite the same way.

Any pointers would be much appreciated!!

------------------

IP: Logged

Bob Zale
Administrator
posted June 30, 2004 06:54 AM     Click Here to See the Profile for Bob Zale     Edit/Delete Message   Reply w/Quote
Steve--

Forum rules require your full name, no handles, nicknames, abbreviations. Please re-register before you post again? Thanks!

Bob Zale
PowerBASIC Inc.

------------------

IP: Logged

Steve Thomas
Member
posted June 30, 2004 07:19 AM     Click Here to See the Profile for Steve Thomas     Edit/Delete Message   Reply w/Quote
Ok, done, re-registered!

Now, can anybody help, please ?

------------------

IP: Logged

Michael Mattias
Member
posted June 30, 2004 07:32 AM     Click Here to See the Profile for Michael Mattias     Edit/Delete Message   Reply w/Quote
First thing you have to do is change your mindset.

You have to write procedures which RE-act, not PRO-act.

In its absolute simplest form, your programs will now look like:

FUNCTION WinMain (...)

any initialization code goes here

CreateDialog ' specify dialog proc here if SDK style
Display Dialog ' specify dialoc proc here if DDT style

(optional) message loop ' only needed if modeless

any termination code goes here

END FUNCTION

FUNCTION DialogCallbackProcedure ...

SELECT CASE message
CASE whatever
do something
CASE baddabing
do something else
...
END SELECT
END FUNCTION

Beaucoup examples of dialogs in help file and here.

There, that wasn't so bad now, was it?

MCM

IP: Logged

Paul Dwyer
Member
posted June 30, 2004 08:30 AM     Click Here to See the Profile for Paul Dwyer     Edit/Delete Message   Reply w/Quote
Steve,

Brad's been getting a few together here
http://sweetheartgames.com/PBTools/JumpStart.html

------------------
Paul Dwyer
Network Engineer
Aussie in Tokyo

IP: Logged

Pedro Ramirez
Member
posted June 30, 2004 08:49 AM     Click Here to See the Profile for Pedro Ramirez     Edit/Delete Message   Reply w/Quote
This is going to be tough.
The learning curve to windows programing is rather steep but it pays off.

I was in the same situation as you and after going through many
readings, forum post, etc. that made no sense at all I found out
the two ebooks that guided me and made the transition from DOS to Windows
comprehensible.

You must start by readind Hutch's help file. You can get it here: http://www.powerbasic.com/support/forums/Forum10/HTML/000006.html

After that don´t fool around and get a copy of Petzold´s Windows Programming.

On the side and as reference get the Win32 Helpfile which you can download at http://www.powerbasic.com/files/pub/mstools

For up-to-date info on the windows API go to this address: http://msdn.microsoft.com/library/default.asp?url=/li brary/en-us/shellcc/platform/commctls/listview/listview_overview.asp
From there you can search any function.


Be prepare for weeks of studying and learning.

------------------
DO NOT ENGAGE IN READING CODE SAMPLES. IT WON´T HELP.
YOU *MUST* UNDERSTAND THE WINDOWS API FIRST!!!!!

[This message has been edited by Pedro Ramirez (edited June 30, 2004).]

IP: Logged

Steve Thomas
Member
posted June 30, 2004 09:07 AM     Click Here to See the Profile for Steve Thomas     Edit/Delete Message   Reply w/Quote
Thanks guys, I'll take a look at some of these!

------------------

IP: Logged

Tonny Bjorn
Member
posted June 30, 2004 09:16 AM     Click Here to See the Profile for Tonny Bjorn     Edit/Delete Message   Reply w/Quote
Hi Steve,

I would like to mention Borje's POFFS: http://www.tolkenxp.com/pb/

Best regards

Tonny

[This message has been edited by Tonny Bjorn (edited June 30, 2004).]

IP: Logged

Roger Rines
Member
posted June 30, 2004 10:04 AM     Click Here to See the Profile for Roger Rines     Edit/Delete Message   Reply w/Quote
Steve,
A few years back I was in the same situation that you describe. To make the
transition, I began working exclusively with the CONSOLE compiler creating
DOS-style screen applications. Many of the applications I have been writing
in Power BASIC are tools and programs originally developed in Turbo Pascal,
Quick C and in Quick Basic 3 to PDS 7.1. All during the 90s I wrote some
stuff in all the various versions of Visual Basic up to VB-6, but never
liked how difficult it was to distribute the VB applications. They also ran
slower than the programs they replaced so something else was needed. It was
that dissatisfaction with the DOS limitations and the size and clutter that
goes along with a VB application that drove me to Power BASIC about three+
years ago.

Getting started with Power Basic was made easy for me because I had the
CONSOLE compiler. That approach gave me the leg-over I needed to make the
transition from an interpreter development environment like Microsoft’s
Basics, to a plain editor style of developing where you compile to see if it
works. While all the tools that were converted and compiled with the
CONSOLE compiler are still running here, I found I wanted the interface
options available from the GUI that Windows enables. DDT and Power Forms
seemed like a good alternative, but the lack of tutorials to get started had
me floundering around digging for information so much that my conversion
progress came to a stop. For me, the time expense of learning the hard way
was too costly because time is really money in my business. The more time I
wasted, the more lost opportunity accumulated and that needed to end.

If the DOS-Style screens are workable for what you want, then the CONSOLE
compiler is a great solution that provides many of the benefits of Windows
without a significant learning curve. However, if the GUI is the attraction
then consider the EZGUI product by Chris Boss. EZGUI was the decision I
made last November and I’m so glad I went that way that I can’t express it
enough. Ironically, I’ve learned more about SDK programming since working
with EZGUI than I did in the two-years prior.

On the surface many people think EZGUI is just a designer or another version
of DDT. That limited perspective doesn’t come close to the understanding
that EZGUI is an environment where a significant amount to the learning
curve for creating Window GUI style applications can be avoided. In my
personal opinion, EZGUI and Power BASIC together are everything Visual Basic
should have been all along.

From a productivity perspective, I’ve converted more tools and created more
programs in the last 8-months with EZGUI than I accomplished in the previous
two years building DOS-style applications. In addition, the size and
elegance of the applications being produced is by far better than anything
else I’ve accomplished. More importantly, they run without crashing because
EZGUI has made it so simple that I can think and see more about is needed
now that I’m not trying to create a slew of SDK lines just to do something
simple.

With all that said, if you need tutorials to get started, the road is going
to be rough because transitional documentation is Power BASIC’s biggest
weakness. However, if you are willing to learn from examples that you
research each line of code to understand, then this PB_Forum, and Borje
Hagsten’s POFFS Database of this forum is a great place to start. If you
need to be seriously productive within the next couple of years, then get
involved with EZGUI and explore the EZGUI forum. Both this PB_Forum and the
EZGUI_Forum are two of the most helpful places I have found for solving
development programs. More importantly, the people on these forums really
do apply an honest effort to help you get past the problem you’re working if
you are patient and clear in what you ask.

Here are some links:
Borje Hagsten’s POFFS Database
EZGUI
EZGUI’s Forum

Good Luck, and Welcome to PB.

------------------
Roger...
(Mail to rdrines at SpamCop dot Net)

IP: Logged

Brad D Byrne
Member
posted June 30, 2004 10:27 AM     Click Here to See the Profile for Brad D Byrne     Edit/Delete Message   Reply w/Quote
Steve,

hehe, don't let Roger's "two year" comment mis-lead you..

while EZGUI is pretty good.. and may be a dirrection you may wish
to go... I would for a couple days, first just go thru the examples.. the forum posts has gotten quite a bit more attention for
new-comers over the last year...
the biggest obstacle will be in changing your mind set about how
you program... windows is "Event Driven"
there are a few quick examples that will help on the jumpStart page..
then see Borje's examples, and PB's examples that are shipped
with PB... that should give you a good idea.. then.. if you feel
that the messaging structure/s are still to difficult to manage
right now.. Chris has done a great job wrapping them with EZGUI..
but it definately should not be as difficult a road now, as many
of us had a few years ago.. because the forums have gotten so much
better for new-comers..

Brad

------------------
Washington DC Area
Borje's "Poff's" is likely the BEST tool for learning PB.. http://www.tolkenxp.com/pb
And a few PBTool's & Beginner Help:http://sweetheartgames.com/PBTools/JumpStart.html

[This message has been edited by Brad D Byrne (edited June 30, 2004).]

IP: Logged

Brad D Byrne
Member
posted June 30, 2004 10:43 AM     Click Here to See the Profile for Brad D Byrne     Edit/Delete Message   Reply w/Quote
Pedro write's:

'...DO NOT ENGAGE IN READING CODE SAMPLES. IT WON´T HELP.
YOU *MUST* UNDERSTAND THE WINDOWS API FIRST!!!!!..."

well, I think that's true... once you get going..
complex examples will definately confuse.. until you get a grasp
of how the api works... but, IMO you can do that a couple different ways... you can read Petzoid from cover to cover..
Rector & New-comer... etc.. (which will take a lot of dedication) ..
especially since they are written for C...
or, like I did... quickly skim the books for termonology, not really trying to understand, then get some very basic examples..
experiment with them... move things around and see what works..
then go back to the books.. and read a little closer.. because
now you will understand a little more and be able to make your own
tests along with the books... and it will start to come together..
Pedro is correct in that you really do need the referance material also.. examples only.. will not help much..

also ask lots of questions.. for not only will they help you..
they will help other new-comers and also any writers, trying to
document what new-comers are confused about..


Brad

------------------
Washington DC Area
Borje's "Poff's" is likely the BEST tool for learning PB.. http://www.tolkenxp.com/pb
And a few PBTool's & Beginner Help:http://sweetheartgames.com/PBTools/JumpStart.html

IP: Logged

Steve Thomas
Member
posted June 30, 2004 11:35 AM     Click Here to See the Profile for Steve Thomas     Edit/Delete Message   Reply w/Quote
Thanks again guys for all the info here. Its really going to help, in fact it has already started to help.

Mind you, I reckon I found the most important thing I'm likely to come across, ever :

#BLOAT Microsoft_Size

-or-

#BLOAT My_First_App_Was_17K

------------------

IP: Logged

Joe Byrne
Member
posted June 30, 2004 11:07 PM     Click Here to See the Profile for Joe Byrne     Edit/Delete Message   Reply w/Quote
Steve,

Unlike Brad, I own and use EZGUI and have done things both ways. I can tell you without a doubt, the fastest way to learn Windows programming is with PBWin and EZGUI, period. Since that fact can only be stated from one who has done things both ways, I'm willing to bet you won't find a single EZGUI customer who will disagree.

I was in the same place as you a few years back. I did a lot of DOS programming but just couldn't get my mind around the "Windows ways". I looked at all the stuff in the forum (I've been part of this forum since its days on CompuServe and PBs own BBS). There are excellent examples here and un-arguable the finest group of programmers you'd want to meet, but that alone does not always make the jump from DOS to Windows easy or doable.

Many people here have used other Windows Compilers (C, C++, and Visual Basic). I had never touch a Windows compiler prior to PB's first Win product. After many months, (14-16?) I still was not able to produce the kind and quality of application I wanted. Then Chris humbly told me about his EZGUI program. I bought it, spent less than 2 weeks playing with it, and wrote my first full-fledged Windows application. That program has sold over 100 copies (not bad since it is only sold by direct sales, not Internet). But after I wrote the initial app the lightbulbs really began to go off. Suddenly I wanted to add some features that EZGUI didn't have "built-in". So, with Chris's help, he showed me how to incorporate the Win API into my EZGUI program and a whole new world opened up. Because I was able to "see" how the function actually worked in MY program, I was able to better understand the whole Windows 'thing'. I wasn't able to see that before EZGUI entered the picture.

Now with version 3, I can say that my apps are bigger, faster, more feature rich, and much more polished than ever before, and I'm proud to say that I don't have to include the bloated WinAPI file in any of my programs. Chris has done an absolutely marvelous job at creating a very small DLL engine that gives me all the tools I need. Much like PB programmers like to challenge C programmers to see who can do something easier, faster, and/or smaller, I've seen how much code people use to do "simple" things like using listviews controls, tab controls, and the mystical 'sub-classing'. Its amazing how many lines of code it takes with "traditional" PB style when I only need 1 or 2.

I don't know what your needs are professionally, but I can tell you from experience, if you need or want to leverage your DOS skills and jump into the World of Windows, the investment in EZGUI will be well worth the money. Chris's support is second to none also. He has taught me more about how Windows actually works that I have ever learned elsewhere. Truly, the combination of Chris's EZGUI and support with PB and this forum is clearly the best way to get into Windows application development. Hands-down.

------------------
Joe Byrne
PBStuff@ByrneWorld.com

IP: Logged

Russ Srole
Member
posted June 30, 2004 11:26 PM     Click Here to See the Profile for Russ Srole     Edit/Delete Message   Reply w/Quote
Steve,

I second & third all that Roger & Joe have written. If your goal is to be a windows guru then you should drink deep in the api cup. However, if you're like me, and have to make a living and get things done then Ezgui is the way to go. You will be able to make your apps much more polished in a lot less time then you think. At one piont Chris had some screen shots on his web site, I don't see them there anymore, but I'd bet he would email them if you asked. If you want to post your email address, I'll email some screen snaps of mine.

Russ

------------------

IP: Logged

Elias Montoya
Member
posted July 01, 2004 07:27 PM     Click Here to See the Profile for Elias Montoya     Edit/Delete Message   Reply w/Quote

Hello Steve, First off, let me tell you that you have fallen
in the hands of VERY GOOD tutors, just dont be afraid of windows
and you will know a lot in no time.

The sintax of Power basic lets you focus on Windows stuff, if you
come from PB DOS version, then it will be easier. You will thne
just have to "Mess" some sample programs and see how they work by
taking out its "guts". Its very easy actually

I dont consider my self one of the geniuses here, but if i can
help you with something, ill be glad to.

Elias

------------------
Last night i was decided to retreat, Then i decided not to.

Do you need a grid In your App?.... Try the Egrid32 Demo:
EGRID32 DEMO DOWNLOAD
PRO Version Released!
Egrid32's Page

IP: Logged


This topic is 2 pages long:   1  2 

All times are EasternTime (US)

next newest topic | next oldest topic

Administrative Options: Close Topic | Archive/Move | Delete Topic
Post New Topic  Post A Reply
Hop to:

Contact Us | PowerBASIC BASIC Compilers

Copyright © 1999-2007 PowerBASIC, Inc. All Rights Reserved.


Ultimate Bulletin Board 5.45c