Jump to content

Array Return Trouble


buzz44
 Share

Recommended Posts

hmmmmmmmmmm..... when i run this

$Adv_Colour = DllCall ("AU3Xtra.dll", "int", "ChooseColorDialog", "hwnd", 0)
$Adv_Colour_Red = Hex ($Adv_Colour[0], 2)
$Adv_Colour_Green = Hex ($Adv_Colour[1], 2)
$Adv_Colour_Blue = Hex ($Adv_Colour[2], 2)
GUICtrlSetData($Input_Hex,"0x" & $Adv_Colour_Red & $Adv_Colour_Green & $Adv_Colour_Blue)

i get this error ...

Error : Subscript used with non-array variable
$Adv_Colour_Red = Hex ($Adv_Colour[0], 2)
$Adv_Colour_Red = Hex ($Adv_Colour^

i dont get it .. i tested it in another script with 2 arrays .. ie [0] and [1] and it worked but as soon as i added array [3] i get a different error.. lik

Error: array variable has incorrect number of subscripts or subscript dimension range exceeded.

idk wats wrong =( .. any help plz =)

qq

Link to comment
Share on other sites

Seems like AutoIt thinks of possible errors in the DllCall

This worked here:

$Adv_Colour = DllCall ("AU3Xtra.dll", "int", "ChooseColorDialog", "hwnd", 0)
If Not @error Then
    $Adv_Colour_Red = Hex ($Adv_Colour[0], 2)
    $Adv_Colour_Green = Hex ($Adv_Colour[1], 2)
    $Adv_Colour_Blue = Hex ($Adv_Colour[2], 2)
    GUICtrlSetData($Input_Hex,"0x" & $Adv_Colour_Red & $Adv_Colour_Green & $Adv_Colour_Blue)
EndIf
Link to comment
Share on other sites

yeah, it worked in a sciprt by itself but when i added it to my script which is doing other functions and stuff it doesnt do anything ..... would u like me to post the whole code? . its big so i think i will add attachment..

thx

qq

Link to comment
Share on other sites

  • Developers

yeah, it worked in a sciprt by itself but when i added it to my script which is doing other functions and stuff it doesnt do anything ..... would u like me to post the whole code? . its big so i think i will add attachment..

thx

<{POST_SNAPBACK}>

Is the ChooseColorDialog displayed before you get the error ?

Are you sure that your dllcall isn't failing because it cannot find the dll?

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

when i include the small script above in my bigger script when its running other things etc .. the ChooseColourDialog doesnt display at all.. nothing happens no error or anything .. but when i rune it in a seperate script ... independly with that being the only thing in the script it works fine ... ive atachment my code to this reply

Edited by burrup

qq

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...