The QBasic / QB64 Discussion Forum      Other Subforums, Links and Downloads
 
 


  << Previous Topic | Next Topic >>Return to Index  

i am now in romania and see that compiler download as html.page

April 1 2012 at 3:58 AM
Anonymous  (no login)

 
is ainternetcade and the charakter...install starwars old republik think there was enough pain and stars...



better that


Strings meanwhile are text, so you would use it only really with PRINT. For example:

Name$ = 'Adam'
PRINT 'Hello'; name$; '!'

This then prints 'Hello Adam!' on the screen, but notice how the name$ is outside of the quotation marks (with semi colons) to avoid confusion. You can also get the user to input a string…

PRINT 'Hi, what's your name please?'
INPUT name$
PRINT 'Hi'; name$; '!'

This then asks for the user's name, then brings up a cursor, saying hi to that person after they press enter. This is one form of input and this is how the user interacts with the variables on the screen to make the programmes interactive. They can also interact in real time in order to change variables like so:

10
PSET (20, 10),4
SELECT CASE INKEY$
CASE 'P'
X = x + 1
CLS
CASE 'O'
X = x - 1
CASE 'E'
STOP
CLS
END SELECT
GOTO 10

Here 'SELECT CASE INKEY$' tells it to expect input, while the following parts mean if the input is 'P' then X = X + 1 and the pset moves to the right, if they press 'O' however then it moves to the left. Everything beneath the 'CASE 'E'' is what happens if you press 'E' until the next 'CASE' or the 'END SELECT'.

IF, AND, OR, ELSE and THEN

Finally this is where things get interesting and you can create interesting sequences of events. The 'IF, AND and THEN' commands all do precisely what you would expect them to in English, but are then followed by commands or maths.
For example:

PRINT 'What is your name?'
INPUT name$
IF name$ = 'Adam' THEN PRINT 'My name is Adam too!'
ELSE PRINT 'Hi'; name$; ', nice to meet you!'

Alternatively you could use it to make games. Here is a very simple game:

X = 1
10
PSET (20, 10), 6
PSET (x, 10), 2
SELECT CASE INKEY$
CASE 'P'
X = x + 1
CLS
CASE 'O'
X = x - 1
CLS
CASE 'E'
STOP
END SELECT
IF x = 20 THEN GOTO out
GOTO 10
Out:
CLS
PRINT 'Well done you reached the gold!'
SLEEP 0
STOP

Here you have a green dot, you press 'P' to move it right across the screen, and when it reaches the red dot (20 along) it tells you well done and exits on a key press.

Of course all this is really just a very basic introduction to QBASIC and does not really touch on the huge number of things you can do with it. However with just these few tools, it is possible to make a vast range of different programmes and games, and to start learning extra code on top to give them even more uses.







 
 Respond to this message   
AuthorReply
Anonymous
(no login)

tested

April 20 2012, 10:20 AM 

REM Hallo
CLS
INPUT "Wie heißt Du? ",vorname$
PRINT
PRINT "Hallo "; vorname$; "!"

 
 Respond to this message   
Anonymous
(no login)

http://www.o-bizz.de/qbtuts/qb-proku/qbasic_lektion1.htm

April 20 2012, 10:22 AM 

enjoy...



LET a=105
LET b=5
PRINT a+b


 
 Respond to this message   
Anonymous
(no login)

select case?

April 29 2012, 8:09 AM 

INPUT "Enter acceptable level of risk (1-5): ", Total
SELECT CASE Total
CASE IS >= 5
PRINT "Maximum risk and potential return."
PRINT "Choose stock investment plan."
CASE 2 TO 4
PRINT "Moderate to high risk and potential return."
PRINT "Choose mutual fund or corporate bonds."
CASE 1
PRINT "No risk, low return."
PRINT "Choose IRA."
END SELECT

 
 Respond to this message   
Anonymous
(no login)

looks very bad this jazz mean from price...

April 29 2012, 8:53 AM 

the original for what ever look like this

10
PSET (20, 10),4
SELECT CASE INKEY$
CASE 'P'
X = x + 1
CLS
CASE 'O'
X = x - 1
CASE 'E'
STOP
CLS
END SELECT
GOTO 10


if i enter in the compiler looks other exact so



10
PSET (20, 10), 4
SELECT CASE INKEY$
CASE IS = x + 1
CLS
CASE 'O'
x = x - 1
CASE 'E'
STOP
CLS
END SELECT
GOTO 10

'P'




would well if any can check and help that fooditems free from hazard
pay...



'PSET (20, 10), 4
'SELECT CASE INKEY$
'CASE IS = x - 1
'P'
'CASE IS = x - 1
'CASE IS < e'
SELECT CASE e
'GOTO 10
'O'
'CLS
END SELECT
'GOTO 10

 
 Respond to this message   
Anonymous
(no login)

the other from hot cesco mean....

April 29 2012, 9:08 AM 

PRINT 'What is your name?'
INPUT name$
IF name$ = 'Adam' THEN PRINT 'My name is Adam too!'
ELSE PRINT 'Hi'; name$; ', nice to meet you!'


if enter in compiler looks other exact so ...



PRINT 'What is your name?'
INPUT name$
IF name$ = PRINT 'Hi'; name$; ', nice to meet you!'

'Adam' THEN PRINT 'My name is Adam too!'



that the programm no work is also case that with that disturb normality is a crime or did any need timesquare digits....


the aplication rum with that in no case....




PRINT "What is your name?"
INPUT name$
'IF name$ THEN PRINT "My name is Adam too!"
'ELSE PRINT "Hi"; name$;
PRINT " nice to meet you!"


if any can with two answers would be well

 
 Respond to this message   
Anonymous
(no login)

here also the mean ...

April 29 2012, 9:12 AM 

X = 1
10
PSET (20, 10), 6
PSET (x, 10), 2
SELECT CASE INKEY$
CASE 'P'
X = x + 1
CLS
CASE 'O'
X = x - 1
CLS
CASE 'E'
STOP
END SELECT
IF x = 20 THEN GOTO out
GOTO 10
Out:
CLS
PRINT 'Well done you reached the gold!'
SLEEP 0
STOP



the compiler.blue planet?with q basic show...


x = 1
10
PSET (20, 10), 6
PSET (x, 10), 2
SELECT CASE INKEY$
CASE IS = x + 1
CLS
CASE 'O'
x = x - 1
CLS
CASE 'E'
STOP
END SELECT
IF x = 20 THEN GOTO out
GOTO 10
Out:
CLS
PRINT 'Well done you reached the gold!'
SLEEP 0
STOP

'P'



if you use a print needs"

 
 Respond to this message   
Current Topic - i am now in romania and see that compiler download as html.page
  << Previous Topic | Next Topic >>Return to Index  
 Copyright © 1999-2014 Network54. All rights reserved.   Terms of Use   Privacy Statement  

Newbies usually go to www.qbasic.com and click on The QBasic Forum
Forum regulars have their own ways, which include The QBasic Community Forums