Sign in to follow this  
Followers 0
confucion

Help converting code...

11 posts in this topic

Read that this method doesn't work any more and strings need to be concactenated, what's the best way to convert this old code?

CODE
GUICtrlSetData(-1,"_

Option A| _

-------------------------------------------|_

Option B| _

-------------------------------------------|_

Option C| _

")

Change it to:

CODE
$newformat = "Option A| _"

$newformat = $newformat & "-------------------------------------------|_"

$newformat = $newformat & "Option B| _"

$newformat = $newformat & "-------------------------------------------|_"

$newformat = $newformat & "Option C| _"

GUICtrlSetData(-1, $newformat)

Or is there another way I don't know of? :P

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

ur first way works u just need to put quotes around each line but not around the _ and dont forget the & sign & _

Edited by Thatsgreat2345

Share this post


Link to post
Share on other sites

$string = 'string'  & _
        'string' & _
        'string' & _
        'string'
MsgBox(0, '', $string)

Perhaps the easiest method as Thatsgreat2345 suggests.

:P

Share this post


Link to post
Share on other sites

Thatsgreat2345,

You said my old code works, just need to reformat it differently. So would it look like this? :P

CODE
'GUICtrlSetData(-1,"' & _

'Option A|' & _

'-------------------------------------------|' & _

'Option B|' & _

'-------------------------------------------|' & _

'Option C|' & _

'")'

Share this post


Link to post
Share on other sites

Also, I read there is a 4000 byte limit, what if I need more? Tks

Share this post


Link to post
Share on other sites

#6 ·  Posted (edited)

no no ' and " are interchangeable and dont put quotes around the ) it closes the statement

and you dont put it around the function thats calling it a string of data which it isnt

and what is your plan on achieving a 4000 byte limit?

GUICtrlSetData(-1,_
'Option A|' & _
'-------------------------------------------|' & _
'Option B|' & _
'-------------------------------------------|' & _
'Option C|')
Edited by Thatsgreat2345

Share this post


Link to post
Share on other sites

ah, got it. Tks.

As for the 4K limit, I'm already using 2000 bytes already since I have a combo menu with long option names and many options. Is there anyway around this in case I ever pass this limit? I don't think I will pass the limit but knowing that there is a solution IN CASE I ever do would be nice :P

Share this post


Link to post
Share on other sites

I was un-aware of this 4000 byte limit care to point me in the direction of where you got your information.

Share this post


Link to post
Share on other sites

I was un-aware of this 4000 byte limit care to point me in the direction of where you got your information.

Think I misread one of the old posts, nevermind, don't think there is this limit.

Share this post


Link to post
Share on other sites

There is limit 4096 controls in AutoIt GUI. It's related also to ListView items created by GUICtrlCreateListViewItem() because this function creates control (with it's control ID).

And a 4095 Char limit on lines.

Remarks

Maximum string length is 2147483647 characters (but keep in mind that no line in an AutoIt script can exceed 4095 characters.)

a string will be converted to a binaryString when concatenating a Chr(0)


[center]Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.[/center]

Share this post


Link to post
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
Sign in to follow this  
Followers 0