Jump to content
UBot Underground

Change a list item?


Recommended Posts

I do this sort of thing in PHP all the time but I'm not sure it can be done in UBot, but it sure would be useful.

 

Here's pseudocode:

 

foreach(list item)

{

if item is empty

change item to equal "n/a"

}

 

The loop part is easy, but I don't think we can change a value in a list on the fly like this... can we? Anyone?

 

Jonathan

Link to post
Share on other sites

Off the top of my head, you would want something like

 

Loop List Total = OriginalList

 

>Set CurrentItem (Var) = Next List Item (OriginaList)

 

>If

 

>>Eval

 

>>>CurrentItem = $nothing

 

>>Set CurrentItem

 

>>>n/a

 

>Add to list, AlteredList

 

>>CurrentItem

 

 

After you exit the loop,

 

You could set OriginalList to AlteredList if you need to maintain the original list name.

 

Something like this, maybe.

Link to post
Share on other sites

Yep that's more or less what I ended up doing... using more than one list. Ideally I'd love to just edit the list being parsed as you can in a true programming language, but I don't think UBot can handle that. This workaround gets the job done though!

 

Jonathan

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...