Jump to content

Array into an Array


Burgaud
 Share

Recommended Posts

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 by Burgaud
Link to comment
Share on other sites

Arrays are 0 based, count 0 to 2 instead of 1 to 3.

,-. .--. ________ .-. .-. ,---. ,-. .-. .-. .-.
|(| / /\ \ |\ /| |__ __||| | | || .-' | |/ / \ \_/ )/
(_) / /__\ \ |(\ / | )| | | `-' | | `-. | | / __ \ (_)
| | | __ | (_)\/ | (_) | | .-. | | .-' | | \ |__| ) (
| | | | |)| | \ / | | | | | |)| | `--. | |) \ | |
`-' |_| (_) | |\/| | `-' /( (_)/( __.' |((_)-' /(_|
'-' '-' (__) (__) (_) (__)

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...