Skip to main content
guest
Join | Help | Sign In
Liberty BASIC Programmer's Encyc Home
guest| Join | Help | Sign In
Liberty BASIC Programmer's Encyc
  • Wiki Home
  • Recent Changes
  • Pages and Files
  • Members

Home

General Tutorials
Advanced Tutorials
GUI Programming
Graphics and Games
Strings and Text
Numbers and Math
Using Files
Windows API
Communications
Programmer's Tools

Articles by Date
FAQs
Rosetta Code
General Articles
Newsletters Contents

Table of Contents
Demos

Submit Articles
TOS and License

0303

Edit 1 …
  • 1 Tags
    • tutorials
  • Notify
  • RSS
  • Backlinks
  • Source
  • Print
  • Export (PDF)
Older Version Newer Version

Alyce Alyce Nov 4, 2006

Lesson Map | Next > Define Variables

Echo the Input


You asked for the user's name with:

 input "What is your name? "; name$ 

The user replied. Now how do you get the name, the actual text, back out of the name$ variable so you can use it in the program?

You don't. The magic of variables is that you don't have to dig the information out of the variable to use it. You simply use the variable itself where you need it, and the data comes along by itself. To print the user's name, put the names$ variable into a print command:

 print name$ 

The program will show the contents of name$ in the mainwin. Here's the whole program (copy and paste it into a new code window in LB Editor, or type it in yourself):

 input "What is your name? "; name$ 
print name$

Some programming languages require you to define variables. Liberty BASIC does not have that requirement. Variables are defined as they are used, but there is one rule, so let's find out about that rule next.

Lesson Map | Next > Define Variables
Help · About · Pricing · Privacy · Terms · Support · Upgrade
Contributions to https://lbpe.wikispaces.com/ are licensed under a Custom License.
Portions not contributed by visitors are Copyright 2018 Tangient LLC
TES: The largest network of teachers in the world
Turn off "Getting Started"
  1. Home
  2. ...
Loading...