Burgaud Posted February 25, 2018 Share Posted February 25, 2018 (edited) I have a function that returns 4 data as an array like: func CreateToolTip() local $handle[4] $handle[0] = ... $handle[1] = ... $handle[2] = ... $handle[3] = ... return($handle) endfunc And use it without problem: GLOBAL $MainToolTip = CreateToolTip (....) . . . PrintToolTip($MainToolTip......) Now I have an Array GLOBAL $Hidden[3] My purpose of this Hidden[3] array is to contain three(3) sets of data returned by CreateToolTops, ie: for $i = 1 to 3 $Hidden[$i] = CreateToolTip(...) next However, I am getting: Error: Array variable has incorrect number of subscripts or subscript dimension range exceeded. What to do? define $Hidden as GLOBAL $Hidden[3][4]? Then Hidden[$i] = CreateToolTip? Edited February 25, 2018 by Burgaud Link to comment Share on other sites More sharing options...
iamtheky Posted February 25, 2018 Share Posted February 25, 2018 Arrays are 0 based, count 0 to 2 instead of 1 to 3. ,-. .--. ________ .-. .-. ,---. ,-. .-. .-. .-. |(| / /\ \ |\ /| |__ __||| | | || .-' | |/ / \ \_/ )/ (_) / /__\ \ |(\ / | )| | | `-' | | `-. | | / __ \ (_) | | | __ | (_)\/ | (_) | | .-. | | .-' | | \ |__| ) ( | | | | |)| | \ / | | | | | |)| | `--. | |) \ | | `-' |_| (_) | |\/| | `-' /( (_)/( __.' |((_)-' /(_| '-' '-' (__) (__) (_) (__) Link to comment Share on other sites More sharing options...
Burgaud Posted February 25, 2018 Author Share Posted February 25, 2018 16 minutes ago, iamtheky said: Arrays are 0 based, count 0 to 2 instead of 1 to 3. facepalm thanks Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now