harinder Active Member Licensed User Longtime User Aug 17, 2018 #1 I am unable to make out the correct syntax for replacing an item in a list with two strings having a colon in between. I tried: List1.set( 3, ""&RED& ":" &GREEN&"") Not working.
I am unable to make out the correct syntax for replacing an item in a list with two strings having a colon in between. I tried: List1.set( 3, ""&RED& ":" &GREEN&"") Not working.
DonManfred Expert Licensed User Longtime User Aug 17, 2018 #2 Add the new item at tje desired postion and remove the next item after the inserted Or kust replace the item at tje desired index. There is no replace Search the right index based on the item you want to replace. Use set on this infex then Suggestion. Lrarn the öanguage/how to code Upvote 0
Add the new item at tje desired postion and remove the next item after the inserted Or kust replace the item at tje desired index. There is no replace Search the right index based on the item you want to replace. Use set on this infex then Suggestion. Lrarn the öanguage/how to code
harinder Active Member Licensed User Longtime User Aug 17, 2018 #3 DonManfred said: Add the new item at tje desired postion and remove the next item after the inserted Or kust replace the item at tje desired index. There is no replace Search the right index based on the item you want to replace. Use set on this infex then Suggestion. Lrarn the öanguage/how to code Click to expand... I was just going through documentation for list. It says: Set (Index As Int, Item As Object) Replaces the current item in the specified index with the new item. So can you please tell me correct syntax for replacing an item at index 3? List1.set( 3, ""&RED& ":" &GREEN&"") is not working !! Upvote 0
DonManfred said: Add the new item at tje desired postion and remove the next item after the inserted Or kust replace the item at tje desired index. There is no replace Search the right index based on the item you want to replace. Use set on this infex then Suggestion. Lrarn the öanguage/how to code Click to expand... I was just going through documentation for list. It says: Set (Index As Int, Item As Object) Replaces the current item in the specified index with the new item. So can you please tell me correct syntax for replacing an item at index 3? List1.set( 3, ""&RED& ":" &GREEN&"") is not working !!
klaus Expert Licensed User Longtime User Aug 17, 2018 #4 Use this: List1.Set(3, "RED:GREEN") or this: List1.Set(3, "RED" & ":" & "GREEN") Upvote 0
harinder Active Member Licensed User Longtime User Aug 17, 2018 #5 klaus said: Use this: List1.Set(3, "RED:GREEN") or this: List1.Set(3, "RED" & ":" & "GREEN") Click to expand... Thanks Klaus..and if I want to replace with gg:hh, where gg and hh are two strings representing 2 digit integers, then will it be: List1.Set(3, &gg& & ":" & &hh&)? Thnx.. Upvote 0
klaus said: Use this: List1.Set(3, "RED:GREEN") or this: List1.Set(3, "RED" & ":" & "GREEN") Click to expand... Thanks Klaus..and if I want to replace with gg:hh, where gg and hh are two strings representing 2 digit integers, then will it be: List1.Set(3, &gg& & ":" & &hh&)? Thnx..
klaus Expert Licensed User Longtime User Aug 17, 2018 #6 If gg and hh are String variables then: List1.Set(3, gg & ":" & hh) if gg and hh are Int variables then: List1.Set(3, NumberFormat(gg, 2, 0) & ":" & NumberFormat(hh, 2, 0)) Upvote 0
If gg and hh are String variables then: List1.Set(3, gg & ":" & hh) if gg and hh are Int variables then: List1.Set(3, NumberFormat(gg, 2, 0) & ":" & NumberFormat(hh, 2, 0))
harinder Active Member Licensed User Longtime User Aug 17, 2018 #7 klaus said: If gg and hh are String variables then: List1.Set(3, gg & ":" & hh) if gg and hh are Int variables then: List1.Set(3, NumberFormat(gg, 2, 0) & ":" & NumberFormat(hh, 2, 0)) Click to expand... Thank you Klaus..That makes it very clear. Upvote 0
klaus said: If gg and hh are String variables then: List1.Set(3, gg & ":" & hh) if gg and hh are Int variables then: List1.Set(3, NumberFormat(gg, 2, 0) & ":" & NumberFormat(hh, 2, 0)) Click to expand... Thank you Klaus..That makes it very clear.
udg Expert Licensed User Longtime User Aug 18, 2018 #8 Have a look at Smart String Literals too. It will be something like: List1.Set(3, $"${gg}:${hh}"$) or their NumberFormat equivalent. Upvote 0
Have a look at Smart String Literals too. It will be something like: List1.Set(3, $"${gg}:${hh}"$) or their NumberFormat equivalent.
harinder Active Member Licensed User Longtime User Aug 18, 2018 #9 udg said: Have a look at Smart String Literals too. It will be something like: List1.Set(3, $"${gg}:${hh}"$) or their NumberFormat equivalent. Click to expand... Thank You... Upvote 0
udg said: Have a look at Smart String Literals too. It will be something like: List1.Set(3, $"${gg}:${hh}"$) or their NumberFormat equivalent. Click to expand... Thank You...