Forum Discussion
BIG-IP 11.5.2 - PROCs - passing by reference
TCL has a keyword named upvar which is supported in Big IP 11.4.x. This is similar to using pass by reference. But this does not seem to be working for me. In the below case, the value of {test_var} should be 10 after the call to the proc. Instead It is still 1. Am I missing something? Is there a workaround?
Proc
proc testproc_byref { {test_var}} {
upvar 1 $test_var var
set var 10
log local0. "Inside the proc by ref. Setting its value to 10"
log local0. "test_var ${test_var}"
}
Caller
call TEST_LIB::testproc_byref ${test_var}
log local0. "AFTER calling the proc test_var : ${test_var}"
Output
Before calling the proc test_var : 1
Inside the proc by ref. Setting its value to 10
test_var 1
AFTER calling the proc test_var : 1
call TEST_LIB::testproc_byref ${test_var}
shouldn't it be test_var rather than $test_var?
4 Replies
- nitass_89166
Noctilucent
call TEST_LIB::testproc_byref ${test_var}
shouldn't it be test_var rather than $test_var?
- Ashish_Gupta_15
Nimbostratus
That was it. Thanks.
- nitass
Employee
call TEST_LIB::testproc_byref ${test_var}
shouldn't it be test_var rather than $test_var?
- Ashish_Gupta_15
Nimbostratus
That was it. Thanks.
Recent Discussions
Related Content
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com