0

hi

im new to writing functions - still havent gotten to classes yet :) and having some trouble understanding which function can access which variable...

i have declared an array outside of any function... then i call a function, pass it a list(array) of urls and need to cycle the list and compare values to the array i declared outside to check that there are no matches... but the function doesn't seem to have access to that array?!

thanks

3
Contributors
3
Replies
4
Views
7 Years
Discussion Span
Last Post by network18
0

hi

thanks for the info, im disappointed that there isn't direct access, but i guess in a big system things could get out of hand :)

i decided to pass the array from function to function... then i rethought things and made a new function and rather just call it to do the check

0

the variables inside the functions are meant to be local to that function and the vairable outside it wen we pass it to the function through the function call, they are just copied to the local context of that function's local parameters
and not to confuse yourself with the local and the global parameters

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.