Community discussions

MikroTik App
 
Tal
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 57
Joined: Wed Jun 17, 2015 2:17 am

Using a variable within a string

Wed Jun 17, 2015 5:28 am

How do I use a variable that is immediately followed by a string?
If this is my variable:
:global TEST "192.168.0.1"
and I want to use it like this:
:put $TEST/24
to write "192.168.0.1/24" to the screen, it fails.
Is there a right way to do this?
 
User avatar
PaulsMT
MikroTik Support
MikroTik Support
Posts: 282
Joined: Tue Feb 10, 2015 3:21 pm

Re: Using a variable within a string

Wed Jun 17, 2015 9:52 am

{
:global TEST "192.168.0.1"
:put ("$TEST" . "/24");
}
 
Tal
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 57
Joined: Wed Jun 17, 2015 2:17 am

Re: Using a variable within a string

Wed Jun 17, 2015 1:23 pm

Thanks!