toby Well-Known Member Licensed User Longtime User Sep 30, 2022 #1 Code: Log($"The time is: ${DateTime.Time(DateTime.now)}"$) 'correct one' 'following two incorrect lines don't cause any error or warning: Log("The time is: ${DateTime.Time(DateTime.now)}"$) 'missing the starting $ Log($"The time is: ${DateTime.Time(DateTime.now)}") 'missing the ending $
Code: Log($"The time is: ${DateTime.Time(DateTime.now)}"$) 'correct one' 'following two incorrect lines don't cause any error or warning: Log("The time is: ${DateTime.Time(DateTime.now)}"$) 'missing the starting $ Log($"The time is: ${DateTime.Time(DateTime.now)}") 'missing the ending $
M Mahares Expert Licensed User Longtime User Oct 1, 2022 #2 All these 4 are identical. and correct They yield the same word Code: Log("toby"$$) 'toby Log("toby"$) 'toby Log($"toby"$) 'toby Log($"toby"$$) 'toby This one yields: string not closed error like the 3rd log line in the 1st post : Code: Log($"toby")
All these 4 are identical. and correct They yield the same word Code: Log("toby"$$) 'toby Log("toby"$) 'toby Log($"toby"$) 'toby Log($"toby"$$) 'toby This one yields: string not closed error like the 3rd log line in the 1st post : Code: Log($"toby")
toby Well-Known Member Licensed User Longtime User Oct 1, 2022 #3 The problem is that the variables wouldn't be replaced with the value they contain. For example B4X: Log("The time is: ${DateTime.Time(DateTime.now)}"$) 'The above line outputs: "The time is: ${DateTime.Time(DateTime.now) 'while "The time is: 12:34:56", or similar, is expected.
The problem is that the variables wouldn't be replaced with the value they contain. For example B4X: Log("The time is: ${DateTime.Time(DateTime.now)}"$) 'The above line outputs: "The time is: ${DateTime.Time(DateTime.now) 'while "The time is: 12:34:56", or similar, is expected.
toby Well-Known Member Licensed User Longtime User Oct 1, 2022 #4 I guess it wouldn't be too hard to implement: For each $", there should be a matching "$, and vice versa.
I guess it wouldn't be too hard to implement: For each $", there should be a matching "$, and vice versa.
toby Well-Known Member Licensed User Longtime User Oct 1, 2022 #5 To err is human, so I hope the IDE would catch my mistake.
Erel B4X founder Staff member Licensed User Longtime User Oct 2, 2022 #6 Remember that smart strings are multiline. The ending mark doesn't need to be on the same line.