Possible To Make An Array Of Expressions

Nov 14, 2009

I'm in a Collage VB.Net Class and I was wondering if it is possible to make an array of expressions like : Dim exps() = { 5*4,2+3,5*2}.

View 3 Replies


ADVERTISEMENT

Make An Array Equal Another Value Of An Array?

Jul 3, 2010

Public Class Form1
Dim str As String
Dim strA() As String
Dim strB() As String
Dim f As Integer = -1
Private Sub btngo_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btngo.Click
If txtmain.TextLength > 0 Then
str = txtmain.Text

[Code]...

View 2 Replies

Make Array Of An Array?

Feb 13, 2010

how do I declare an array with an array? Say I have the following

item11
item12
item21

[code]....

View 2 Replies

C# - Use Or Not Lambda Expressions?

Nov 11, 2009

I see lambda expressions have become a very useful tool at some points in the language. I've been using them a lot and most of the time they fit really nice and make the code shorter and perhaps clearer.

Now.. I've seen some , I would say excessive use of them. Some people like them so much that try to use them everywhere they can.. Some times the C# code looks like a functional language. Other factors against are the cost using reflection by lambda and that not friendly to debugging.I would like to hear opinions about how good and how code clear it is to use more or less the lambda expressions. (this is not the better example, but let's say it was the trigger)I was writing the following code. The use of the delegate { return null; } helps me avoid having to ask if the event is null or not every time I have to use it.

public delegate ContactCellInfo.Guest AddGuest();
public event AddGuest GuestRequest = delegate { return null;}

Im using resharper and the wise resharper( even it some times literaly eats the memory) made me the following suggestion

public delegate ContactCellInfo.Guest AddGuest();
public event AddGuest GuestRequest = () => null;

At my point of view the code using the delegate looks clearer. I am not against the Lamdba expression just would like to hear some advices on how and when to use them.

View 1 Replies

Evaluate All The Expressions?

Jan 4, 2010

if i do not need to evaluate all the expressions, am i right to say that there are benefits and no disadvantages of using AndAlso compared to using And

example:

if a=b And f=g And y=k
can be better done with:
if a=b AndAlso f=g AndAlso y=k

View 22 Replies

Lambda Expressions In C# Vs. .net?

Jan 20, 2010

Functionally, is there any difference (apart from syntax onbviously) between lambda expressions in C# and VB.Net?EDIT: following up on CraigTP's answer: any references to the situation in .Net 4?EDIT: I'm asking because I'm used to C#, but for a next project the customer asks VB.Net. We're not a priori against that. We realize that most language constructs are supported in both languages. However, we're particularly fond of the way C# implements lambda expressions. We would like to have an overview of the differences with VB.Net

EDIT: accepted CraigTP's answer for pointing out what I currently consider the most important difference.

So to summarize: VB.Net 9 does not support multiline statements in a lambda expression, and a lambda must always return a value. Both of these issues are addressed in VB.Net 10

View 5 Replies

NET 8 - Add General Expressions?

Apr 25, 2012

I wish to incorporate general expressions in my Visual Basic work.Other than the basic inputting "Imports System.Text.RegularExpressions", I have no idea how to do put general expressions in my VB project.However, I can create the expressions (so, all is not lost).

View 1 Replies

.net - Are These Expressions True Or False

Feb 20, 2011

The expression 3>6 AndAlso 7>4 evaluates to
A. True B. False
The expression 4>6 OrElse 10<2*6 evaluates to
A. True B. False
The expression 7>=3+4 OrElse 6<4 AndAlso 2<5 evaluates to
A. True B. False

View 4 Replies

C# - .NET Async Lambda-expressions?

Apr 20, 2012

Async Sub like this: Dim f As Func(Of Task) = Async Sub() End Sub Produces compiler error: error BC36670: Nested sub does not have a signature that is compatible with delegate 'System.Func(Of System.Threading.Tasks.Task)'.Equivalent C# code compiles fine:

Func<Task> f = async () => { };Rewriting Async Sub into Async Function make code works.

Why does Async Sub() is not convertible to delegate types with return value of type Task?

View 1 Replies

C# - Regular Expressions For Class Name?

Jan 15, 2011

i need a regular expressions string to get all anchor tags in a page with a specific css class name, in c#/vb.netthis is what i got so far"<a.*?href=""(.*?)"".*?>(.*?)</a>"ut my attempts to add "class=name" isnt working, also is it possible to find links where the class name appears either before or after the href with one expression

View 4 Replies

Converting Lambda Expressions To .net?

Jul 4, 2010

how to convert this code to VB.net, can anybody help?

public static readonly DependencyProperty CommandProperty =
DependencyProperty.RegisterAttached(
"Command",

[code]...

View 1 Replies

Evaluate Algebraic Expressions In VB NET?

Mar 30, 2011

I am looking for a way to simplify algebraic expressions in VB.NET. It is preferred if you can give me a link to a pre-written library or class.

View 1 Replies

Execute A Statement Only If Both Expressions Are Met?

Feb 13, 2011

I am new to VisualBasic and trying to learn it online. For my first assignment I have to make a program that allows someone to input a time in AM/PM and select the time zone and automatically output a picture and three other time zones. I think I have it for the most part but I am having an issue with one part in particular. Since the time is input using AM or PM if the original time is 11:00 AM and I add an hour it should switch to PM. But I'm not quite sure what I'm doing wrong. I basically need to say If the time is equal to 12 and the meridiem is equal to am then it should switch to pm but I keep getting errors inidicating they are trying to switch to a boolean value.

[Code]...

View 1 Replies

Regex - C# Using Regular Expressions?

Nov 11, 2011

The following works in vb.net, and basically only allows characters on a standard US Keyboard. Any other character pasted gets deleted. I use the following regular expression code:

"[^A-Za-z0-9[{}]`~!@#$%^&*()_-+=\/:;'""<>,.|? ]", "")

View 2 Replies

Sum The Counts With Lambda Expressions

Feb 3, 2012

I have a List(of T) where T has a property that is a list of checkboxes, what I need is a Lambda expression that will count all the checked checkboxes in the list. I tried with:

[Code]...

View 5 Replies

Validation Using Regular Expressions?

Jun 24, 2011

I'm trying to do is some password validation. It needs to have at least 1 lower case character, 1 uppercase character, 1 number and at least 6 characters in length. I figured I could do this using "RegularExpressions" however I can't figure out how to determine the "at least one occurance" of each. For example I thought the following would work but it only validates that what is input is a lower case, uppser case or numeric character, not that the input has at least one of each. The user should be able to enter any characters but at least one of lower case, upper case and numeric characters.

Dim
myMatch
As
Match

[code].....

View 2 Replies

VS 2008 Looking For Regular Expressions?

Mar 5, 2011

I have a string list which has hundrens of elements. Now I want to find a rule to distinguish them according to their similarity. There are these kinds of pattern.

Group 1: "ABC 20", "ABC 20 Dup". There is a substring "DUP" in the last position.
Group 2: "saliva 4", "saliva 4_2","siliva 4_3", etc. There is a substring "_" plus a number in the last position.
Group 3: "sal_1", "sal_1b","sal_1c", etc. There is a character in the last popsition.
Group 4: "NA222", "NA222b", there is a character in the last position.
Group 5: "1","1_2","10","10_2" etc.

I want to put them into a dictionary if they are similar.

View 1 Replies

VS 2008 Use Regular Expressions?

Jul 12, 2011

I have a number that always will be in this format

1815131217 Lets say I want to parse out all the 1's in between leaving only 85327

How can I do that?

What if my number is 1310111512

The number needs to be 30152 How can I do that?

View 6 Replies

VS 2008 Using Regular Expressions?

Dec 18, 2009

I've read a fair number of articles and all tell me this is correct code. However, no matter how many e-mails I try, this always returns false:

vb
If Regex.IsMatch(txtbxFbUsername.Text, "^[A-Z0-9._%+-]+@[A-Z0-9.-]+.[A-Z]{2,4}$") = False Then

[code].....

View 3 Replies

Where Is The Regular Expressions Documentation

Mar 26, 2009

Where is the regular expressions documentation?

View 4 Replies

Why Do Lambda Expressions In VB Differ From C#

Jul 19, 2011

I just came across a bug in NHibernate which happens to already be raised: [url] I'm not sure if this applies to anything else other than enums but when using a Lambda from VB, it looks different to the same Lambda from C#.

C#:

Where(x => x.Status == EmployeeStatus.Active)

VB

Where(Function(x) x.Status = EmployeeStatus.Active)

They are the same as far as I'm aware? (My VB isn't great) If I put a break point on the same line of code, where the above code is passed into. In C# I get: On the same line when VB version is passed in, I get: Is this something I'm doing wrong? Is the result's the same, just displayed different between C#/VB?

Edit: Ok so they are displayed different, but they can't be the same because NHibernate cannot handle it. The C# version is handled perfectly fine by NHibernate, the VB version resolves in the following exception being thrown: [Code]

View 3 Replies

XML Embedded Expressions Implemented?

Sep 4, 2009

Can someone explain the nuts and bolts of what's really going on under the covers?

View 1 Replies

How To Make A Listbox As Array

Jun 6, 2011

Imports System.Net Public Class Form1

[Code]...

Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

View 9 Replies

How To Make An Array Of MethodInfo

Mar 22, 2011

I do have to create at runtime a list that will contains some methods. These will be called in proper time.

So far, I used reflection and have made an array of methodInfo.

The problem is that these methods do have different signature, and I also need somehow to get the value of the arguments to follow their method.

And finally, I need to be able to put all this together and invoke these method when the time comes

View 2 Replies

Is There A Way To Make An Array Of Buttons

Jun 17, 2009

is there a way to make an arry of buttons in vb.net in VB6.0 there is a prop of buttons name Index but not in VB.NET so if there is some way to do that,[code...]

View 2 Replies

Make A 2-dimensional Array?

Oct 10, 2009

i want to make a vb.net program that reads from a text file a movie, with the help of a Open Dialog (called openFD in my program) (we don't know how many movie we've got), the actors, the release date, the country, and the rating.

The text file look like this:

Movie1;Actor,Actor,Actor1;Date1;Country1;Rating1
Movie1;Actor,Actor,Actor1;Date2;Country2;Rating2
...

First question: How can I make a 2-dimensional array? line(0,0) - Movie1, ... , line (1,5) - Rating2. Here Is my try, but it's not good:

Dim line As ArrayList = New ArrayList()
Dim itm As ArrayList = New ArrayList()
Dim i As Integer = 0

[code]....

And here is the code for the Delete Button. It deletes a movie from the listbox, but the details of the deleted movie remains for the next one, I must delete the details for the deleted movie, too.

ListBox1.Items.Remove(ListBox1.SelectedItem.ToString)

View 7 Replies

Make A Public Array?

Nov 25, 2009

I'm trying to make a public array that I can use in Form1.vb and module1.vb.

It seems to work fine in Form1.vb but module1.vb complains about that it isn't declared.

This is how I've done it: I placed it right after this line in Form1.vb:

Public Class Form1
Public SuffixArray() As String

how I declare a Array that I can use in all forms and modules?

View 4 Replies

Make An Array List?

Jun 23, 2009

I want to try/use this code [URL] now im stuck with the last part, how can i make an Array list?

View 5 Replies

Make An Array Of Different Controls?

Sep 3, 2010

I've been making a table control for a few days, and I've got to the point of making it capable of accepting new data. To do this, I'm making it generate a row of text boxes, combo boxes, and date selection windows along the row that you're entering data into.

I've tried using an array of 'control' types and changing them to whatever specific control I need as I generate it. That sort of works. For example, the code under 'Case "Employees"' below will make a combo box display on the form, but 'ControlArray(i).Items.Add' gives an error because it doesn't think that ControlArray(i) is actually a combobox yet.

You might also be interested to know that everything will have to be dynamically generated since the table I'm using will not always be the same (and the Select Case code will eventually be replaced by something that checks for relationships in the database).

Dim ControlArray(NumberOfColumns - 1) As Control
For i As Integer = 0 To NumberOfColumns - 1
ControlArray(i) = New TextBox

[Code].....

View 4 Replies

Make An Array Of Picturesbox's?

Jan 9, 2010

I am trying to make an array of picturesbox's. Now I need one array to loop though all the pictureboxs on the form and add them to the array. I also need another array to loop though all the picturebox's on the form however I only want it to add the ones that there names start with "ladder_" How can I do this?

-Manmax75Don't Be Scared To Ask,

View 2 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved