Funzioni







Abs System.Math.Abs
Array System.Collections.ArrayList
Asc Char.ConvertToUtf32(string,0)
Atn System.Math.Atan System.Math.Atan2

CallByName System.Reflection.MethodBase.Invoke
Choose sostituibile dalla normale estrazione dell'elemento 'scelto'. Questo e' un esempio 'complicato': Dim ss As Object() = {"1", 2, 14, "alfa"} Dim al As New ArrayList(ss) Dim s As String = al(1).ToString ' "2"
Chr Char.ConvertFromUtf32
Command My.Application.CommandLineArgs
Cos System.Math.Cos System.Math.Cosh System.Math.Acos
CreateObject si usa New nella dichiarazione
CurDir My.Computer.FileSystem.CurrentDirectory
CVErr non applicabile

Date DateTime.Today
DateAdd DateTime.Add
DateDiff DateTime.Subtract
DatePart tranne che per il trimestre, DateTime espone membri per ottenere le varie info su una data.
DateSerial si usa uno dei costruttori di DateTime
DateValue DateTime.Parse
Day data.Day
DDB -
Dir System.IO.Directory.GetFileSystemEntries System.IO.Directory.GetFileSystemInfos
DoEvents System.Windows.Forms.Application.DoEvents()

Environ System.Environment.GetEnvironmentVariable
EOF vari modi, a seconda dell'oggetto usato. A esempio, (TextReader.Peek = -1)
Error non applicabile
Exp System.Math.Exp

FileAttr System.IO.File.GetAttributes System.IO.File.SetAttributes
FileDateTime System.IO.File espone vari metodi per leggere e scrivere le varie date di creazione accesso o scrittura
FileLen System.IO.FileInfo.Length
Filter sostituibile con vario codice. A esempio con LINQ: Dim stringhe() As String = {"qualcosa", "dell'altro", "cosacco"} Dim filtrato As IEnumerable(Of String) = From el In stringhe _ Where el.Contains("cosa") _ Select el
Fix System.Math.Floor System.Math.Truncate
Format variabile.ToString(formato)
FormatCurrency variabile.ToString("C")
FormatDatetime vari metodi del tipo data. A esempio Dim d As DateTime = DateTime.Now Dim s As String = d.ToShortDateString
FormatNumber variabile.ToString(formato)
FormatPerCent variabile.ToString("P")
FreeFile non applicabile (non serve piu', con oggetti System.IO)
FV -

GetAllSettings My.Computer.Registry.GetValue My.Settings
GetAttr come FileAttr
GetAutoServerSetting - non lo so -
GetObject si usa una normale assegnazione
GetSetting come GetAllSettings

Hex variabile.ToString("X")
Hour data.Hour

Iif l'operatore ternario e' fornito sia da If che da Iif, ma il primo non valuta tutte le espressioni prima di restituire un risultato, bensi' 'cortocircuita' la sua valutazione.
IMEStatus proprieta' IMEMode dei Controls
Input vari metodi Read da oggetti File o Stream
InputBox - non disponibile, ed e' un bene
InStr variabile.IndexOf
InStrRev variabile.LastIndexOf
Int come Fix
IPmt -
IRR -
IsArray variabile.GetType.IsArray
IsDate DateTime.TryParse
IsEmpty variabile.IsEmpty
IsError non applicabile
IsMissing - si testa il valore Nothing o predefinito del parametro Optional. e' preferibile usare piu' overload della stessa procedura senza parametri opzionali
IsNull String.IsNullOrEmpty Convert.IsDbNull
IsNumeric tiponumerico.TryParse(stringa, variabile). Esempio: Dim k As Integer = 0 Dim o As Boolean = Integer.TryParse("32", k)
IsObject non applicabile (qualsiasi cosa in .Net "IsObject" :-)))

Join String.Join

LBound variabile.GetLowerBound
LCase variabile.ToLower
Left variabile.Substring
Len variabile.Length
LoadPicture Image.FromFile
LoadResData My.Resources
LoadResPicture My.Resources
LoadResString My.Resources
Loc System.IO.FileStream.Position
LOF System.IO.FileStream.Length
Log System.Math.Log System.Math.Log10
LTrim variabile.TrimStart

Mid variabile.Substring
Minute data.Minute
MIRR -
Month data.Month
MonthName data.ToString("MMMM") System.Globalization.DateTimeFormatInfo.MonthNames
MsgBox MessageBox

Now DateTime.Now
NPer -
NPV -

Oct -

Partition sostituibile con una query LINQ
Pmt -
PPmt -
PV -

QBColor Color.ToArgb

Rate -
Replace variabile.Replace
RGB Color.FromArgb
Right variabile.Substring
Rnd System.Random.Next
Round System.Math.Round
RTrim oggetto.TrimEnd

Second data.Second
Seek System.IO.FileStream.Seek
Sgn System.Math.Sign
Shell System.Diagnostics.Process.Start
Sin System.Math.Sin System.Math.Sinh System.Math.Asin
SLN -
Space " ".PadLeft
Spc non applicabile
Split variabile.Split
Sqr System.Math.Sqrt
Str variabile.ToString
StrComp String.Compare
StrConv tipo.Parse
String Dim quattroemme As String = "m".PadLeft(4, "m"c)
StrReverse questo esempio usa un metodo extension: Private Function ReversedString(ByVal stringa As String) As String Dim cc As IEnumerable(Of Char) = stringa.ToCharArray.Reverse Return String.Concat(cc.ToArray) End Function
Switch Select Case, query LINQ
SYD -

Tab non applicabile
Tan System.Math.Tan System.Math.Tanh
Time Dim h As New DateTime(1, 1, 1, _ DateTime.Now.Hour, _ DateTime.Now.Minute, _ DateTime.Now.Second)
Timer Dim ts As New TimeSpan(DateTime.Now.Hour, _ DateTime.Now.Minute, _ DateTime.Now.Second) Dim ss As Double = ts.TotalSeconds
TimeSerial Dim h As New DateTime(1, 1, 1, _ ore, _ minuti, _ secondi)
TimeValue DateTime.Parse
Trim oggetto.Trim
Typename GetType.ToString

UBound variabile.GetUpperBound
UCase variabile.ToUpper

Val Double.Parse
VarType GetTypeCode

Weekday data.DayOfWeek
WeekdayName data.ToString("dddd") System.Globalization.DateTimeFormatInfo.DayNames

Year data.Year











( funzioni.html )- by Paolo Puglisi - Modifica del 17/12/2023