Hi all,
this is my job
static void Job218(Args _args) { SalesTable SalesTable; str message; while select SalesTable where SalesTable.SalesStatus == SalesStatus::Delivered { message = message + strFmt("%1,",SalesTable.SalesId); } print(message); pause; }
here in the output in message i am getting an extra comma which i want to remove so that my message looks like
message = "a,b,c,d" not like "a,b,c,d,"(the extra comma after d in the message )
*This post is locked for comments
I think it's better if you don't insert the last comma in the first place. Do it like this:
static void Job218(Args _args) { SalesTable SalesTable; str message; boolean firstLine = true; while select SalesTable where SalesTable.SalesStatus == SalesStatus::Delivered { if (firstLine) { message = strFmt(%1",SalesTable.SalesId); firstLine = false; } else { message = message + strFmt(", %1",SalesTable.SalesId); } } print(message); pause; }
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.
André Arnaud de Cal... 291,253 Super User 2024 Season 2
Martin Dráb 230,188 Most Valuable Professional
nmaenpaa 101,156