|
win32newb wrote:
If you have any good books to by say one for a beginner then one for the next step in sequence please let me know and I will buy them.
I got to be honest here. VB is crap. VB6 was utter crap, VB.NET is marginally better. I use C#, and I answer questions here mostly because I can ( they use the same framework, you see ). I can't really recommend a book, I don't own any VB books myself.
win32newb wrote:
I feel bad asking questions but its the only way I know how to learn.
To learn how to code, I bought 'teach yourself C++ in 24 hours' and asked lots of questions online. These forums are here for you to ask, and everyone who answers, does so of their own free will. No reason to feel bad about needing help, we all needed it at one point, too.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Thanks man I downloaded that expresso program but still having some hang ups.
What I'm trying to parse:
01-0005-00 PHILLIPS & LUCKEY COM ACTIVE 102 BURLESON
PO BOX 1417 ROCKDALE, TX 765671417, B009
SERVICES: ==METERED==
Expression I'm using:
\d\d-\d\d\d\d-\d\d.{5}.{29}.{6}.{9}.+
I can get up to :
01-0005-00 PHILLIPS & LUCKEY COM ACTIVE 102 BURLESON
but then I haven't a clue how to make it read the rest i tried \sSERVICES I tried \n but nothing your help would be appreciated.
I get the following result witht he above expression
Win32newb
"If I wrote a book like I code. It would be one page thick and contain only one word (DUH!)"
|
|
|
|
|
\d{2}-\d{4}-\d{2}.*SERVICES:\s?([\S]*)
This will match ==METERED== in a group, and match the rest before ( no grouping, as you didn't have any ). To make it work I turn on multiline AND single line modes.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
win32newb wrote:
Can someone please help me in understanding why this code will not work in visual basic .net 2003 ?
Because there is no Microsoft.VisualBasic.FileIO namespace in .Net 1.1.
Also, there is no 'My' pseudonamespace in .Net 1.1.
You will have to parse it yourself. If you know there won't be any commas in text fields, you can use String.Split to break it apart, then if the first char of a field is a double quote, you ignore the first and last char of the field. This could also probably be done with RegEx. If there might be commas in the text fields, then you have to be more carefull.
|
|
|
|
|
Thank you this is exactly what I was looking for. No the data will be generated from an access database file with comma delimiters and no valid data will have comma's. This will work perfectly.
Thanks once again. I will write back if i have more questions.
-tony-
Win32newb
"Programming is like sex, make one mistake and you have to support it for a long time"
|
|
|
|
|
I have a matter with Ms.Access. I don't know how to pass the value from one form to another form. Also, I want to set this value to the text-box of the destination form.
For example:
I'd like to transfer the value '5' inside the code VBA of the form 'form1' to the form 'form2'. After moving successfully, I want to show this value in a text-box of the destination form. Please point me to a way of solutions.
Thanks so much...
|
|
|
|
|
Private Sub cmdPassValue_Click()
UserForm2.TextBox1 = Me.TextBox1
End Sub
|
|
|
|
|
Hi my friends, I need some help for syncronizing date and time on terminal with VB.NET.
The idea is set the date and time on the terminal with WinCE. The values are taken of PC.
somebody can help me with this problem?
best regards...
|
|
|
|
|
I have an application which reads values from the registry, now when the app loads, if the values dont exist, I am thrown an exception. Is there any way to stop this exception or to catch it. Or can i perhaps make a function or use a Try statement?
|
|
|
|
|
try will obviously do it. Otherwise, break down your registry code so that you check that you find a key, for example, before looking for a subkey or value.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
I am relatively new to vb.net and c#, do you know of any source that could help me do the above??
|
|
|
|
|
Take your existing code, and break it down. Every part that has a return value, take it and check it for Nothing ( null in C# ) before using it in the next step. If you post your line of code, I'll show you.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
k what I first did was:
Dim rk as RegistryKey = {Key Goes Here}
Dim value as rk.GetValue("Value To Get")
Now i would normally do this before showing the form. So i would put this above the Windows Designer Code.
I think that might be where my problem is, but am unsure what other code to use. I use vb.net but may try and move to c++ or c#, as I need to be able to access hardware.
|
|
|
|
|
andyr2005 wrote:
Dim rk as RegistryKey = {Key Goes Here}
if rk is not nothing
Dim value as rk.GetValue("Value To Get")
end if
something like that ( I don't do VB ). Your problem is that rk is nothing, because the key is not there, and you're trying to access it.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
So if i do something on the form load like
Try
Dim rk as RegistryKey = {Key Goes Here}
if rk is not nothing
then
Do something
elsedim value as rk.getvalue(value to get)
end if
would i be heading in the right direction?
|
|
|
|
|
Yes, your core problem would be that 'value' is scoped inside the if/else, so if you use it outside, declare it before the if/else so it's in scope.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
dim value as byte()
Try
Dim rk as RegistryKey = {Key Goes Here}
if rk is not nothing
then
Do something
else
byte = rk.getvalue(value to get)
end if
Better??
|
|
|
|
|
It's backwards. Remove the not
dim value as byte()
Try
Dim rk as RegistryKey = {Key Goes Here}
if rk is nothing
then
Do something
else
byte = rk.getvalue(value to get)
end if
If it's NOT nothing, then you can use it.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Cheers for that.
When I read a value that is binary, i cant out put to a label, but is it possible to check the value against 5 or 6 others and set a list box value depending on the outcome?
|
|
|
|
|
andyr2005 wrote:
When I read a value that is binary, i cant out put to a label, but is it possible to check the value against 5 or 6 others and set a list box value depending on the outcome?
I'm not sure what you're asking ? A binary value is a bool, or do you mean a value that is data other than a string ? You can certainly compare a value to a collection of values, if they are all of the same type or there is an acceptable conversion.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
K for example i read a value which is 'REG_BINARY' and the value can be 01 28 00 08 or 01 00 40 0a. I need to compare the current value to like a list of available values that can be set. Now if i need to convert, that is the part that i will definetly get lost in.
|
|
|
|
|
What sort of variable are you storing that in ? It looks like a byte [] to me.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
i just used byte as an example, am not sure what to store it in
|
|
|
|
|
OK, well it looks like a byte [] to me, not sure how else you're store it. But if it's in the registry, the registry API will assign a return type. Whatever it is, store your values to compare as the same type, then you can compare them.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Cheers for the help, i use the following code now which works:
Try
audiospeakersrightclick = Registry.CurrentUser.OpenSubKey("SOFTWARE\NVIDIA Corporation\NvMixer\Profiles", True)
If audiospeakersrightclick Is Nothing Then
combospeaker1.SelectedIndex = 0
combospeaker2.SelectedIndex = 0
audiospeakers.CreateSubKey("Profiles")
End If
Catch ex As Exception
End Try
Many thanks again.
|
|
|
|