Jump to content

Code stopped working when i chaned file location


Recommended Posts

In order to make the pics go with me i made this code

#include "image_get_size_jpeg.au3"

$plainpic = @tempDir & "Sigstuff\Plain.jpg"
$openpic = @tempDir & "Sigstuff\06open.jpg"
$invpic =  @tempDir & "Sigstuff\inv_conf_05.jpg"

FileInstall ( "Plain.jpg" , $plainpic , 1 )
FileInstall ( "06open.jpg" , $openpic , 1 )
FileInstall ( "inv_conf_05.jpg" , $invpic , 1 )

;gets the image's resolution
$PlainSize = _ImageGetSizeJPG( $plainpic )
$OpenSize = _ImageGetSizeJPG( $openpic )
$InvSize = _ImageGetSizeJPG( $invpic )

$tab=GUICtrlCreateTab (-1,-1, 2000,1000)

$tab0=GUICtrlCreateTabitem ("Template")
;this tab has the user select the template they wish to use for their signature.
$plain = GUICtrlCreateRadio ("Plain", 8, 40, 50, 20)
$fbropen = GUICtrlCreateRadio ("FBR Open 2006", 60, 40, 110, 20)
$investor = GUICtrlCreateRadio ("Investor Conference", 175, 40, 130, 20)
$plain_pic  = GUICtrlCreatePic ( $plainpic , 25, 100, $PlainSize[0], $PlainSize[1])
$fbropen_pic  = GUICtrlCreatePic ($openpic, 25, 100, $OpenSize[0], $OpenSize[1])
$investor_pic = GUICtrlCreatePic ($invpic, 25, 100, $InvSize[0], $InvSize[1])

and i get this error

C:\Documents and Settings\tatlas\Desktop\Signatures Autoit\prelim script.au3 (44) : ==> Subscript used with non-Array variable.:

$plain_pic    = GUICtrlCreatePic ( $plainpic , 25, 100, $PlainSize[0], $PlainSize[1])

$plain_pic    = GUICtrlCreatePic ( $plainpic , 25, 100, $PlainSize^ ERROR

it works fine when i just run the images from the script directory, i cant confirm if it is installing the files propperly though.

Thx for even more help :)

image_get_size_jpeg.au3

Edited by Swimming_BIrd
Link to comment
Share on other sites

looks like you're defining the variable as an integer and not an array...

$PlainSize = _ImageGetSizeJPG( $plainpic )

$OpenSize = _ImageGetSizeJPG( $openpic )

$InvSize = _ImageGetSizeJPG( $invpic )

are integers and you're trying to use them as arrays...

If my posts or emails are not in the correct format, too bad! Technology is my territory!My Programming Page (I need members!):http://doublexlegion.gwgaming.net/

Link to comment
Share on other sites

looks like you're defining the variable as an integer and not an array...

$PlainSize = _ImageGetSizeJPG( $plainpic )

$OpenSize = _ImageGetSizeJPG( $openpic )

$InvSize = _ImageGetSizeJPG( $invpic )

are integers and you're trying to use them as arrays...

<{POST_SNAPBACK}>

they are arrays cuz when i just change the pic dir to the script's dir (which has the pics in it) it runs fine.
Link to comment
Share on other sites

You state this

FileInstall ( "Plain.jpg" , $plainpic , 1 )

Help states this

FileInstall ( "source", "dest" [, flag] )

Parameters

source The source path of the file to compile. This must be a literal string; it cannot be a variable.

if you want to "Install files" what you used is ok, if the script and pics are in the same directory otherwise

FileInstall(C:\mydirectory\plain.jpg.....

this must be C:\......

not a variable

FileInstall is for compiling a script, if you are just "running" as an AU3 it does a "file copy" routine... you can check this

Hope it helps

8)

Edited by Valuater

NEWHeader1.png

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