-
Notifications
You must be signed in to change notification settings - Fork 0
Constants
sancalle edited this page Oct 14, 2022
·
5 revisions
const CONST_VALUE: string = "THIS IS A CONSTANT";
In C# those are wrapped into a static class
namespace Codeverter
{
public static class Helper
{
public const string CONST_VALUE = "THIS IS A CONSTANT";
}
}
public const string CONST_VALUE = "THIS IS A CONSTANT";
public const int CONST_VALUE = 1;
public const bool CONST_VALUE = true;
public static readonly int[] NUMBERS = new int[] { 1, 2, 3 };
public static readonly string[] ANIMALS = new string[] { "cat", "dog", "horse" };
public static readonly DateTime CONST_VALUE = new DateTime(); // original constant assignation as comment
public static readonly Foo CONST_VALUE = null; // original constant assignation as comment
package codeverter
const CONST_VALUE string = "THIS IS A CONSTANT"
const CONST_VALUE string = "THIS IS A CONSTANT"
const CONST_VALUE int = 1
const CONST_VALUE bool = true
var NUMBERS []int = []int{1, 2, 3}
var ANIMALS []string = []string{"cat", "dog", "horse"}
var CONST_VALUE time.Time = time.Now() // original constant assignation as comment
var CONST_VALUE Foo // original constant assignation as comment
In Visual Basic those are wrapped into a Module
Namespace Codeverter
Module Helper
Const CONST_VALUE As String = "THIS IS A CONSTANT"
End Module
End Namespace
Const CONST_VALUE As String = "THIS IS A CONSTANT"
Const CONST_VALUE As Integer = 50
Const CONST_VALUE As Boolean = true
ReadOnly CONSTANTG As Integer() = { 1, 2, 3 }
ReadOnly CONSTANTG As String() = { "cat", "dog", "horse" }
ReadOnly CONSTANT As Date = new DateTime() 'new Date()
ReadOnly CONSTANT As Foo = New Foo() 'new Foo()
Supported. For example:
const CONST_VALUE = "THIS IS A CONSTANT";
public const string CONST_VALUE = "THIS IS A CONSTANT";
const CONST_VALUE string = "THIS IS A CONSTANT"
Const CONST_VALUE As String = "THIS IS A CONSTANT"