Jump to content
Xtreme .Net Talk

Recommended Posts

Posted
If I could get at memory locations like I could with GWBASIC under MSDOS, I could make my own board.
I know this has nothing to do with the original post, but you might be better off with strait up C instead of VB.net for that. Right tools for the job, you know? As far as I know, you don't have the kind of memory access/control in VB.net. Does anyone know if you could you get it in C# within an unsafe code blocks? I would be inclined to think so but I am unsure as I havn't interfaced with the sorts of I/O boards your talking about via C#.
Posted

I think you're bangin' on me a bit hard there Denaes.

 

I have 6 books. Have I read every line, no. Have I been giving it a shot ,yes.

 

I follow along with a demonstration of inheritance that takes about 36 lines of code so that when you check a check box, it changes color instead of appearing checked. I'm sorry, that's not very inspiring. I remember when I read my first book on the BASIC language, I literally jumped up out of bed and stood on the bed reading the book; the implications made my blood boil.

 

I never have been able to realize those implications, I think to a large degree, because Bill Gates keeps pulling the rug out. I feel like I have to start all over (again) and that makes me angry.

 

The stuff I am talking about is very cool. I do some similar things at work with programmable controllers and what not. It amazes me how close much of what you gotta pay Rockwell thousands of dollars for their software is to VB. It is so close... and yet so far.

 

I'm going to show my ignorance again : :confused:

How can you use the stream reader thing that you posted to read and write discrete pieces of information? Suppose I have five seperate pieces of data, some numerical and some strings, and I want to be able to perform some mathematical operation on the numbers and keep them straight from the strings. How to I keep them seperated so that I know which is which? It seems that much of this stuff is for entire files, in which case couldn't you just use windows explorer. (They don't have an ignorant emoticon)

 

Can you communicate with a USB port with VB.NET?

Posted
I follow along with a demonstration of inheritance that takes about 36 lines of code so that when you check a check box' date=' it changes color instead of appearing checked. I'm sorry, that's not very inspiring.[/quote']

Well, you can do it in a few less lines of code (this is just one way):

   Private _val As Boolean = False

   Private Sub CheckBox1_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CheckBox1.CheckedChanged

       Static lock As Boolean

       If Not lock Then
           _val = Not _val

           lock = True

           CheckBox1.Checked = False

           lock = False

           If _val Then
               CheckBox1.BackColor = Color.Blue
           Else
               CheckBox1.BackColor = Color.White
           End If
       End If

   End Sub

I think what they were trying to show is not so much changing the color of the checkbox, but the power and functionality of inheritance. Without having read the book I could be wrong, but usually examples in books aren't really something you would do in real life. :)

 

I never have been able to realize those implications, I think to a large degree, because Bill Gates keeps pulling the rug out. I feel like I have to start all over (again) and that makes me angry.

It's not so much starting over. Much of the language is still the same. You just have a huge pre-built library of classes to use.

 

I'm going to show my ignorance again : :confused:

How can you use the stream reader thing that you posted to read and write discrete pieces of information? Suppose I have five seperate pieces of data, some numerical and some strings, and I want to be able to perform some mathematical operation on the numbers and keep them straight from the strings. How to I keep them seperated so that I know which is which? It seems that much of this stuff is for entire files, in which case couldn't you just use windows explorer. (They don't have an ignorant emoticon)

First, a StreamReader is just what is says - a reader. You would use the StreamWriter class to write data back out to a file.

 

Second, the class just reads in file data to memory, you would still do the manipulation using variables. For your example how you would read in the data depends on how you have it set up in the file. If it's all on one line in a delimited format you just read the line into a string variable and using the String class's Split function to chop the line into it's separate pieces of data. If it's on separate lines, use the ReadLine to read each piece into separate variables.

 

Hope that's enough of an explanation.

 

Can you communicate with a USB port with VB.NET?

Not "out of the box" AFAIK.

Here's what I'm up to.
  • *Experts*
Posted

@realolman:

I would question why you'd want to use .NET? Surely you don't buy into "newer is better". If you know/like VB6 better, use that. You have a specific need, it sounds like - to control some custom hardware through Serial and/or USB ports. That's not a normal target of .NET developers, which are mostly business oriented. What's cool for me and what makes my life easier may just add extra complexity to what you want. If an old version of QBasic works, I'd use that. Maybe Borland has a new version of Turbo Pascal (which I loved back in the DOS programming days) for windows? I'm not that familiar with COM port programming, but I know lots of people used VB5 and VB6 for that, along with a 3rd party COM port "control". I'd look down that path, if that's what you really want.

 

-ner

"I want to stand as close to the edge as I can without going over. Out on the edge you see all the kinds of things you can't see from the center." - Kurt Vonnegut
Posted
@realolman:

it sounds like - to control some custom hardware through Serial and/or USB ports. That's not a normal target of .NET developers, which are mostly business oriented.

-ner

 

I suppose I'm beating a dead horse, but what I'm trying to communicate here is what in my mind should be... while trying to learn what is.

 

Is there any reason this stuff couldn't be included with vb.net? It used to be included with basic and vb6. Would it make .NET too large and unwieldy? Is USB outdated already too? Weren't there other languages for business? I really feel that I am trying to not argue here. I truly would like to understand.

 

It seems to me it would be relatively small potatoes for MS to include stuff like this. It's very difficult to buy a tape recorder ( Geeze, am I old ) with a microphone jack. On the other hand Mp3 and CD players don't have microphone jacks either. Individual creativity is being phased out. Should no one be able to program a computer unless he works full time at it... for a large company? Should we have to buy a program to do everything? Or better yet subscribe to a program?

Posted
I think what they were trying to show is not so much changing the color of the checkbox, but the power and functionality of inheritance. Without having read the book I could be wrong, but usually examples in books aren't really something you would do in real life. :)

.

 

That's exactly what it was for. I didn't think an example like that demonstrated much usefulness in inheritance. You'd think they could do better... they ARE Microsoft

 

Second, the class just reads in file data to memory, you would still do the manipulation using variables. For your example how you would read in the data depends on how you have it set up in the file. If it's all on one line in a delimited format you just read the line into a string variable and using the String class's Split function to chop the line into it's separate pieces of data. If it's on separate lines, use the ReadLine to read each piece into separate variables.

 

Hope that's enough of an explanation.

.

 

You are very kind in your explanation. Thank you.

 

In the old days, you would write to a file, using commas for delimiters and then when you read it, it would be up to you to keep everything sorted out, by inputting it in a similar manner as you wrote it, and assigning things to appropriate variables. Is that sort of what you do now?

 

I guess you could have written every thing in one big string before, and then InString'ed, Left, Right, and MidString'ed it it and took it back apart, but I don't see why you would want to do that. I guess I don't see why you would want to StreamRead and Write it now in one big string.

Posted
I guess you could have written every thing in one big string before' date=' and then InString'ed, Left, Right, and MidString'ed it and took it back apart, but I don't see why you would want to do that. I guess I don't see why you would want to StreamRead and Write it now in one big string.[/quote']

realolman, it's time to embrace change. I used to think pretty much the exact same as you do, "It doesn't do what I need it to do in the way I am used to doing it, therefore, VB.Net is terrible and stupid." I had to force myself, painfully at first, to write programs. What I ended up with were C++ programs written in VB .Net. It wasn't what I was used to (it's so wordy!) but it got the job done. After a while I started to figure out how to do exactly what I wanted to do and then VB. Net wasn't so stupid any more (though I still think the differences when passing a reference variable to a method byref vs byval is kind of dumb). Soon, I stopped thinking of Sub as a silly way to make a function void and it simply became a Sub or a Function.

 

Anyway, the point is, the harder you think about how it is different from what you are used to, the greater the difference you will find. It sounds like you have the basic tools and experience to write programs -- now you just have to put it all together using a new language. It's sort of like English, right? If you have a great English vocabulary, that doesn't just disappear when you are speaking Spanish. You may not know the Spanish word for something you know in English, but that doesn't mean you don't know what it is AND you can always look it up in a dictionary to get the word. The MSDN can be your VB6 to VB .Net dictionary and it's not like you suddenly have lost the ability to create algorithms or write programs.

 

Start small to get the hang of things first. Embrace the change but don't forget where you came from. Pretty soon you'll be coding hard core and you'll be that much better off than before. Start looking for the similarities, make the "translation" when you need to (void function = Sub, VB6 Runtime = .Net Framework), and pretty soon you'll be a total VB .Net pro.

 

Of course, all that said, you should always use the right tools for the job.

  • *Experts*
Posted

Here's a link to the book "The Design of Everyday Things". This could have been written by realolman. Maybe if he wasn't too busy trying to get his computer to do what he wants :)

 

I guess I'm saying I agree with realolman. VB3 was perfect, in my opinion, for picking up (loaded lightning fast) and just getting something done. The changes MS has made has been perfectly intune with what I want/need at work, but that's not the type of work everyone does. Although I don't know of one, I'm sure there's a "simple" language out there right now that make your life easier.

 

The book points out that as we get "smarter" and use technology more, we don't always design things better or smarter. My new fangled digital camera still seems way harder to use than it needs to be. And now I need a program to retouch my photos, one to organize them and another to find/eliminate the duplicates. Egads, I spend too much time on the computer... have a good night. :)

 

-ner

"I want to stand as close to the edge as I can without going over. Out on the edge you see all the kinds of things you can't see from the center." - Kurt Vonnegut
Posted (edited)
Here's a link to the book "The Design of Everyday Things". -ner

 

 

You can read pages from the book on the site. All I can say about what I have read is EXACTLY!

 

I am going to blatantly steal some lines from the book :

 

The human mind is exquisitely tailored to make sense of the world. Give it the slightest clue and off it goes.

 

If I were placed in the cockpit of a modern jet airliner my inability to perform smoothly would neither surprise nor bother me.

 

This ain't no airliner.

Edited by realolman

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...