Page 3 of 3
Why doesn't this work
Posted: Fri Jun 12, 2009 1:28 am
by Hot Pockets
NetMaestro
Thank you for those encouraging words. My brief stay in the realm of PB
was well worth it just to meet such a nice and pleasant person as you!
I think I'm going to try free basic. I looked at their code reference and it seems(operative word) that it is very similar to Basic PDS 7.11. Again, thanks for your kindness!!

Re: Why won't it run?
Posted: Fri Jun 12, 2009 7:09 am
by John Puccio
Hot Pockets wrote:My sincere apology to Mr Gaman. I overlooked the fact that My program lost its indentation because I saved it as Text. If I would of known how great Tags were I would of used them,(Great idea!)
Trend:
Thanks for setting me straight. I have already downloaded that book and printed all 350 Pages. Now I gusess it will end up in the dumper along with the money I spent buying PB.I don't think I'll ever be able to learn
PB. It is far more complicated from my point of view then Dark Basic or
Blitz Basic or Visual Basic 4. The only thing I almost learned that had almost as many constants was Ibasic. Again I am not really a programer. I wrote 1 very large Check register program in MS Basic7.11 That works well for me and I've been trying to re=write it for windows. Hah!! I doubt I'll ever suceed I am 80 years old, you never know tho, my health is good. Thanks for all your help!!

No don't give up, it's really not that hard to learn. I never stress over learning a new language. I just roll up my sleves and get my hands dirty. It all makes sense after a while. Did you fix your program? Is this what you were trying to do?
Code: Select all
Declare MainMenu(Width, Height)
LoadImage(0, "C:\test.bmp")
OpenWindow(0, 0, 0, ImageWidth(0), ImageHeight(0), "Command", #PB_Window_BorderLess | #PB_Window_ScreenCentered | #PB_Window_SystemMenu)
ImageGadget(0, 0, 0, 0, 0, ImageID(0))
Delay(2000)
CloseWindow(0)
MainMenu(ImageWidth(0), ImageHeight(0))
Procedure MainMenu(Width, Height)
OpenWindow(1, 0, 0, Width, Height, "Command", #PB_Window_ScreenCentered | #PB_Window_SystemMenu)
If CreateMenu(1, WindowID(1))
MenuTitle("File")
MenuItem( 1, "&Load...")
MenuItem( 2, "Save")
MenuItem( 3, "Save As...")
MenuBar()
OpenSubMenu("Recents")
MenuItem( 5, "Pure.png")
MenuItem( 6, "Basic.jpg")
OpenSubMenu("Even more !")
MenuItem( 12, "Yeah")
CloseSubMenu()
MenuItem( 13, "Rocks.tga")
CloseSubMenu()
MenuBar()
MenuItem( 7, "&Quit")
MenuTitle("Edition")
MenuItem( 8, "Cut")
MenuItem( 9, "Copy")
MenuItem(10, "Paste")
MenuTitle("?")
MenuItem(11, "About")
EndIf
DisableMenuItem(1, 3, 1)
DisableMenuItem(1, 13, 1)
; This is the 'event loop'. All the user actions are processed here.
Repeat
Select WaitWindowEvent()
Case #PB_Event_Menu
Select EventMenu() ; To see which menu has been selected
Case 11 ; About
MessageRequester("About", "Cool Menu example", 0)
Default
MessageRequester("Info", "MenuItem: "+Str(EventMenu()), 0)
EndSelect
Case #PB_Event_CloseWindow
Break
EndSelect
ForEver
EndProcedure
Posted: Fri Jun 12, 2009 10:59 am
by srod
Blitz Basic or Visual Basic 4. The only thing I almost learned that had almost as many constants was Ibasic...
Uhm, you looked at VB lately? You do seem to flit between a lot of basic's and, well, appear happy with none of them! What is it you are after exactly?
As for Freebasic; I find that creating applications is far slower with this development tool than with Purebasic. It simply doesn't have the wealth of user-libraries that we have here which make application prototyping so easy and fast.
But, well, when all is said and done, it is 'horses for courses'. The only thing I can suggest is that you perhaps be a little more patient and do not expect to become a master within a matter of weeks. My complete idiocy (and lunacy) was honed over many years and I learn something new every day!

Posted: Fri Jun 12, 2009 12:23 pm
by Trond
It is far more complicated from my point of view then Dark Basic or
Blitz Basic or Visual Basic 4.
Most people that find PB difficult find it difficult because they assume it works like other products. In reality, PB is one of the simplest basics when it comes to the number of concepts you have learn. There's about two things to it:
1. Each line runs in succession, one after the other. They don't run at the same time or continue with the next line before the current line is done.
2. Except for loops, the lines inside a loop may run several times, but each line runs in succession.
3. Except for Procedures, which run when they are Called(). The program runs the procedure until it ends, then continues to run the program from after the procedure was called.
Stop thinking complicated.
Posted: Fri Jun 12, 2009 1:30 pm
by Kaeru Gaman
Trond wrote:1.
2.
3.
... and this is "the nature of procedural programming"
with VB, it's a completely different thing, because you associate codesnippets to objects and events.
Posted: Fri Jun 12, 2009 2:23 pm
by netmaestro
with VB, it's a completely different thing, because you associate codesnippets to objects and events
Only because that's the way it's presented in the Visual Studio IDE. You can easily do the same in PB by subclassing the controls and leaving your main loop simple. Then the code for every event is organized and located logically. I made a subclass tool for the PB IDE and using that it all gets set up automatically. I just have to add events to each skeleton as appropriate, if needed. This is exactly what happens when you use the VB IDE to click on a listed event and type in the code snippet for it. The thing to love about PureBasic is that it can be almost anything you want it to be.
Posted: Fri Jun 12, 2009 5:47 pm
by Kaeru Gaman
but you need to know how to do it.
natively you have to think completely the other way round than in VB.
Posted: Sun Jun 14, 2009 11:24 pm
by rrpl
I don't think I'll ever be able to learn
PB. It is far more complicated from my point of view then Dark Basic or
Blitz Basic or Visual Basic 4. The only thing I almost learned that had almost as many constants was Ibasic. Again I am not really a programer. I wrote 1 very large Check register program in MS Basic7.11 That works well for me and I've been trying to re=write it for windows. Hah!! I doubt I'll ever suceed I am 80 years old, you never know tho, my health is good. Thanks for all your help!!
I think I have got to weigh in here. The easiest way to learn PB I think is to start off with a few simple command line programs, then a basic window project (you can use examples in the PB Archive to start on, but rewrite them yourself). Then having learnt the way PB works I think you'll find it one of the easiest languages around.
I have tried numerous other languages including Dark Basic (good for gaming), VB, free basic, and many other non basic languages, but PB just clicks with me and many others for that matter. Of course as 'srod' said:
when all is said and done, it is 'horses for courses'
This is very true. A lot depends upon what you want to program. Some times a couple of different languages may be needed to get the end result.
Program Layout
Posted: Thu Aug 13, 2009 5:49 pm
by Hot Pockets
Thanks for all the words of encouragement. I Finished My Menu,and My bitmap now works with The proper titles in the proper places. With a lot of Help!! I am definitely going to forgo trying to use the visual designer I guess I'll just try to stumble around and learn a little bit at a Time.(I'm good at stumbling around)
Posted: Thu Aug 13, 2009 7:02 pm
by blueznl
HotPocket, did you check out Kale's book and the Survival Guide?
Posted: Thu Aug 13, 2009 11:35 pm
by utopiomania
I'm trying to re-write a check register program that I wrote for dos years ago.
If this is you, what compiler did you use to write this program?
Check out this one
Or see if you can find a compiler here
Layout's
Posted: Fri Aug 14, 2009 4:07 am
by Hot Pockets
I printed out the survival guide and Gary Wiloughby's Beginners Pure Basic Guide. The compiler I used to compile the Original Check Chum Register program was MSN's Basic PDS 7.11. Free basic is perhaps the closest to it. But PureBasic has more commands. And now that I see what is possible it interest's me. So I just may stick around a while. Thanks for the help!!