Leave these fields empty (spam trap):
Name
You can leave this blank to post anonymously, or you can create a Tripcode by using the format Name#Password
Comment
[i]Italic Text[/i]
[b]Bold Text[/b]
[spoiler]Spoiler Text[/spoiler]
>Highlight/Quote Text
[pre]Preformatted & Monospace Text[/pre]
[super]Superset Text[/super]
[sub]Subset Text[/sub]
1. Numbered lists become ordered lists
* Bulleted lists become unordered lists
File

Sandwich


Discord Now Fully Linked With 420chan IRC

Baby's First Visual Basic Project

Reply
- Tue, 20 Sep 2016 06:49:27 EST 5WG+TwiW No.36167
File: 1474368567188.jpg -(11243B / 10.98KB, 212x300) Thumbnail displayed, click image for full size. Baby's First Visual Basic Project
I'm about to commit myself to a project that may span the rest of my life. I have decided to stop being a NEET and try to make the world a stranger place through programming. I already have my free Visual Studio... what do I make for a first project?
>>
Charlotte Fivingstone - Tue, 20 Sep 2016 09:30:00 EST WLOo3E7i No.36168 Reply
make a program that takes in a filename and outputs the number of occurrences of every letter of the file and output the number of occurrences of every word of the file.
>>
Samuel Snakesonthismuthafukinplane - Tue, 20 Sep 2016 09:37:59 EST 5WG+TwiW No.36169 Reply
>>36168
Really? I was more interested in trying to create a digital bacteria that evolves. I'm interested in working with AI.
>>
Samuel Snakesonthismuthafukinplane - Tue, 20 Sep 2016 09:40:44 EST 5WG+TwiW No.36170 Reply
>>36168
Though I'm not sure if I want to be responsible for what happens if this proverbial bacteria that edits it's own code were to take over the world a hundred years from now.
>>
Samuel Snakesonthismuthafukinplane - Tue, 20 Sep 2016 10:08:21 EST 5WG+TwiW No.36171 Reply
>>36168
Strangely or not I actually want to write it in brainfuck if only for the language name.
>>
Charlotte Fivingstone - Tue, 20 Sep 2016 10:13:09 EST WLOo3E7i No.36172 Reply
>>36169
Then my suggestion should be child's play for you. You should have been able to finish it in the time you took to respond to my post.

You did mention you wanted suggestions for your FIRST project. If you try anything much larger for your first project you will most likely fail and then never program again.
>>
Samuel Snakesonthismuthafukinplane - Tue, 20 Sep 2016 10:18:01 EST 5WG+TwiW No.36173 Reply
>>36172
My Visual Studio is currently updating with the 5gb of tools I requested on a 2mb internet connection. I'm currently researching the language.
>>
Samuel Snakesonthismuthafukinplane - Tue, 20 Sep 2016 10:27:25 EST 5WG+TwiW No.36174 Reply
>>36172
>fail and never program again

I'm actually an extremely persistent bastard when I want to get something done.
>>
Charlotte Fivingstone - Tue, 20 Sep 2016 10:33:06 EST WLOo3E7i No.36175 Reply
>>36174
That's good.

If you do get around to programming and finishing it and want to post the code here, use pastebin.
>>
Samuel Snakesonthismuthafukinplane - Tue, 20 Sep 2016 11:20:21 EST 5WG+TwiW No.36176 Reply
>>36175
Will do. I'm persistent but a little slow when it comes to languages. This may take a long time to figure out and involve copious amounts of alcohol.
>>
Samuel Snakesonthismuthafukinplane - Tue, 20 Sep 2016 12:58:46 EST 5WG+TwiW No.36177 Reply
>>36175
Well I somehow screwed up making a simple file reader.

Public Class Form1
Dim reader As String
reader = My.Computer.FileSystem.ReadAllText("\randum.txt")
MsgBox(reader)
End Class

Error :

BC30188 Declaration expected

What the fuck else do I have to declare I thought "reader" was the declaration.
>>
Samuel Snakesonthismuthafukinplane - Tue, 20 Sep 2016 13:07:34 EST 5WG+TwiW No.36178 Reply
1474391254263.jpg -(15159B / 14.80KB, 300x221) Thumbnail displayed, click image for full size.
>>36175
I basically told the program that "reader" should be put as a string and reader means you should access the file randum.txt and I would like that put into a message box.

How fucking hard could it be?
>>
Samuel Snakesonthismuthafukinplane - Tue, 20 Sep 2016 13:17:48 EST 5WG+TwiW No.36179 Reply
>>36177
Then it dawns on me. I don't think it know what the fuck MsgBox means.
>>
Samuel Snakesonthismuthafukinplane - Tue, 20 Sep 2016 13:28:35 EST 5WG+TwiW No.36180 Reply
Please help there seems to be nothing in the online tutorials about adding anything else to make this string of code work. Seriously guise what else do I need to add?
>>
>>
Samuel Snakesonthismuthafukinplane - Tue, 20 Sep 2016 14:17:35 EST 5WG+TwiW No.36182 Reply
>says something other than what I need to add

Fuck off you elitist bitch. I was looking for a teacher not a condescending prick.
>>
Caroline Bobblechut - Tue, 20 Sep 2016 14:53:04 EST OcwxgF1e No.36183 Reply
>>36177
No one here uses VB and trying to get help in realtime on imageboards like this is patently retarded anyway. I've never touched VB.net but I think the problem is that only declarations are allowed in the top level of a class. Try moving your code to a method or subroutine or maybe switch to a language with a REPL. Actually just do that second one.
>>
Rebecca Gonderson - Tue, 20 Sep 2016 16:22:14 EST JUFO79gY No.36184 Reply
>>36177
You can't just put code directly in a class, you need to put it in a Sub Main or Form1_Load or something. Also try MessageBox.Show(reader) instead of MsgBox(reader), the latter is old VB before .NET.
>>
Sophie Nirringdale - Tue, 20 Sep 2016 20:00:02 EST WLOo3E7i No.36188 Reply
>>36177
That is because the compiler was expecting a declaration, but you instead gave it an initialization
What you need to do is put the other code into a sub procedure

Check out this answer on SO
http://stackoverflow.com/questions/8168304/vb-net-program-with-no-ui#answer-8168671

And here is some example code:
Module Module1
Dim reader As String
Public Sub Main()
reader = My.Computer.FileSystem.ReadAllText("\randum.txt")
MsgBox(reader)
End Sub
End Module


Also, I would also suggest switching to a language with a REPL, such as Python, like >>36183 suggested, but it doesn't matter
>>
Fucking Nangernedging - Tue, 20 Sep 2016 22:30:03 EST 5WG+TwiW No.36189 Reply
>>36183
Calm seas do not make better sailors.

>>36184
This is what they failed to mention in the Windows Visual Basic section. Clearly they expected me to begin at the beginning when in reality they should tell you that it must be put into a sub.

>>36188
Well just putting into a sub has it return no error messages anyway.

Thank you for the help.
>>
Beatrice Brookfield - Wed, 21 Sep 2016 00:04:57 EST bgtX2dOr No.36190 Reply
>>36189
Calm seas nothing. You're keelhauling yourself with abysmal iteration times and you're too dumb to see it.
>>
Hamilton Tootman - Wed, 21 Sep 2016 15:55:23 EST xLz8+Ihk No.36191 Reply
>>36190
I write decent C# for a living and I have worked at all every stage of the SDC. I also teach programming principles in VB.NET or C#

VB6/A are abominations, and it hurts me that I can't write 'were', but modern VB is technically on par with C# for the range of things you can use it for.
Syntactically, VB is a fucking mess and I wouldn't advise it for any serious development, but only because it'll drive your developers nuts.
That said, for beginners VB it's still worth of learning, or using to learn at least.

Plus; Intellisense, Visual Studio, press F5 to build/make/run/debug, form designer, etc...
>>
Hamilton Tootman - Wed, 21 Sep 2016 16:06:05 EST xLz8+Ihk No.36192 Reply
>>36177
Use the [ pre ] tag [ / pre]
tag
without spaces to post code.

>>36188
Sophie is right; VB requires that your code must start inside a Module. By default it looks for a Public Sub inside the Module called Main. I you're using a recent Visual Studio start a new Windows Form application. It should open with a form designer where you can add buttons and shit. Double click inside the grey form and start writing your code where the code window opens. You can write
dim num as integer = 420
dim site as string = "chan"
MsgBox.Show("hello " + num.toString() + site + " !", "Muh title")
>>
My Version C !S5GsI15jqU - Wed, 19 Apr 2017 04:19:21 EST I9Trx38n No.36732 Reply
Try{
String Str=System.IO.File.ReadAllText("demo.txt","datahere");
MessageBox.Show(Str);
}
Catch{
}
>>
Cornelius Drezzlefield - Thu, 20 Apr 2017 01:01:36 EST P6PS9CBz No.36737 Reply
The good news is that the rest of your life is lookin' pretty dope right now.
>>
Graham Brirrystone - Sun, 30 Apr 2017 02:51:30 EST rAGFRmkY No.36779 Reply
>>36188
'WTF
Dim R=System.IO.File.ReadAllData("fuckwudoin.txt");
TextBox1.Text=R+TextBox1.Text+VbnewLine
>>
Graham Brirrystone - Sun, 30 Apr 2017 02:52:26 EST rAGFRmkY No.36780 Reply
>>36779
WPF and Window Forms Work too classes are not required!!!- Gary From Menifee
>>
Reuben Blurryfog - Mon, 01 May 2017 01:04:46 EST rAGFRmkY No.36819 Reply
>>36780
JK that fool is a noob and a bi**ch this is EAF aka BrU

Report Post
Reason
Note
Please be descriptive with report notes,
this helps staff resolve issues quicker.