Im A newb.

If you have questions about any aspect of QBasic programming, or would like to help fellow programmers solve their problems, check out this board!

Moderators: Pete, Mods

Post Reply
Cman
Newbie
Posts: 2
Joined: Thu Jan 17, 2008 3:16 pm

Im A newb.

Post by Cman »

I've programmed for about 7 months. Ive learned the basics up to MID$, LEFT$, RIGHT$. I can input data, and thats about it. Im having troubles learning these things like strin1$ + string2$ etc. not that they're very challenging, but that im not receiving proper instruction. Can anyone help?
Patz QuickBASIC Creations
Veteran
Posts: 399
Joined: Wed Mar 02, 2005 9:01 pm
Location: Nashville, Tennessee
Contact:

Post by Patz QuickBASIC Creations »

Well, first off, welcome to the QuickBASIC community! If you ever have anything to ask, we're usually pretty friendly here and get things sorted out.

As for your question, I don't understand exactly what you mean, but doing string1$ + string2$ makes the text of string2$ be appended to the end of string1$. For example:

Code: Select all

string1$ = "foo"
string2$ = "bar"
string3$ = string1$ + string2
Print string3
'Output: foobar
Cman
Newbie
Posts: 2
Joined: Thu Jan 17, 2008 3:16 pm

sweet...

Post by Cman »

yea... umm that was fairly simple, now where do i go from there? I purchased a book from the internet... its the basics. That was the last thing in the book... i dont know where to go, or what to do from here. * You guys a friendly, thanks!
User avatar
BadMrBox
Veteran
Posts: 86
Joined: Tue Feb 28, 2006 12:19 pm

Post by BadMrBox »

That was the last thing in the book... i dont know where to go, or what to do from here.
Neither do I but if adding strings together is the last thing in the book -it should be a short book :wink:.

Have you checked out the tutorials on Petes?
http://www.petesqbsite.com/sections/tut ... ials.shtml
User avatar
burger2227
Veteran
Posts: 2466
Joined: Mon Aug 21, 2006 12:40 am
Location: Pittsburgh, PA

Download

Post by burger2227 »

I have an instruction demo for Quickbasic at QbasicStation.com Member files that has many examples with code for qbasic.

http://www.qbasicstation.com/index.php? ... &filecat=3

Q-BASICS.ZIP covers everything from PRINT to graphics functions.

Uses QB4.5 available in Member File Utilities section.

Ted
Please acknowledge and thank members who answer your questions!
QB64 is a FREE QBasic compiler for WIN, MAC(OSX) and LINUX : https://www.qb64.org/forum/index.php
Get my Q-Basics demonstrator: https://www.dropbox.com/s/fdmgp91d6h8ps ... s.zip?dl=0
BDZ
Coder
Posts: 49
Joined: Sun Nov 20, 2005 5:41 pm
Location: Wisconsin
Contact:

Post by BDZ »

In my experience, the best way to learn programming is to start some sort of project. In the process of trying to make it, you'll probably come up with some specific questions you can ask. Until then, just check out those tutorials.
User avatar
Kiyotewolf
Veteran
Posts: 96
Joined: Tue Apr 01, 2008 11:38 pm

String Modifying

Post by Kiyotewolf »

When you make something longer, you repeat the statement of this style.

(nul means no character, no output and no nothing.. an empty string.)

?Wolf$ [output: nul]
^__ ? is short for PRINT in QBasic
^_____ the outcome of the operation
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -- - - -- - -- - - -

code examples.:

Wolf$="cat"
Wolf$ = Wolf$ + "thingy"
?Wolf$ [output: catthingy]

Wolf$="dog"
Fox$="hog"
Wolf$=LEFT$(Fox$,1) + MID$(Wolf$,2,2)
?Wolf$ [output: hog]

Wolf$=""
Wolf$ = Wolf$ + Wolf$ + Wolf$ + Wolf$
?Wolf$ [ output: nul]

Wolf$="cow "
Wolf$=Wolf$ + Wolf$ + Wolf$ + Wolf$
?Wolf$ [ output: cow cow cow cow ]

Wolf$="134dog"
FoxCode=VAL(Wolf$)
?FoxCode [ output : 134]

Wolf$="dog143"
FoxCode=VAL(Wolf$)
?FoxCode [output : 0 ]
^____ zero


Any more questions?

Kiyote!
Banana phone! We need more lemon pledge. * exploding fist of iced tea! * I see your psycho cat and counter with a duck that has a broken leg, in a cast.
User avatar
burger2227
Veteran
Posts: 2466
Joined: Mon Aug 21, 2006 12:40 am
Location: Pittsburgh, PA

Post by burger2227 »

Got scooby snax?

You are an apparrent asshole!

Wanna roll over and play dead? ARF
Please acknowledge and thank members who answer your questions!
QB64 is a FREE QBasic compiler for WIN, MAC(OSX) and LINUX : https://www.qb64.org/forum/index.php
Get my Q-Basics demonstrator: https://www.dropbox.com/s/fdmgp91d6h8ps ... s.zip?dl=0
User avatar
Kiyotewolf
Veteran
Posts: 96
Joined: Tue Apr 01, 2008 11:38 pm

how sweet.. swear words..

Post by Kiyotewolf »

I treat you nicely no matter what you do and you continue to be degrading..

Please don't bug me anymore.

I'll stay away from the forum unless I'm really tempted to post, but you have officially made yourself clear that you "own" the forum and are going to defend it from intruders,.. such as myself..

Go fly a kite man.. and take some pills or something..

Kiyote!
Banana phone! We need more lemon pledge. * exploding fist of iced tea! * I see your psycho cat and counter with a duck that has a broken leg, in a cast.
Post Reply