Jump to content

Help converting code...


 Share

Recommended Posts

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

Link to comment
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|' & _

'")'

Link to comment
Share on other sites

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
Link to comment
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

Link to comment
Share on other sites

  • Moderators

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)

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.

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