Community discussions

MikroTik App
 
User avatar
matrot2
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 79
Joined: Thu Jun 25, 2009 12:34 pm

Problems with functions and probes

Tue Mar 29, 2011 12:52 pm

Hi. Here is an example.
Functions:
name: test_function
code: "aaa"

Probes:
name: test_probe1
available: 1
error: test_function()

name: test_probe2
available: 1
error: if (test_function()="bbb","bbb","not bbb")
results:
test_probe1 - aaa
test_probe2 - bbb

What is that?
And where is a dude function's manual?
 
User avatar
matrot2
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 79
Joined: Thu Jun 25, 2009 12:34 pm

Re: Problems with functions and probes

Wed Mar 30, 2011 9:30 pm

string_compare
compares two strings, returns 0 if equal
Probes:
name: test_compare1
available: 1
error: string_compare("111","111")

name: test_compare2
available: 1
error: string_compare("111","222")

name: test_compare3
available: 1
error: string_compare("aaa","aaa")

name: test_compare4
available: 1
error: string_compare("aaa","bbb")
results:
test_compare1 - 3
test_compare2 - 3
test_compare3 - 3
test_compare4 - 3
 
User avatar
gsandul
Member Candidate
Member Candidate
Posts: 154
Joined: Mon Oct 19, 2009 1:42 pm

Re: Problems with functions and probes

Thu Mar 31, 2011 11:19 am

string_compare does not work properly
use string_find instead
It is bad idea to find what functions return in a probe. Use device appearence label instead.
string_find.png
You do not have the required permissions to view the files attached to this post.
 
User avatar
matrot2
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 79
Joined: Thu Jun 25, 2009 12:34 pm

Re: Problems with functions and probes

Thu Mar 31, 2011 12:56 pm

Thanks, it works.

Who is online

Users browsing this forum: No registered users and 8 guests