Jump to content
UBot Underground

Recommended Posts

I've read many posts on the topic and still think it could use some explanation or official documentation. I think this is how they work, but would appreciate confirmation.

 

 

LOCAL VARIABLE IN A:

 

1. "Define" command/function - stays local and only commands inside this container can interact with the variable's value, unless you pass or return it.

 

 

2. A 2nd "define" command within another "define" command - even though this 2nd custom command is inside the top "defined" command, the local variables within the top container are not available to the 2nd command unless you pass the local variables into it.

 

 

3. "thread" command - A local variable set in a thread is not isolated from other threads. A change to a variable in one thread will result in a change for the other threads. Also, the local variable is available to the "parent" container(s).

 

 

4. "in new browser" command - A local variable set in a thread is not isolated from other "new browsers". A change to a variable in one "new browser" will result in a change for the other threads. Also, the local variable is available to the "parent" container(s).

 

 

5. "loop" / "loop while" - local variables are not isolated. A local variable's contents in a loop container are not discarded and are available to the parent container(s).

 

 

6. "if" - local variables are not isolated. A local variable's contents in a "if" container are not discarded and are available to the parent container(s).

 

 

 

TLDR; Local variables are only local to defined commands.

 

 

Is this correct?

Link to post
Share on other sites

I would say your pretty close to having that correct. Not positive but sounds like it to me.

 

4. "in new browser" command - All I know about this one is that you have to define the command outside of the in new browser command if you want your command to work inside of the new browser. And a new browser does not have the cookies like in shared browser. ok I am not sure...

 

good question - need one of the pros to answer this.

Link to post
Share on other sites

LOOPs and IFs are not considered 'containers' for Global/Local behavior, neither threads and new browsers.

The custom commands/functions in UBS - the DEFINEs - would keep the Local variables confined within their boundaries, so their values would not be available outside.

 

You CAN, however, push out a value of a local variable from within a DEFINE function, by using the RETURN command.

Link to post
Share on other sites
  • 1 year later...

Regarding: 2. A 2nd "define" command within another "define" command - even though this 2nd custom command is inside the top "defined" command, the local variables within the top container are not available to the 2nd command unless you pass the local variables into it.

 

How do you pass the top defined variables to the 2nd define command?

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...