Programming Help

Just starting out? Need help? Post your questions and find answers here.
cegy
User
User
Posts: 10
Joined: Fri Aug 19, 2005 2:39 pm

Programming Help

Post by cegy »

Hi there i have just downloaded purebasic which looks ace but i wanna know how to program in it i.e help files, tuts etc... to help me get started in purebasic.

Can anyone help me please

Many Thanks Cegy :)
fweil
Enthusiast
Enthusiast
Posts: 725
Joined: Thu Apr 22, 2004 5:56 pm
Location: France
Contact:

Post by fweil »

Welcome cegy,

You have a ton of sources accessible here :


http://www.purearea.net/pb/CodeArchiv/CodeArchiv.html


and the forum for all questions and sources sharing !

KRgrds
My avatar is a small copy of the 4x1.8m image I created and exposed at 'Le salon international du meuble à Paris' january 2004 in Matt Sindall's 'Shades' designers exhibition. The original laminated print was designed using a 150 dpi printout.
cegy
User
User
Posts: 10
Joined: Fri Aug 19, 2005 2:39 pm

Post by cegy »

fweil wrote:Welcome cegy,

You have a ton of sources accessible here :


http://www.purearea.net/pb/CodeArchiv/CodeArchiv.html


and the forum for all questions and sources sharing !

KRgrds

Many thanks :) just 1 more question how do i use the visual designer when i code with it


:?: i hope this doesn't sound daft :?
fweil
Enthusiast
Enthusiast
Posts: 725
Joined: Thu Apr 22, 2004 5:56 pm
Location: France
Contact:

Post by fweil »

If you have got the last 3.94 release of PureBasic, just use the Visual Designer and push F1 !

The help should put you on the tracks.

Rgrds
My avatar is a small copy of the 4x1.8m image I created and exposed at 'Le salon international du meuble à Paris' january 2004 in Matt Sindall's 'Shades' designers exhibition. The original laminated print was designed using a 150 dpi printout.
cegy
User
User
Posts: 10
Joined: Fri Aug 19, 2005 2:39 pm

Post by cegy »

fweil wrote:If you have got the last 3.94 release of PureBasic, just use the Visual Designer and push F1 !

The help should put you on the tracks.

Rgrds
oh yeah you know after you made ur form and you saved it how "would" you code it with your project?

I hope you understand what i mean :s
Killswitch
Enthusiast
Enthusiast
Posts: 731
Joined: Wed Apr 21, 2004 7:12 pm

Post by Killswitch »

Design your form then click on:

Project > Generate Source

Then it automatically creates the code you've designed. I haven't tried the newest release but the old one created two files an include file an the main file, you'll only need the one with the most code in it!

You'll probally want to look up on Procedures, Constants and Enumerations.
~I see one problem with your reasoning: the fact is thats not a chicken~
fweil
Enthusiast
Enthusiast
Posts: 725
Joined: Thu Apr 22, 2004 5:56 pm
Location: France
Contact:

Post by fweil »

Well basically the Visual Designer can create a project, which is not the code but the collection of objects and behaviours.

When loading this project, you can switch to PureBasic editor (Project menu). If you do so, you will get two source files in the PureBasic editor.

The first one is GeneratedMainFile.pb which is the caller of the second GeneratedIncludeFile.pb.

To focus on the program you want to design, you can go to GeneratedMainFile.pb and add the following lines :

Code: Select all

  
  Open_Window_0()
  
  Repeat
    Select WaitWindowEvent()
      Case #PB_Event_Menu
        Select EventMenuID()
          ; put there your menu events
        EndSelect
      Case #PB_Event_Gadget
        Select EventGadgetID()
          ; put there your gadget events
        EndSelect
      Case #PB_Event_CloseWindow
        Quit = #True
    EndSelect
  Until Quit
  
End
Hope this helps
My avatar is a small copy of the 4x1.8m image I created and exposed at 'Le salon international du meuble à Paris' january 2004 in Matt Sindall's 'Shades' designers exhibition. The original laminated print was designed using a 150 dpi printout.
cegy
User
User
Posts: 10
Joined: Fri Aug 19, 2005 2:39 pm

Post by cegy »

fweil wrote:Well basically the Visual Designer can create a project, which is not the code but the collection of objects and behaviours.

When loading this project, you can switch to PureBasic editor (Project menu). If you do so, you will get two source files in the PureBasic editor.

The first one is GeneratedMainFile.pb which is the caller of the second GeneratedIncludeFile.pb.

To focus on the program you want to design, you can go to GeneratedMainFile.pb and add the following lines :

Code: Select all

  
  Open_Window_0()
  
  Repeat
    Select WaitWindowEvent()
      Case #PB_Event_Menu
        Select EventMenuID()
          ; put there your menu events
        EndSelect
      Case #PB_Event_Gadget
        Select EventGadgetID()
          ; put there your gadget events
        EndSelect
      Case #PB_Event_CloseWindow
        Quit = #True
    EndSelect
  Until Quit
  
End
Hope this helps
Oh many thanks if its possible for a sample and how to do it "to" make sure i do it right. This would be very helpful :)
Post Reply