Page 1 of 2 12 LastLast
Results 1 to 10 of 15

Thread: New To Programming

  1. #1

    New To Programming

    Hello everyone,

    I am sorry if I place this topic in the wrong section as I could not find a "Beginners" section.

    I have always wanted to learn how to program but never actually got round to doing it. After a search on google I came across ThinBasic.

    I was just hoping someone could point me in the right direction as I have never programmed before and would like to get started right away.

    Kind regards,

    OneHitWonder.




  2. #2
    thinBasic author ErosOlmi's Avatar
    Join Date
    Sep 2004
    Location
    Milan - Italy
    Age
    50
    Posts
    8,198
    Blog Entries
    2
    Rep Power
    10

    Re: New To Programming

    Ciao OneHitWonder and wellcome to thinBasic community forum.

    I think thinBasic can be one of the best choice to start programming.
    The problem is: where, how and at what level to start.

    First install latest thinBasic version in your computer.
    Done that you will find an icon called thinAir. thinAir is the editor we use to write programs in thinBasic. It is a classical editor full of features dedicated to thinAir programming language.

    On programming I usually follow an empirical method: have a simple but real problem to face and use it to discover a programming language. It must be not that complex problem in order to concentrate your efferts on the programming and less on the problem itself.

    Done that I would concentrate on [wiki=Variable_(programming)]What is a variable[/wiki] in programming. It is the basis of whatever programming language you would face.

    So what's next?
    It depends on the path you would like to follow.
    Give us more info.
    www.thinbasic.com | www.thinbasic.com/community/ | psch.thinbasic.com
    Win10Pro 64bit - 8GB Ram - Intel i7 M620 2.67GHz - NVIDIA Quadro FX1800M 1GB

  3. #3
    Super Moderator Petr Schreiber's Avatar
    Join Date
    Aug 2005
    Location
    Brno - Czech Republic
    Posts
    6,800
    Blog Entries
    3
    Rep Power
    694

    Re: New To Programming

    Welcome OneHitWonder,

    one of the possible resources for study could be the ThinBASIC Tutorial. Where can you find it?
    Just navigate to your ThinBASIC installation folder, SampleScripts/Tutorial and launch the script. It covers few basic topics, might be interesting for you.

    Another resource are the ThinBASIC Journals, these are magazines covering various topics:
    Journal #1
    Journal #2

    But as Eros said, one of the best approaches is to try to solve some problem.


    Petr
    Learn 3D graphics with ThinBASIC, learn TBGL!
    Windows 7 64bit - Intel Core 2 Duo T6600 @ 2.2GHz - 4 GB RAM - NVIDIA GeForce G210M 512MB
    Windows 8 64bit - Intel Core i5-3350P @ 3.1GHz - 8 GB RAM - NVIDIA GeForce GT640 3GB

  4. #4
    Senior Member Lionheart008's Avatar
    Join Date
    Sep 2008
    Location
    Germany, Bad Sooden-Allendorf
    Age
    45
    Posts
    914
    Rep Power
    101

    Re: New To Programming

    good morning OneHitWonder, welcome from my side too
    As I know how it is as newbie or programming beginner with such a strange and new programming language like thinbasic here a little example for you to start. 1) one console application and 2) creating a short dialog.

    A) After you have installed thinbasic, load a script from this board or have a closer look at the "Samplescripts" folder at Thinbasic directory. push "F5" to compile the example. push "F1" to get help from manual, there are many example too for helping you.

    B) open the "samplescript" folder you will find more than 50 folders with special "module" power like "UI", "TBGL", "console" and much more. There you'll find a lot of predefined example you can use and making some personal experiences how to handle with thinbasic.


    my little help for you:
    info: little notice, there are two example into one. one uses "console" script and then the other one uses "ui" for building simple dialog example.

    [code=thinbasic]' Empty GUI script created on 06-30-2010 08:55:43 by (ThinAIR)

    Uses "console", "UI"

    PrintL "hello and welcome to Mr. OneHitWonder at this day: " + Date$
    PrintL
    MsgBox 0, "hello dear Mr. OneHitWonder", %MB_OK, "have a nice time with thinbasic "
    PrintL
    PrintL "press any key to quit this thinbasic example, thanks!"

    WaitKey

    PrintL
    PrintL "or you can create a graphic user interface (GUI) with this few lines"
    PrintL

    '--end first console example ----------------------------------------------------------

    '---Define a button ID
    %ButtonClose = 1001
    %thankyou = 1002

    Dim hDlg As DWord

    Dialog New 0, "myDialog",-1,-1, 330, 203, _
    %WS_POPUP Or _
    %WS_VISIBLE Or _
    %WS_CLIPCHILDREN Or _
    %WS_CAPTION Or _
    %WS_SYSMENU Or _
    %WS_MINIMIZEBOX, _
    0 To hDlg

    Control Add Button, hDlg, %ButtonClose, "Click to kill", 90, 50, 80, 24
    Control Add Button, hDlg, %thankyou, "thank you ", 90, 90, 80, 24

    Dialog Show Modal hDlg Call cbDialog

    '------------------------------------------------
    ' Callback function used to handle dialog events
    '------------------------------------------------
    CallBack Function cbDialog() As Long

    Select Case CBMSG
    Case %WM_COMMAND
    If CBWPARAM = %ButtonClose Then Dialog End CBHNDL
    If CBWPARAM = %thankyou Then
    MsgBox 0, "thank you, dear mr. OneHhitWonder for using Thinbasic"
    End If
    Dialog End CBHNDL

    Case %WM_DESTROY
    MsgBox 0, "Window is to be destroyed."

    End Select

    End Function

    '--end second "ui" example -----------------------------------------------------------
    [/code]

    you will notice very soon, it's very easy to build your first thinbasic example. but as eros and petr already said, what's your aim with using such a programming language ?

    feel free to ask, don't hesitate, any good help you will get here very fast, I am sure

    best regards, frank
    Attached Thumbnails Attached Thumbnails Click image for larger version. 

Name:	for-oneHitWonder.png 
Views:	72 
Size:	52.4 KB 
ID:	6703   Click image for larger version. 

Name:	open-samplescript-folder-and-50more.png 
Views:	73 
Size:	129.8 KB 
ID:	6704  
    Attached Files Attached Files
    you can't always get what you want, but if you try sometimes you might find, you get what you need

  5. #5

    Re: New To Programming

    Good morning,

    Thanks for your replies and for making me feel welcome here at this community. I have been doing quite a lot of reading on programming languages in general and have picked up some of the basics, variables, program flow. I just need to re-read up on subroutines and functions again.

    The help manual has been very helpful, especially the module section and gives me the commands.

    LionHeart008 I got slightly confused with your UI example I think I will stick with the console window until I get more experience.

    It think I will concentrate on input and output and create a guessing game I read that is a good pratice.

    If anyone has any more advice I would like to hear it.

    Thanks again for your help.

    OneHitWonder

  6. #6
    thinBasic author ErosOlmi's Avatar
    Join Date
    Sep 2004
    Location
    Milan - Italy
    Age
    50
    Posts
    8,198
    Blog Entries
    2
    Rep Power
    10

    Re: New To Programming

    I hope your feeling in thinBasic community will be always high.
    We try our best to be helpful and have a nice place where to stay and talk about programming and technology passions.

    Quote Originally Posted by OneHitWonder
    LionHeart008 I got slightly confused with your UI example I think I will stick with the console window until I get more experience.
    Usually console applications are separated by GUI ones. So programmers tends to make application for one world OR for the other.

    In thinBasic you can easily mix them together because each of them is governed by a dedicated thinBasic module and both can be loaded at the same time into a script. Having standard windows handled with events and also a console window where to play with classic PRINT commands in comfortable in some situations.

    Ciao
    Eros
    www.thinbasic.com | www.thinbasic.com/community/ | psch.thinbasic.com
    Win10Pro 64bit - 8GB Ram - Intel i7 M620 2.67GHz - NVIDIA Quadro FX1800M 1GB

  7. #7

    Re: New To Programming

    Hey,

    As I mentioned in my previous post I was going to concentrate on making a simple guessing game. This is what I have come up with .

    Uses "Console"
    
    Randomize 
    Dim answer As Integer = Rnd (1, 100)
    Dim guesses As Integer = 5 
    Dim guess As Integer
    
    Console_WriteLine "Guess a number between 1 - 100"
    
    Do    
     Console_Write "Guesses: " + guesses + " "
     guess = Console_ReadLine
     
     If guess < 0 Then
      Console_WriteLine "Guess higher than 0"
     ElseIf guess > 100 Then
      Console_WriteLine "Guess lower than 100"
     ElseIf guess > 0 And guess < 100 And guess < answer Then
      Console_WriteLine "Try again, guess higher!"
      guesses = guesses - 1
     ElseIf guess > 0 And guess < 100 And guess > answer Then 
      Console_WriteLine "Try again, guess lower!"
      guesses = guesses - 1
     Else
      Console_WriteLine "You win!"
      Exit Do 
     EndIf 
      
    Loop Until guesses = 0  
    
    Console_WaitKey
    
    OneHitWonder

  8. #8
    thinBasic MVPs
    Join Date
    May 2007
    Location
    UK
    Posts
    1,427
    Blog Entries
    1
    Rep Power
    153

    Re: New To Programming

    Almost but good for a first try.

    Here is another solution

    [code=thinbasic]
    Uses "Console"

    Randomize
    Dim answer As Long = Rnd (1, 100)
    Dim guesses As Long = 5
    Dim guess As Long

    Console_WriteLine "Guess a number between 1 - 100"

    Do
    Console_Write "Guesses: " + guesses + " "
    guess = Console_ReadLine

    If guess < 0 Then
    Console_WriteLine "Guess higher than 0"
    ElseIf guess > 100 Then
    Console_WriteLine "Guess lower than 100"
    ElseIf guess < answer Then
    Decr guesses
    If Guesses > 0 Then Console_WriteLine "Try again, guess higher!"+$CRLF
    ElseIf guess > answer Then
    Decr guesses
    If Guesses > 0 Then Console_WriteLine "Try again, guess lower!"+$CRLF
    Else
    Console_WriteLine "You win!"
    Exit Do
    EndIf

    Loop While guesses > 0
    If Guesses <= 0 Then Console_WriteLine $CRLF+"Sorry you failed"

    Console_WaitKey

    [/code]
    Home Desktop : Windows 7 - Intel Pentium (D) - 3.0 Ghz - 2GB - Geforce 6800GS
    Home Laptop : WinXP Pro SP3 - Intel Centrino Duo - 1.73 Ghz - 2 GB - Intel GMA 950
    Home Laptop : Windows 10 - Intel(R) Core(TM) i5-4210U CPU @ 1.70GHz, 2401 Mhz, 2 Core(s), 4 Logical Processor(s) - 4 GB - Intel HD 4400
    Work Desktop : Windows 10 - Intel I7 - 4 Ghz - 8GB - Quadro Fx 370

  9. #9

    Re: New To Programming

    Thanks for that example, I had no idea about the decr function thats pretty useful!

    Thanks for your help on this.

    If you could reccomend something else simple I should try making if you don't mind?

    EDITED
    I think it would be a good idea if DECR & INCR could have parimeters to handle how much to increase and descrease by.


    OneHitWonder

  10. #10

    Re: New To Programming

    I think it would be a good idea if DECR & INCR could have parimeters to handle how much to increase and descrease by.
    I'm pretty sure thinBASIC supports the following expression.

    a += 3  ' same as a = a + 3
    b -= 3  ' same as b = b - 3
    
    ScriptBasic Project Manager
    Project Site
    support@scriptbasic.org

Page 1 of 2 12 LastLast

Similar Threads

  1. The Tao Of Programming
    By zak in forum Shout Box Area
    Replies: 2
    Last Post: 07-09-2010, 06:39

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •