WriteOK5.ModuleSub("Qualified") ' 122
ModuleSub("Unqualified") ' 103
+ Another.WriteOK6.ModuleSub("Qualified") ' 122
+ Another.ModuleSub("SemiQualified") ' 103
+
Console.WriteLine(Strings.ChrW(64))
Console.Write("Positive cases for IsNumeric: ")
Console.WriteLine("ModuleSub:OK! (" & Parm & ")")
End Sub
End Module
+
+Namespace Another
+
+Public Module WriteOK6
+ Public Sub ModuleSub(Parm As String)
+ Console.WriteLine("Another.ModuleSub:OK! (" & Parm & ")")
+ End Sub
+End Module
+
+End Namespace
///
private static void AddStandardModule(Type type)
{
- int top = standardModules != null ? standardModules.Length : 0;
- StandardModule [] n = new StandardModule [top + 1];
+ object[] attributes = type.GetCustomAttributes(false);
+ for (int i = 0; i < attributes.Length; i ++) {
+ if (attributes[i].ToString() == "Microsoft.VisualBasic.CompilerServices.StandardModuleAttribute") {
+ int top = standardModules != null ? standardModules.Length : 0;
+ StandardModule [] n = new StandardModule [top + 1];
- if (standardModules != null)
- standardModules.CopyTo (n, 0);
- n [top] = new StandardModule(type.Namespace, type.Name) ;
- standardModules = n;
+ if (standardModules != null)
+ standardModules.CopyTo (n, 0);
+ n [top] = new StandardModule(type.Namespace, type.Name) ;
+ standardModules = n;
+
+ return;
+ }
+ }
}
//