For cycle and Extension attribute

Hi,

1.

In VB2010 the type (T) of the control variable of a For...Next cycle must 
have the following operators:
Public Shared Operator >= (op1 As T, op2 As T) As B
Public Shared Operator <= (op1 As T, op2 As T) As B
Public Shared Operator - (op1 As T, op2 As T) As T
Public Shared Operator + (op1 As T, op2 As T) As T

I suggest to agree the use of For...Next cycle in that way:
Dim X1 As T
Dim X2 As T
Dim X3 As U
For X As T = X1 To X2 Step X3
....
Next X
Where is defined:
Public Shared Operator - (op1 As T, op2 As U) As T
Public Shared Operator + (op1 As T, op2 As U) As T

2.

The Extension attribute must be specified in a Module. I cannot use Shared 
modifier in a Module. Then I cannot extend shared methods and properties. I 
cannot also extend operators (that must be declared shared). The lexer should 
ignore warnings for shared and operators routines in modules if they have 
Extend attribute.

1+2.

I shuld define:
Public Module Pippo
  <Extend> Public Shared Operator +(X As DateTime, Y As TimeSpan) As DateTime
    Return X.Add(Y)
  End Operator
  <Extend> Public Shared Operator -(X As DateTime, Y As TimeSpan) As DateTime
    Return X.Subtract(Y)
  End Operator
End Module

to use a For...Next cycle like this:
For AvailableDays As Date = FirstDay To LastDay Step New TimeSpan(1, 0, 0, 0)
  ...
Next AvailableDays

Do you like this?

Thank you

----------------
This post is a suggestion for Microsoft, and Microsoft responds to the 
suggestions with the most votes. To vote for this suggestion, click the "I 
Agree" button in the message pane. If you do not see the button, follow this 
link to open the suggestion in the Microsoft Web-based Newsreader and then 
click "I Agree" in the message pane.

http://www.microsoft.com/communities/newsgroups/list/en-us/default.aspx?mid=d559c0ed-16a1-4885-8117-e1cb6eae31de&dg=microsoft.public.dotnet.languages.vb
0
Utf
6/29/2010 9:37:25 AM
dotnet.languages.vb 830 articles. 0 followers. Follow

0 Replies
967 Views

Similar Articles

[PageSpeed] 47

Reply:

Similar Artilces:

Need Attribute help
I need to be able to iterate through the following document to get both the Interface name and the two connections associated with it. I am at my wits end on how to do it...please help! <?xml version="1.0"?> <Interfaces> <Interface Name="ALG_CBD" Priority="0" TimeSet="2006-07-12 06:07:55.765" Connections="2"> <Connections> <Connection Name="ALG_OPL_INT" Priority="0" Type="TCP/IP" State="Connect Listen" ApplicationType="Default Destination" DataType="Production On...

RUS
Hi all! I've trouble with RUS on E2k3. The initial autocreating of e-mail works w/o problems, that's good. However, if I change any attribute that some RU Policy using to compute address (i.e. given name or surname), the RUS do not change the user email. The policy is set to "%g.%s@domain.tld", but if I change the user's name or surname, his e-mail is not changed and the old one remain... Is this "by design"? Did I omitted something? Thanx for help! -- R.V. To my knowledge, RUS isn't designed to "keep user accounts up to date". It stam...

When changing a Read only attribute i get an error messge.
I am trying to open an old database . Access trlls me to change the read only attribute. When I do this I get an error messge. How can I retrieve the information in my database. "rodfromtod" <rodfromtod@discussions.microsoft.com> schreef in bericht news:7B30AE58-CAF5-40A4-9F3B-2CB86EB94AD2@microsoft.com... > I am trying to open an old database . Access trlls me to change the read > only > attribute. When I do this I get an error messge. How can I retrieve the > information in my database. On Mon, 12 Nov 2007 13:04:02 -0800, rodfromtod <rodfromtod@discus...

Flash Extension in C++
Hi, I wonder, is it possible to create a flash extension using c++ or java. Thanks Amar This is something you will need to clarify from Flash. There may be a SDK for C++/Win32;I would look Google it and see where it leads you. I am not sure if you want to use MFC with it as it will unnecessarily add another dependency. --- Ajay Amar wrote: > Hi, > I wonder, is it possible to create a flash extension using c++ or > java. > > Thanks > Amar ...

U.S. Payroll Extensions
I am getting the message... "Before you can use U.S. Payroll Extensions, PTO Manager, Advanced Human Resources, or Advanced Payroll, a system administrator must first log into Microsoft Dynamics GP to initiallize or upgrade database objects." I have done this multiple times now and it goes through the update and the message goes away. But it seems to pop back up on user PCs a few days later. GP10 sp4, SQL 2005 Any ideas? ...

For cycle and Extension attribute
Hi, 1. In VB2010 the type (T) of the control variable of a For...Next cycle must have the following operators: Public Shared Operator >= (op1 As T, op2 As T) As B Public Shared Operator <= (op1 As T, op2 As T) As B Public Shared Operator - (op1 As T, op2 As T) As T Public Shared Operator + (op1 As T, op2 As T) As T I suggest to agree the use of For...Next cycle in that way: Dim X1 As T Dim X2 As T Dim X3 As U For X As T = X1 To X2 Step X3 .... Next X Where is defined: Public Shared Operator - (op1 As T, op2 As U) As T Public Shared Operator + (op1 As T, op2 As U) ...

File Attributes Column
How can I display a "file attributes" column in Outlook 2000 when viewing files and directories? ...

Getting attributes(I think) from XMLReader
Hi All, I need a few suggestions. I have the following XML segment: <LookUp> <ControlType>CheckBoxGroup</ControlType> <DBField>LastMedDate</DBField> <ControlName>cmbGoal1</ControlName> <Values VALUE="0" BookMark="Goal1Progress"/> <Values VALUE="1" BookMark="Goal1NoProgress"/> <Values VALUE="2" BookMark="Goal1NA"/> </LookUp> I have code that will read everything except the "Values" elements. Here is the code: While reader.Read() Select Case (reader.No...

CFileDialog extension for browse folders?
CFileDialog allows me to create File Open and File Save dialogs. But what about Browse for a folder? i.e. the dialog that comes up when you click "Copy/Move this file/folder" in Windows Explorer. Is there an extension to MS Visual C++ (6) or has someone developed a derived class to handle this? Thanks, Paul. Hi, check codeguru.com: http://www.codeguru.com/Cpp/W-D/dislog/dialogforselectingfolders/article.php/c2019/ Regards, Guido How about SHBrowseForFolder()? "paulmasri" <paulmasri@discussions.microsoft.com> wrote in message news:51A42BE7-0F27-494D-B349-B85...

One Element, one attribute
Well, despite reading an excellent article on ComplexTypes, I am unsure on the quickest way to express the following <myElem myAttrib="noMoreThan30chars"> No More than 30 chars </myElem> Both on the string are SimpleContent, right? Thanks, Mark BTW the article is http://www.xml.com/pub/a/2001/08/22/easyschema.html Hi Mark, The following schema will do what you need: <?xml version="1.0" encoding="utf-8" ?> <xs:schema targetNamespace="http://tempuri.org/XMLSchema.xsd" elementFormDefault="qualified"...

making shortcut key for a word extension toolbar button
Hi: I installed an extension for MS Word 2003. It has a special task buttons that I use all the time but have no default shortcut keys assign to them so it doesn't show in customize keyboard>categories. Is there any easy way that I can assign a shortcut key to its buttons? Please help me. Thanks Hoolines -- Hoolines ...

Cycle time/move time/machine time
Excluding Setup and labor time cna anyone give me an instance wehre cycle and move time would be > my machine time? thx -- Paula Hi Paula I'm not sure where you are going with this question. If you are a simple manufacturere and not really interested in all the Capacity detail, and just want to capture some level of labor and machine costs in your routing, then a sinlge step with a cycle time that is sufiicent to capture the full assy time, and shorter amounts of labor and machine are sufficient to cost but not schedule. If you are trying to use GP to get good capacity data, ...

XML attribute test is failing and i don't know why
Hello. I'm developing a web comsuming client using VS.NET 2003(VB), .NET Framework 1.1.4322, ASP.NET 1.1.4322, WSE2.0 on a WinXP Pro Sp2 computer. Using this code that i copied from a book: Dim headTxt As String = "" Me.txtNodeInfo.Text = " " Dim xpNav As XPathNavigator = xpDoc.CreateNavigator() xpNav.MoveToRoot() xpNav.MoveToFirstChild() headTxt = "Currently Positioned at: " txtNodeInfo.Text = Me.txtNodeInfo.Text & headTxt & xpNav.Name & System.Environment.NewLine Dim fUpDate As Boolean = xpNav.MoveToAttribute("xmlns", String.Empty...

xml serialization and conditional attributes
hi, i created a xsd schema and corresponding cs file using xsd.exe. now i want to skip individual items inside an array of elements based on an attribute value. e.g. <nodes> <node attr = "1"> <node attr = "2"> <nodes> but i only want to have <node attr = "1"> written to the xml file, but not the <node attr = "2"> is it possible to do this with XmlAttributeOverrides? This would be easier instead of cloning and adjusting the objects before serialization as it is a very deeply nested structure. if anyone has an idea...

outlook extensions
I'm tring to backup my outlook onto another hard drive before reformating and reinstalling windows and the rest of the program including outlook. Search for pst-files. http://www.howto-outlook.com/howto/backupandrestore.htm http://www.howto-outlook.com/faq/aboutpst.htm -- Robert Sparnaaij [MVP-Outlook] www.howto-outlook.com Tips of the month: -Navigation Pane Tips & Tricks -Create an Office XP CD slipstreamed with Service Pack 3 ----- "RYN" <anonymous@discussions.microsoft.com> wrote in message news:1c5901c46f9f$1c90ee80$a301280a@phx.gbl... > I'm tring to...

Ran forestprep; no exchange attributes
I recently installed a prodcution DC( 8 of them now) all running 2k3 server. We are installing a new instance of exchange 2003 and scrapping our old e 5.5 altogether. when running forestprep / domain prep the install went fine. However, when I go to users&Computers and click user properties I dont see the exchange property sheets We are running interim mode as I have a few NT4 dc's remaining Any help is greatly appreciated you won't. You only see the properties on the exchange server in AD users and computers you can install the exchange admin tools on other DC's to add...

Importing a Lotus file with a *.123 extension
My company uses Excel 97 and 2000 and we've received a Lotus file with a *.123 extension. Excel will not allow me to open it as it does not have the *.wk? format. I searched the web and while I found numerous people with the same problem I found no one who had the conversion answer. Any help would be greatly appreciated. Thanks Find someone with Lotus ver 9 or higher. Have them open the file, and save it as *.wk4 If you dont have Lotus available and want you can send it to me and I will do it for you Thanks "jim" <jimsto@gorbel.com> wrote in message news:088d01c35...

node-sets not sent to xslt extension object correctly
Here's what I have (in snippets) ** XML ** <parent> <child> <grandchild/> </child> </parent> ** XSLT ** <xsl:template match="/parent"> parent: <xsl:value-of select="util:LocalName(.)"/> child: <xsl:value-of select="util:LocalName(child)"/> grandchild: <xsl:value-of select="util:LocalName(child/grandchild)"/> </xsl:template> ** C# (util object) ** public string LocalName(XmlPathNodeIterator xit) { return xit.Current.LocalName; } but for some reason, each call t...

'Unavailable critical extension' returned when LDAP directory => W2K3 AD
On XP and Outlook 2003, Tools/E-mail Accounts LDAP directory pointing to a W2K3 AD, after about 20 seconds, the error 'Unavailable critical extension' is returned, however I can still use Advanced and can succesfully find the desired recipients.. When using NT4, Window 98, and Winodws XP Address Book using the same LDAP directory settings, the search is instantaneous and without the error Any clues as to why and how to fix.. I have tried this with 2 different ADs' with the same error. thanks, -tom ...

How many msg loop cycles to paint a button?
OK, OK, the question is a bit vague, but there's only so much room in the subject line. So here's the real question. For reasons beyond my immediate control I have a program that is designed so that it continously posts itself messages to do some lengthy (+-30ms ) processing. So it goes: long HandleUserMessage() { // do lengthy stuff PostMessage(UWM_DO_USER_STUFF); } Clearly, for the 30ms of lengthy stuff, the UI is dead. This much I know. But the other undesirable effect is that the controls repaint themselves a l� windows 3.1 on a 386, i.e. they repaint their borders, then a...

Extension dll implicitly linking with another extension dll
I have an extension dll that implicitly links with a second extension dll. All seems to work fine, however, in the second dll if I call AfxGetApp() it returns NULL. I'm trying to determine why the resource chain isn't being set in the second dll. An app links with the first dll, and the first dll links with the second dll. If I call AfxGetApp() in the first dll it returns me the correct info, but if then the very next line (in the first dll) I call a function insidde the second dll, which then calls AfxGetApp(), it simply returns NULL. I have even tried putting AFX_MANAGE_STATE(Afx...

Find an attribute starting with
Hi, I use this syntax to find all nodes with an attribute starting with a letter: "//*/[@AAAAAA[starts-with(.,'A')]" but it doesn't work... Why? Thanks in advance Bye BlackSun black_sun@email.it wrote: > I use this syntax to find all nodes with an attribute starting with a > letter: "//*/[@AAAAAA[starts-with(.,'A')]" > but it doesn't work... //*[@*[starts-with(., 'A')]] selects all element nodes that have an attribute (of any name) where the attribute value starts with the letter 'A'. Is that what you want? If not I th...

MS Intelligent Message Filter Extension
Having a very strange problem after installing the Intelligent Message Filter Extension: I installed IMF v2 (I never had v1, so none of the problem associated with that apply) using my administrator account and restarted the server. For some reason, the IMF tab did not appear under the global Message Delivery Properties. After trying to get it working for a while, I uninstalled it, restarted the server, and reinstalled IMF. At this point, the tab DOES appear, but immediately when you click on it, a message is displayed saying ``Heading`` Microsoft Intelligent Message Filter Extension ``Bo...

Howto: Add XML Attributes to a dataset?
Hi, I fill myDataset from a Excel file. Then I do a myDataset.WriteXML("C:\MyXML.xml") So far everything goes as I want to. But I need a attribute when a node has a value e.g.: I get: <Node1 /> <Node2>SomeValue</Node2> <Node1 /> What I need is: <Node1 /> <Node2 Changed="True">SomeValue</Node2> <Node1 /> But how can I get this? I tried filling a dataset by reading in a XML file the way I want but I cant find any difference. I spend the whole day searching and trying but no luck. Someone knows how to do this? Many thanks! ...

attribute size not changed in mapping view
I changed the size of an attribute to 50 but when I go to relationships and try to map the attribute I see the size in ( ) as 100 still and I get an error message stating the source entity attribute is too large to map to the target entity attribute. I am trying to map a new attribute new_building from account to billto_line2 in order request form. The new attribute was originally created with maximum length of 100 but I have changed the length to 50. I can go into attributes and see the maximum length as 50. Billto_line2 is nvar 50. I am running CRM 3.0. I published all my changes a...