ThRuST Well-Known Member Licensed User Longtime User Jan 25, 2018 #1 I'd like that someone can explain how to use the string ${''} works and how it can be used? also refer to a tutorial on this. Thanks
I'd like that someone can explain how to use the string ${''} works and how it can be used? also refer to a tutorial on this. Thanks
Daestrum Expert Licensed User Longtime User Jan 25, 2018 #2 It's a shortcut to allow you to place variables inside a $"..."$ string. Instead of having to write B4X: Log("This is the time : [" & DateTime.Time(DateTime.now) & " ]") You can write B4X: Log($"This is the time : [ ${DateTime.Time(DateTime.now)} ]"$) Upvote 0
It's a shortcut to allow you to place variables inside a $"..."$ string. Instead of having to write B4X: Log("This is the time : [" & DateTime.Time(DateTime.now) & " ]") You can write B4X: Log($"This is the time : [ ${DateTime.Time(DateTime.now)} ]"$)
ThRuST Well-Known Member Licensed User Longtime User Jan 25, 2018 #3 Thanks, your example was as clear as it could be I've seen a similar handling for C sharp years ago, it was a new invention. Nice to be able to use it with B4X as well. Upvote 0
Thanks, your example was as clear as it could be I've seen a similar handling for C sharp years ago, it was a new invention. Nice to be able to use it with B4X as well.
Cableguy Expert Licensed User Longtime User Jan 25, 2018 #4 https://www.b4x.com/android/forum/threads/b4x-smart-string-literal.50135/ Upvote 0
DonManfred Expert Licensed User Longtime User Jan 25, 2018 #5 Daestrum said: You can write Click to expand... It is more easy B4X: Log($"This is the time : [$time{DateTime.now}]"$) B4X: Log($"This is the date : [$date{DateTime.now}]"$) Upvote 0
Daestrum said: You can write Click to expand... It is more easy B4X: Log($"This is the time : [$time{DateTime.now}]"$) B4X: Log($"This is the date : [$date{DateTime.now}]"$)
ThRuST Well-Known Member Licensed User Longtime User Jan 25, 2018 #6 ok so just to make it simple the [ ] chars is not neccessary it's just a decoration thing, just to clearlfy Don Manfred's example, anyway thanks This is a good start, keep posting some more examples since this is a complex matter I made Don Manfreds complicated code alot easier haha B4X: Log($"This current date is $date{DateTime.now} and the time is $time{DateTime.now}"$) Upvote 0
ok so just to make it simple the [ ] chars is not neccessary it's just a decoration thing, just to clearlfy Don Manfred's example, anyway thanks This is a good start, keep posting some more examples since this is a complex matter I made Don Manfreds complicated code alot easier haha B4X: Log($"This current date is $date{DateTime.now} and the time is $time{DateTime.now}"$)
ThRuST Well-Known Member Licensed User Longtime User Jan 25, 2018 #7 And I should point out that when using this with CSS a HTML tag must always start with < and end with > Objections anyone? B4X: $" <code goes here blabla ${variable1} blalba ${variable2}> "$ Reminds me of Ajax/Cordova/JQuery calls even Angular. Upvote 0
And I should point out that when using this with CSS a HTML tag must always start with < and end with > Objections anyone? B4X: $" <code goes here blabla ${variable1} blalba ${variable2}> "$ Reminds me of Ajax/Cordova/JQuery calls even Angular.
DonManfred Expert Licensed User Longtime User Jan 25, 2018 #8 ThRuST said: just to clearlfy Don Manfred's example Click to expand... NO. I just extended @Daestrum example from #2 But yes, it is only decorative Upvote 0
ThRuST said: just to clearlfy Don Manfred's example Click to expand... NO. I just extended @Daestrum example from #2 But yes, it is only decorative