netsistemas Active Member Licensed User Longtime User Dec 8, 2018 #1 In this sample to return a time formated i view this especial sintaxis: $"$2..."$ Where are documentatión about this and how to use? B4X: Sub GetTime() As String Dim N As Long n = DateTime.Now Return $"$2{DateTime.GetHour(N)}:$2{DateTime.GetMinute(N)}:$2{DateTime.GetSecond (N)}"$ End Sub
In this sample to return a time formated i view this especial sintaxis: $"$2..."$ Where are documentatión about this and how to use? B4X: Sub GetTime() As String Dim N As Long n = DateTime.Now Return $"$2{DateTime.GetHour(N)}:$2{DateTime.GetMinute(N)}:$2{DateTime.GetSecond (N)}"$ End Sub
DonManfred Expert Licensed User Longtime User Dec 8, 2018 #2 netsistemas said: Where are documentatión about this and how to use? Click to expand... https://www.b4x.com/android/forum/threads/b4x-smart-string-literal.50135/ Upvote 0
netsistemas said: Where are documentatión about this and how to use? Click to expand... https://www.b4x.com/android/forum/threads/b4x-smart-string-literal.50135/
M Mahares Expert Licensed User Longtime User Dec 8, 2018 #3 This is the tutorial: https://www.b4x.com/android/forum/threads/b4x-smart-string-literal.50135/#content Your code can be like this: B4X: Sub GetTime(N As Long) As String Return $"$2{DateTime.GetHour(N)}:$2{DateTime.GetMinute(N)}:$2{DateTime.GetSecond (N)}"$ End Sub B4X: Log(GetTime(DateTime.Now)) 'returns the current time exple: 09:23:35 Upvote 0
This is the tutorial: https://www.b4x.com/android/forum/threads/b4x-smart-string-literal.50135/#content Your code can be like this: B4X: Sub GetTime(N As Long) As String Return $"$2{DateTime.GetHour(N)}:$2{DateTime.GetMinute(N)}:$2{DateTime.GetSecond (N)}"$ End Sub B4X: Log(GetTime(DateTime.Now)) 'returns the current time exple: 09:23:35
mcqueccu Well-Known Member Licensed User Longtime User Dec 8, 2018 #4 Watch the ETP video series Upvote 0