Click here to Skip to main content
15,891,708 members
Everything / Programming Languages / Basic

Basic

Basic

Great Reads

by Chris Boss
More about BASIC and what can be accomplished with the language
by Howard 9448490
Creating a reusable editor for C# Applications using the RichTextBox Control
by Chris Boss
BASIC: A powerful language often underestimated and undervalued
by Chris Boss
BASIC is one of the most misunderstood programming languages! Mention BASIC to a current software developer and one quickly finds out that it is not viewed favorably by most programmers.

Latest Articles

by Chris Boss
BASIC: A powerful language often underestimated and undervalued
by Wessel Beulink
Microsoft Azure enhances security with private subnets, fostering efficient network management.
by Jani Giannoudis
Structured approach to ASP.NET Localization
by vblover Programmer
Adding ContextMenu's MenuItem to the SystemMenu of Form in Windows Forms Application

All Articles

Sort by Updated

Basic 

28 Feb 2024 by Chris Boss
BASIC: A powerful language often underestimated and undervalued
11 Feb 2024 by Ralf Meier
When seeing your Solution I want to suggest you some little modifications : Private Sub Button7_Click(sender As System.Object, e As System.EventArgs) Handles Button7.Click Cursor.Position = GetCenterOfControl(Button6) End Sub ...
9 Feb 2024 by Member 16123720
Thanks to OriginalGriff and Ralf Meier... Their guidance led me to the solution pasted below. But first, I need to clarify my originally posted scenario. It seems that the code line below WILL work if there is no other form opened during the...
8 Feb 2024 by OriginalGriff
The Location of a control is always relative to its container: if you have a GroupBox on a Form, and the GroupBox contains a Button, then myGroupBox.Location is relative to the top left corner of myForm.ClientRectangle, and myButton.Location is...
8 Feb 2024 by Member 16123720
Using VB 2008 Express. I have a Main form that has a number of Group Boxes. As desired, I can successfully position a Wait Cursor on a control on the Main Form that is NOT within a group box using the following code lines: (assume Button1 is NOT...
8 Feb 2024 by Albert Redditt
The Free BASIC coders wrote a program called "Swig" You run it on a *.dll and it outputs a *.bi ( BASIC include ) file like a C ( header file ) So then you can call C and windows libraries , from inside of BASIC. To run the above code you...
4 Feb 2024 by Albert Redditt
I wrote this program several years ago. It allows you to make fully scalable "pictures" for font characters. It's written in Free BASIC.. Since the font characters can vary in size , i couldn't figure out how to make an editor for it. How...
26 Jan 2024 by OriginalGriff
There is a good technical reason why it doesn't work, and it's the same reason that you can't "decrypt" a SHA or MD5 hash: Decrypting MD5 and SHA: Why You Can't Do It[^] 2600 bytes only allows for 20,800 different combinations: many people have...
26 Jan 2024 by Dave Kreskowiak
Quote: Compresses any size file down to around 2600 Bytes. That statement alone means you don't understand what you're doing, and you have MASSIVE collision problems with your algorithm, NO MATTER HOW IT IS WRITTEN OR WHAT IT IS DOING. You just...
5 Jan 2024 by Wessel Beulink
Microsoft Azure enhances security with private subnets, fostering efficient network management.
16 Aug 2023 by Jani Giannoudis
Structured approach to ASP.NET Localization
16 Aug 2023 by Graeme_Grant
Here is a library that will do what you need: NuGet Gallery | WinForms.DataVisualization 1.8.0[^] You can download the source code and run the sample app. It has both C# and VB sample code with over 100 samples for you: GitHub -...
16 Aug 2023 by Marlon Rivera
Can someone help me to make a program for this type of graph? I have three labels: 1st label is for the Input Count 2nd label is for the Output Count 3rd label is for my Total Target In the Graph, I want to show: Y axis the Total Target I input...
2 Mar 2023 by Amerigoware
The error is: Quote: Exception of type 'System.Windows.Forms.AxHost+InvalidActiveXStateException' was thrown. What I have tried: My code is: Private Sub PlayList_SelectedIndexChanged(sender As Object, e As EventArgs) Handles...
2 Mar 2023 by Andre Oosthuizen
The public properties and methods of an ActiveX control can only be referenced after the ActiveX control has been instantiated and initialized completely; otherwise the AxHost.InvalidActiveXStateException exception is thrown. The...
2 Mar 2023 by Member 12450076
i need help ho can i add two numbers using function in visual basicWhat I have tried:add two numbers using function in visual basic
15 Feb 2023 by landv li
viusal basic 6.0 use RDPCOMAPILIBCtl com component, rdpviewer connect prompts syntax error RDPCOMAPILibCtl.RDPViewer RDPViewer.Connect(Text1.Text,"administrator","1234") What I have tried: form1.frm VERSION 5.00 Object =...
4 Feb 2023 by Member 15914116
Public Class Form2 Private Sub btnGO_Click(sender As Object, e As EventArgs) Handles btnGo1.Click Dim stFirstName As String Dim stLastName As String Dim stGender As String stFirstName = txtFirstName.Text ...
4 Feb 2023 by Richard MacCutchan
It most likely means that your button and text fields are not defined on the form. This could be different spelling, or just missing items.
16 Jan 2023 by OriginalGriff
While we are more than willing to help those that are stuck, that doesn't mean that we are here to do it all for you! We can't do all the work, you are either getting paid for this, or it's part of your grades and it wouldn't be at all fair for...
16 Jan 2023 by CHill60
If you don't understand the question then you need to talk to your tutor. We will not do your assignment for you - assignments are designed to cement knowledge in your head and to help your tutor better gauge your needs. Getting someone else to...
24 Dec 2022 by Hemil Gandhi
Error in following line, please help Dim num As Short = CShort(1152712705) What I have tried: Googling from last entire week.
24 Dec 2022 by OriginalGriff
A short value has only 16 bits, one of which is used to determine sign: it is positive or negative? As a result, the largest positive number you can fit into a short is 32767. Your value vastly exceeds that and requires an integer (32 bits) or...
13 Dec 2022 by vblover Programmer
Adding ContextMenu's MenuItem to the SystemMenu of Form in Windows Forms Application
15 Nov 2022 by Chris Boss
More about BASIC and what can be accomplished with the language
22 Oct 2022 by Member 4206974
Form generator is a class module written in Basic4Android (B4A) for build and handle forms data.
5 Apr 2022 by Maciej Los
If ListBox's items are not bound with data source, you can change the text of items in single loop. See C# code (LinqPad): void Main() { MyForm mf = new MyForm(); //mf.ShowDialog(); } public class MyForm: Form { public MyForm() {...
5 Apr 2022 by benngia
Hi, I have a listbox with many items like these: test_test_0.0.0.0_000 test5_test5_1.1.1.1_000_0 testing_testing_0.1.2.3_000 blabla_blabla_0.5.4.3_000 I need to rename the listbox items into: rtsp://test:test@0.0.0.0:000...
4 Apr 2022 by CHill60
As far as I know, the ListBox item has to be selected before you can change the text. You will find that difficult in a For Each loop, especially as you have Strings rather than Objects. Try changing the loop to a For iterator = range loop....
14 Feb 2022 by Howard 9448490
Creating a reusable editor for C# Applications using the RichTextBox Control
19 Nov 2021 by Richard MacCutchan
M = 'Male' and 'male' That statement does not do what you think. The expression X and Y is a logical expression and returns True if X and Y are equal, False otherwise. And since 'Male' and 'male' are not equal, M has the value False. So your...
19 Nov 2021 by Joshua McCarthy
As the title says, I have one variable, "M", and I want it to execute a command if one or the other word was input by the user. These words are "Male" and "male". You will see in the code that I have M = "Male" and "male". The execution will only...
7 Nov 2021 by Rick York
I would read this page closely and follow its examples : MIPS Assembly Language Examples[^]
7 Nov 2021 by ubutu2334
General conversion from C language to assembly MIPS if(condition) { clause1 } else { clause2 } Thanks What I have tried: condition clause2 j end then: clause1 end: How should I convert without a specific condition?
22 Oct 2021 by Nithish Karthikeyan
My function is not calculating the expected value instead printing some negative integers as result. What I have tried: // code to find area of rectangle using functions #include #include // function for calculating the...
22 Oct 2021 by KarstenK
The input is wrong, must be delimited with space. Better is to write clean code and seperate both inputs: int main() { float length, breadth, area; printf("enter length:"); scanf("%f",&length,); ...
22 Oct 2021 by albert_redditt
It's for a data compressor... The code is FreeBasic.. ( freebasic.net ) if n1 = 110 or 111 it compresses a bit.. if n1 = 000 or 001 it expands 2 bits.. it compresses a bit more often than it expands 2 bits, so it overall it compresses.. ...
22 Oct 2021 by OriginalGriff
It works fine for me: I paste your code into on online compiler, and enter two numbers. I get the result I expect: enter length,breadth of the rectangle:2.0,3.3 the area of the rectangle is:6.600000 ...Program finished with exit code 0 Press...
20 Oct 2021 by OriginalGriff
This is not a question. This area is for asking questions that you need help with, not for posting random pseudocode with unlikely claims. It may be that your technique works: but I have my doubts: Quote: Compresses any size file down to around...
27 Sep 2021 by OriginalGriff
Don't post this under Quick Answers - if you got the code from an article, then there is a "Add a Comment or Question" button at the bottom of that article, which causes an email to be sent to the author. They are then alerted that you wish to...
24 Sep 2021 by albert_redditt
Here's the whole program... It's written in FreeBASIC.. '===================================================================== '===================================================================== 'Start Z lib...
11 Sep 2021 by albert_redditt
Here's the whole program... It's in FreeBASIC You need Zlib.dll the the directory with the compiled exe.. I got the Compress_loop() tweaked as much as i can... The only thing left is inline ASM... ...
11 Sep 2021 by albert_redditt
Can someone help speed this code up?? It currently uses string indexing.. How would you do it with pointers or shifts or logic or math?? I'm using FreeBASIC n1 = "110110" v1 = ( ( n1[ 0 ] - 48 ) * 2 ) + ( n1[ 1 ] - 48 ) v2 = ( ( n1[ 2 ] - 48...
11 Sep 2021 by albert_redditt
Here's the main loop again.. I tweaked it a little.. using pointers.. Now it's down to under 25 seconds.. for a megabyte input.. It's using ubyte pointers... so it takes 6 operations to do 6 bits.. I couldn't figure out ushort ptr's.. It would...
9 Sep 2021 by OriginalGriff
Without access to your whole code, we can't help you speed it up - a tiny fragment of code with no context to any looping or data access code doesn't let us know enough to even start optimising anything efficiently. Just three lines of code in...
8 Sep 2021 by albert_redditt
Hello: This code is in FreeBasic... How do you undo it , to reveal v1 , v2 , v3 ??? screen 19 do dim as ubyte v1 = int( rnd * 4 ) + 1 dim as ubyte v2 = int( rnd * 4 ) + 1 dim as ubyte v3 = int( rnd * 4 ) + 1 dim as...
8 Sep 2021 by albert_redditt
It makes it possible with the following code added map+= bin( v2 mod 2 ) so ((v1*v2)-1) and ((v2*v3)-1) if you know that v2 is even or odd , since the values are all 1 to 4. if v2 is odd then it has to be a 1 or 3 else its a 2 or 4
8 Sep 2021 by OriginalGriff
You can't "undo" it: there are too many ways to generate a number and you require a singe solution. Think about it: how many different sets of values values could give you a result of 141? If there are two or more, you are stuffed!
8 Sep 2021 by Patrice T
Quote: v1 * v2 and v2 * v3 : you should be able to identify all 3 original values.. As far as I understand your code, the answer is NO. Because: V1=1, V2=2, V3=1 gives N="22" and V1=2, V2=1, V3=2 gives N="22"
25 Aug 2021 by VBeginner.NET
You would know all of Fortran IV if you knew some 40 (just guessing) key words or "reserved" words like CONTINUE, DO, END, COMMON, EQUIVALENT, SIN, INTEGER, SUBROUTINE, etc. Does someone know this number more accurately? (Later, these words were...
25 Aug 2021 by OriginalGriff
Quote: Of course not, and I am not programming in Fortran these days. I am just trying to compare the number of key words. And Dave has given you the answer, or at least the means to get the answer. Go to the link, and start counting. Then...
25 Aug 2021 by Dave Kreskowiak
Keywords - Visual Basic | Microsoft Docs[^] FORTRAN 77 doesn't have any reserved words, but that doesn't mean using any keywords is a good idea.
20 Jul 2021 by Alice Woods
Hi there, Can someone please help me how to locate the class name, object attribute and variables, and object methods from the code below... I'm so confused, please help! thank you import sys import numpy as np frankston_stock = []...
20 Jul 2021 by OriginalGriff
To define a class in Python, you use the keyword class: Python Classes[^] So all you need to do to find the class name in there is find the keyword and look to it's right. And .. it isn't in there. So ... no classes are created in that code,...
24 Jun 2021 by ionMEMBER
Hi ! I have a project webbrowser with vb.net; works fine but does not load all websites. This is like internet explorer, but on it works fine. Maybe not support javascript, but idk if have a solution What I have tried: Public Class Form1 ...
24 Jun 2021 by Maciej Los
WebBrowser class[^] has several disadvantages. See: c# - Webbrowser Control Limitations - Stack Overflow[^] - answer provided by Erx_VB.NExT.Coder. So, if you would like to be able load sites with javascript, you have to change with another control.
19 Jun 2021 by ionMEMBER
Hi all! Im trying to get element from htm file to vb.net but when I excute this command, i see a problem with textbox2.text = arrowtag(2)
19 Jun 2021 by Patrice T
Quote: ArrayTag contains more than three items, whatever number i decide to arragtag, same problem. Maybe is all about the module Stop guessing, and make sure with the debugger. Your code do not behave the way you expect, or you don't...
15 Jun 2021 by BenNgu123
I'm pretty new, I was wondering how I can add new elements to my code instead of constantly changing the same one. My code just allows me to edit the same element instead of being able to make a new element. My goal is making a contacts...
15 Jun 2021 by Maciej Los
I'd suggest to use XmlSerialization[^]. See: A Complete Sample of Custom Class Collection Serialization and Deserialization[^]
15 Jun 2021 by Wendelius
If I understand the situation correctly, I think it would be easier to work with XmlDocument rather than using a XmlWriter to write the content. With XmlDocument you can create/modify/delete the content and when needed you can save or load the...
15 May 2021 by Member 12640969
Hello, A problem that has many causes and as many solutions if I judge the previous questions but none of which suits my situation. I was working with Visual Basic 2013 on Win7 SP1 x64 (Yes, I know it's obsolete but it was a "legacy" of an...
15 May 2021 by Member 12640969
Sorry, Please read : "I Installed Visual Studio 2019 (always with the Basic)" Thanks Dom
7 May 2021 by Richard MacCutchan
Wrong place. This website is for technical questions, and you have been a member long enough to know that. Try your local library.
5 May 2021 by Member 15170284
HELLO WHEN I PUT IMAGE IN PICTURE BOX GIVE ME ERROR GDI I USE VB.NET 2015 What I have tried: HELLO WHEN I PUT IMAGE IN PICTURE BOX GIVE ME ERROR GDI I USE VB.NET 2015
5 May 2021 by OriginalGriff
First off, DON'T SHOUT. Using all capitals is considered shouting on the internet, and rude (using all lower case is considered childish). Use proper capitalization if you want to be taken seriously. At a guess, you are retrieving the image data...
4 Apr 2021 by Daniel Peqini
I want to find the order that the buttons are clicked and add them in an Array where they are sorted by their click order. Then i want to know the name of the last button clicked (4 buttons). What I have tried: I have tried to check when a...
4 Apr 2021 by OriginalGriff
So create a class level List of Buttons, and handle their Click events. In the handler, check if the button has been added already, and if so, remove it. Then add the button. Since a List is ordered by "last entry at the end" you just need to...
28 Mar 2021 by Inter_Offical
Can I know to design a Avast loading animation, because I really like to use it on my own application. Like this -> https://pasteboard.co/JUHbFCH.gif[^] but in Avast-like UI. (VB.NET or C#) What I have tried: I tried to do this in a normal...
28 Mar 2021 by Dave Kreskowiak
There is a property on the ProgressBar control, called Style. Set it to ProgressBarStyle.Marquee. No other code required.
22 Mar 2021 by Member 12415575
how do i draw flow chart with my qbasic software What I have tried: i dont know where to start from
17 Feb 2021 by Levi Marquez
I'm trying to list the return value from MySQL into excel using vb.net but my problem is only the first row is being inserted in Excel VB.NET How to list all Column in MYSQL into 1 Column in Excel using vb.net - Stack Overflow[^] What I have...
17 Feb 2021 by Richard Deeming
Your code is doing exactly what you've told it to do - take the value from the "Type of Learners" column on the first row of the result, and insert it into cell 66,8 in your sheet. If you want to insert data from multiple rows, then you need to...
19 Jan 2021 by Richard MacCutchan
I just tried your code and it works fine*. Please provide more details as to exactly what you are seeing. *although it does need to be surrounded by a try/catch sequence to check for IOException. [edit] I am still not exactly sure what your...
18 Jan 2021 by Bhasker Babu
when I am inserting a array of char type. I have set rray, but when I run the program it takes less values and print them instead of taking the no. of values which I have initialized. please check this import java.io.*; class charr { public...
22 Dec 2020 by Member 11700078
I have one child Form (Form2) in a MDI project with one label and one button control. Form2 also having a public Sub ChangeText(). When run this SUB changes the Label text. On clicking the Button one Modal Form will pop up. This modal Form also...
22 Dec 2020 by CHill60
Have a read of this series of Tips that will show you the right way to do this Transferring information between two forms, Part 1: Parent to Child[^] Transferring information between two forms, Part 2: Child to Parent[^] Transferring information...
12 Sep 2020 by Gerry Schmitz
The parent is the ISBN / Title; the children are the physical books for that ISBN. The parent says nothing about condition, price, location / owner; the children do. The parent may contain (original) author, first pub date, ... attributes not...
12 Sep 2020 by Member 14936556
Draw an ER diagram for multiple copies of the same book with unique book . What I have tried: can i try this with weak entity? as i take book as strong entity and copy as weak entity and i have no idea what can i give attribute of weak entity....
11 Aug 2020 by OzWaz
I have written a program in Basic and now I need to reproduce it in php. Within a (basic) while loop I use the “goto” facility to bypass code in the loop not required if a certain condition is met. I found a goto code in php manual but it...
8 Aug 2020 by Richard MacCutchan
You have not declared either $flip or $A before trying to use them in an expression. Also, using goto is really bad practice, there are better ways of resetting your values. I have modified your code to the following, although I am not sure what...
8 Aug 2020 by Patrice T
Quote: Where did I go wrong this code ? Reread your code and think about what are a, b, c and d when respective checkboxes are unchecked. Solution should be obvious. ----- Your code do not behave the way you expect, or you don't understand why !...
8 Aug 2020 by Dark Frost
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click If CheckBox1.Checked = True Then Dim a As String = "-clone" Else End If If CheckBox2.Checked = True Then ...
8 Aug 2020 by Richard MacCutchan
Sandeep's answer is partially correct, but I think you want the possibility of any combination of the options, so something like: Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click Dim someString As String ...
8 Aug 2020 by Sandeep Mewara
If CheckBox1.Checked = True Then Dim a As String = "-clone" Else End If If CheckBox2.Checked = True Then Dim b As String = "-noerror" Else End If If CheckBox3.Checked = True...
2 Aug 2020 by OriginalGriff
For starters, even in Basic, you shouldn't use Goto - and certainly not when rewriting code into a more modern language than SmallBasic! Instead, reverse the If test: Start: while (condition) if (other condition) Goto start do...
2 Aug 2020 by DiponRoy
Read a large CSV or any character separated values file chunk by chunk as DataTable and Entity List
7 May 2020 by patrickb123
Hi everyone! I am modifying the Basic Sharp Interpreter for my application, my application is a winforms application and i have imported the classes from BasicSharp into my application and i am able to send code through it and get a response. I...
28 Apr 2020 by Richard MacCutchan
The constructor for Student contains one more parameter than the constructor for Person. You need to add a call to the parent constructor with the following code: Student(String firstName, String lastName, int id, int[] testScores) { ...
28 Apr 2020 by Member 14815736
Whats wrong with this java code? HINT: related to inheritanc What I have tried: import java.util.*; import java.lang.String; class Person { protected String firstName; protected String lastName; protected int idNumber; //...
27 Apr 2020 by CHill60
If you know enough about this to give us a hint then you know enough to answer your own question. But, what you have actually done is post your homework or course exercise. We do not do your homework, although we will help if we can if you get...
29 Nov 2019 by MohannadNajjar
HI ,,, What is wrong in the code to convert the program interface to another language interface ??? IN Visual Basic .NET (Visual Studio 2019) Imports System.Globalization Imports System.ComponentModel Public Class Form1 Private Sub ArButton_Click(sender As Object, e As EventArgs)...
29 Nov 2019 by RickZeeland
Seems ok to me, using an online converter it can be converted to C#. Convert VB.NET to/from C# online - Roslyn Code Converter[^] using System; using System.Globalization; public partial class Form1 { private void ArButton_Click(object sender, EventArgs e) { ...