Questions tagged [basic]

For questions about the BASIC (Beginner’s All-purpose Symbolic Instruction Code) programming language. DO NOT USE TO INDICATE YOUR QUESTION IS SIMPLE!

BASIC, short for Beginner's All-purpose Symbolic Instruction Code, is a family of high-level programming languages popular in the 1980s, and emphasizes on the ease of use. This language and the tag is not to be confused with Visual Basic.

The first version of BASIC was developed on May 1st, 1964 by John G. Kemeny, Thomas E. Kurtz and Mary Kenneth Keller in Dartmouth College. Since then, it encouraged students and enthusiasts from backgrounds other than sciences and mathematics to create their own programs and many microcomputers of the 1980s came pre-loaded with BASIC. Later, many other programming languages heavily influenced by BASIC has been developed, with several still in use, such as Visual Basic and VB.NET.

Here is an example of a sample qBASIC program (one BASIC variety), which prints "Hello World", uses a for loop to print out number multipliers, then squares a number variable, asks for name input, and then repeatedly asks for number input until the user enters a negative number. The text after // are not part of the code.

10 PRINT "HELLO WORLD" // Hello World
20 FOR X=1 TO 5        // For Loop
30 PRINT "X "; X
40 NEXT X
50 LET A = 10          // Square variable
55 LET B = A*A
60 PRINT A;"^2 = ";B
70 PRINT "ENTER YOUR NAME"            // Enter name
75 INPUT "Enter your name:"; a$
80 PRINT "My name is "; a$
90 PRINT "ENTER A NUMBER, 0 TO CLOSE" // Repeatedly enter number
95 INPUT "Enter a number:"; a$
100 PRINT "The number is "; a$
110 IF a$ >= 0 THEN GOTO 90
999 END

An example output is:

HELLO WORLD
X 1
X 2
X 3
X 4
X 5
10^2 = 100
ENTER YOUR NAME
My name is I am a basic programmer!
ENTER A NUMBER, 0 TO CLOSE
The number is 5
ENTER A NUMBER, 0 TO CLOSE
The number is 4
ENTER A NUMBER, 0 TO CLOSE
The number is 3
ENTER A NUMBER, 0 TO CLOSE
The number is 2
ENTER A NUMBER, 0 TO CLOSE
The number is 1
ENTER A NUMBER, 0 TO CLOSE
The number is 0
ENTER A NUMBER, 0 TO CLOSE
The number is -1

Read More

  • Visual Basic for Applications, usually for writing macros for Microsoft Office.
  • One of the main languages of the .NET Framework. It is not the same as VBA.
  • Wikipedia
  • Online BASIC simulator
855 questions
-2
votes
1 answer

Can I create a software which reads PDF files and creates folders?

I want to create a software using visual basic which reads some text in a PDF file (name on an invoice), and then creates a folder using that name. Is this possible to do, and how would I get started on this? I have programming experience in the…
Jhon Godto
  • 29
  • 3
-2
votes
2 answers

How would I create this program?

I have to write a loop that would produce to make 4 unique numbers. So it would be like 4- 2 - 5 - 7 and it can't be like 4 - 4 - 5- 7 because the 4's aren't unique. It's just I struggle with loop I tried learning loop on YouTube no idea still maybe…
-2
votes
1 answer

textbox1 + textbox2 in Textbox3

Ok so what I am trying to do is create a program that will do this: Text Box 1: ASDFGHJK Text Box 2: ZXCVBNMO Result Text Box: AZSXDCFVGBHNJMKO In a windows application using text boxes and buttons. Can somewhere give me a starting point on this? I…
-2
votes
1 answer

Visual Basic 2013 - Pressing ALT gets me out of code

I just installed my Visual Basic and this is a problem I couldnt find an answer to. Everytime I press ALT it gets me out of code, and because I use SHIFT+ALT to change keyboards a lot while writing code, this is really disturbing to have to click in…
Black
  • 3
  • 3
-2
votes
1 answer

How to add parameters to Visual Basic Program via Textbox

I am currently working on a server manager for the game DayZ. I have almost 90 % done, I have a working history of servers joined etc. I'm working on a option where the game will launch with a click of a button, which works, but i need it to connect…
-2
votes
2 answers

How do I convert a 4 digit number into individual digits?

I need to write logic to break down a 4 digit number into individual digits. On a reply here at SO to a question regarding 3 digits, someone gave the math below: int first = 321/100; int second = (321/10)-first*10; int third =…
-2
votes
1 answer

Find all permutations from 1-9 and A-F

I am trying to find all possible permutations from the following conditions: Number range 1-99 Letter range A-F 32 Digit long string What would you recommend to make my life easier? Tried to search about permutations in vb, but just can't find…
-2
votes
1 answer

vb.net How to detect specific string on HTML code

Hello everyone i am building a program to find specific strings on a HTML source code. Here is what i mean -> For example the first thing the program does is "Grab target's HTML code and put it on RichTextBox1.text" When i grab HTML code and put it…
-2
votes
1 answer

BASIC language wrapper on C#

Is there any BASIC wrapper / interface for C#? Lua interface wraps lua for C# which works perfect with ability to write user functions, Is there any wrapper that wraps BASIC in C#? I know that BASIC is old, But I just liked the way it's being used…
111WARLOCK111
  • 153
  • 1
  • 1
  • 9
-2
votes
1 answer

Discrepancy between BASIC INT and PHP int, how to resolve?

I've been re-writing a BASIC program to PHP. I've run across a problem, let me explain: In the BASIC code I have the following statement with values: LSLATVER=1590 PITCHVER=50 NRSLATHOR=INT(LSLATVER/PITCHVER-.8) // output: 30 In PHP the code I…
-2
votes
2 answers

Is anyone aware of a VIM colorscheme for BASIC (language)

B.A.S.I.C. I encountered a few thousand lines of code from the 80's I need to edit, and would like to save a couple hours it may take me to roll my own VIM syntax defs file.
MountainMan
  • 753
  • 2
  • 10
  • 20
-3
votes
0 answers

New to computer circuitry, need microcontroller of LED Lightboard

Heyo, I have absolutely zero experience with computer circuitry and I want to get into it by the means of building a 32 by 32 LED light grid, which can be programmed with BASIC. I want to use a Texas Instruments Arm microprocessor to process the…
NLKD
  • 1
  • 1
-3
votes
1 answer

Transpose based on variable length of items in rows , for a sheet of more than 1000 entries

im very new to vba coding and trying to learn. I have a sheet of more than 1000 entries . Column A is Sr number, Column B has Names and Column C to Column V has items (20 columns max). Each name in Column B can buy multiple items (column C to Column…
-3
votes
1 answer

Memory locations for rnd() seed

Have been trying to create a small program to encrypt/decrypt an text file. Would like to use RND() function that has been seeded with 4 numbers (0-255). Did it in BASIC years ago on my Apple IIE and it worked great!(255^4=4,294,967,296 possible…
-3
votes
2 answers

Is it possible to add a method to a native class?

I find surprising that unlike BASIC python doesn't have .left, .right and .mid methods for strings. As stated elsewhere it's easy enough to write functions to do the trick but can one add methods to a native class? So that a = "Spam" b = a.left(3)…
Thot
  • 51
  • 7
1 2 3
56
57