Home > Net >  VB.net has a function array?
VB.net has a function array?

Time:10-05

To define a 2 d array in vb.net, element to address function, main implementation
Click on the radio button to call the radio button value function of the corresponding subscript
Similar to the following code defines (was written by Delphi before, now want to go to vb.net)
Procedure initfunctionarray ();//function array initialization
The begin
Setlength (functionarray, 3);
Setlength (functionarray [0], 12);
Setlength (functionarray [1], 5);
Setlength (functionarray [2], 15);
Functionarray [0, 0] :=GetDocTitle;
Functionarray [0, 1] :=GetDocTopic;
Functionarray [0, 2] :=GetDocKeywords;
Functionarray [0, 3] :=GetDocRemark;
Functionarray [0, 4] :=GetPageWidth;
Functionarray [0, 5) :=GetPageHeight;
Functionarray [0, 6] :=GetPageLeftMargin;
Functionarray [0, 7] :=GetPageRightMargin;
Functionarray: [0]=GetPageTopMargin;
Functionarray [0, 9] :=GetPageBottomMargin;
Functionarray [0, 10] :=GetPageHeader;
Functionarray [0] 11:=GetPageFooter;
Functionarray [1, 0] :=GetParaghLeft;
Functionarray [1, 1] :=GetParaghRight;
Functionarray [1, 2] :=GetParaghAbove;
Functionarray [1, 3] :=GetParaghbelow;
Functionarray [1, 4] :=GetParaghLineSpace;
Functionarray [2, 0] :=GetTextFontName;
Functionarray [2, 1] :=GetTextFontSize;
Functionarray [2] :=GetTextChineseFontName;
Functionarray [2, 3] :=GetTextChineseFontSize;
Functionarray [2, 4] :=GetTextFontColor;
Functionarray [2, 5) :=GetTextFontBackColor;
Functionarray [2, 6] :=GetTextFontWeight;
Functionarray [2, 7] :=GetTextFontPosture;
Functionarray [2] :=GetTextFontUnderLine;
Functionarray [2, 9] :=GetTextCrossedOut;
Functionarray [2, 10] :=GetTextFontShadow;

CodePudding user response:

You don't declare your all "function" of the input and output of the same type definition, so the title of the party might be confused on the design, the design of the simple and crude can be like this:
 Sub test () 
Dim As a New List (Of Func (Of Object))
A.A dd (Function ()
Return Me. ABC () * 10
End Function)
End Sub

ABC () Function As Integer
Return 1
End the Function

CodePudding user response:

Of course, if is declared as an array
 Sub test () 
Dim a (10, 10) As Func (Of Object)
A (0, 1)=Function ()
Return Me. ABC () * 10
End the Function
End Sub

ABC () Function As Integer
Return 1
End the Function


Here because you did not specify input and output model, it is assumed that defined as input parameters of the Function, can actually be optional writing complex code in the Function body, and assuming that the output is just an Object, the Object type
  • Related