Coding

Hello,
I want to know what is the maximum of character can be put in 1 line of code,
and what do I have to use if the one line code is too long, and I want make it into 2 separate lines to make it more readable? [import]uid: 31508 topic_id: 30495 reply_id: 330495[/import]

I’m pretty sure there’s no limit, you could just use semicolons, but it’s best (for readability) to stop at the page break.

quinc [import]uid: 147322 topic_id: 30495 reply_id: 122190[/import]

I guess you don’t understand my question.

Semicolons is for at the end of the code,
the problem is the code is not ended yet, but already reach the most right of the screen,
so it will naturally move one line down, and make the code look messy on the screen.

What I want to know is it possible to make 1 long line of code into 2 lines?

P.S:
forgive my english :slight_smile: [import]uid: 31508 topic_id: 30495 reply_id: 122192[/import]

I think you might be looking for an option called “word wrap” in your text editor. Might be under the View menu on the top. [import]uid: 94868 topic_id: 30495 reply_id: 122194[/import]

That’s a feature of your editor as mentioned above called word-wrap and it will vary depending on the editor you are using.
[import]uid: 19626 topic_id: 30495 reply_id: 122199[/import]

I’m pretty sure there’s no limit, you could just use semicolons, but it’s best (for readability) to stop at the page break.

quinc [import]uid: 147322 topic_id: 30495 reply_id: 122190[/import]

I guess you don’t understand my question.

Semicolons is for at the end of the code,
the problem is the code is not ended yet, but already reach the most right of the screen,
so it will naturally move one line down, and make the code look messy on the screen.

What I want to know is it possible to make 1 long line of code into 2 lines?

P.S:
forgive my english :slight_smile: [import]uid: 31508 topic_id: 30495 reply_id: 122192[/import]

I think you might be looking for an option called “word wrap” in your text editor. Might be under the View menu on the top. [import]uid: 94868 topic_id: 30495 reply_id: 122194[/import]

That’s a feature of your editor as mentioned above called word-wrap and it will vary depending on the editor you are using.
[import]uid: 19626 topic_id: 30495 reply_id: 122199[/import]

Yes it is possible but will be confusing to put all codes in a massive line. I’ll try to break it down if possible. In Lua or at least Lua being used in corona I dont think it is necessary to put in a semicolon after each line. But it is always a good practice for most developers.
[import]uid: 147050 topic_id: 30495 reply_id: 123111[/import]

I’m pretty sure that’s correct.

What I meant is that there is no limit (I think) for the number of characters on one line; you could just use semicolons to make a line go on forever. (Like this)
[lua]myObject.x=512; myObject.y=384; myObject.items={“Good Potion”, “Extreme Explosion Grenade”, “Something”, “Something 2”}; myObject.amazingEffect=“Spin around and explode with 500 different colors”; myObject.health=100; myObject.weaponStrength=8; myObject.currentWeapon=“Super Awesome Electric Arc Cyber Nuclear Photon Gamma Blaster”; myObject.walkingSpeed=80; myObject.directionFacing=“left”; myObject.currentLevel=8; myObject.characterName=“Walter”; myObject.alpha=0.8; myObject.rotation=270[/lua]
But, of course, like arnisgears said, that would be confusing.

quinc [import]uid: 147322 topic_id: 30495 reply_id: 123113[/import]

Yes it is possible but will be confusing to put all codes in a massive line. I’ll try to break it down if possible. In Lua or at least Lua being used in corona I dont think it is necessary to put in a semicolon after each line. But it is always a good practice for most developers.
[import]uid: 147050 topic_id: 30495 reply_id: 123111[/import]

I’m pretty sure that’s correct.

What I meant is that there is no limit (I think) for the number of characters on one line; you could just use semicolons to make a line go on forever. (Like this)
[lua]myObject.x=512; myObject.y=384; myObject.items={“Good Potion”, “Extreme Explosion Grenade”, “Something”, “Something 2”}; myObject.amazingEffect=“Spin around and explode with 500 different colors”; myObject.health=100; myObject.weaponStrength=8; myObject.currentWeapon=“Super Awesome Electric Arc Cyber Nuclear Photon Gamma Blaster”; myObject.walkingSpeed=80; myObject.directionFacing=“left”; myObject.currentLevel=8; myObject.characterName=“Walter”; myObject.alpha=0.8; myObject.rotation=270[/lua]
But, of course, like arnisgears said, that would be confusing.

quinc [import]uid: 147322 topic_id: 30495 reply_id: 123113[/import]