Jump to content
Neron

How long can be one line?

Recommended Posts

it does have limitations to code length as of now till the new engine, about 9000 lines is max then the editor gets buggy, and lags alot. (Try it) and he was asking the length of one line of code from right to left not top to bottom =p

 

The lag has nothing to do with the script engine, it's rather due to a bad implementation of the function list which refreshes whenever a key is pressed in the same thread as the user interface. It's been implemented like this since I added the feature god knows how long ago, but I haven't gotten around to fixing it yet. A fix should however arrive in the next version or the one after that. On a side-note though... It's technically better to divide up your code into multiple files if it gets up to that kind of sizes, simply because the modularity, it'll be a lot easier to find things in your code because you can structure the division of the code along the different files efficiently.

Link to comment
Share on other sites

Yea there's a limit in terms of you can only scroll over the right a certain amount. I've never had this problem and have even exploited it by shoving all the FormInfo on one line before lol.
I may have to give that a try, would save alot of space, just be a headache if you ever needed to change something, so i guess make sures its right first =)

 

---------- Post added at 04:52 AM ---------- Previous post was at 04:49 AM ----------

 

The lag has nothing to do with the script engine, it's rather due to a bad implementation of the function list which refreshes whenever a key is pressed in the same thread as the user interface. It's been implemented like this since I added the feature god knows how long ago, but I haven't gotten around to fixing it yet. A fix should however arrive in the next version or the one after that. On a side-note though... It's technically better to divide up your code into multiple files if it gets up to that kind of sizes, simply because the modularity, it'll be a lot easier to find things in your code because you can structure the division of the code along the different files efficiently.
oh okay, how would you go about making a separate functions list, i would assume just make another scar file with all the functions in it pretty simple but how would you call the into your script, can your function list be located within you script folder and call it from there somehow? or does it have to be within in the includes folder?
Link to comment
Share on other sites

Yea there's a limit in terms of you can only scroll over the right a certain amount. I've never had this problem and have even exploited it by shoving all the FormInfo on one line before lol.

 

This is a limit imposed in most if not all code editors actually.

 

oh okay, how would you go about making a separate functions list, i would assume just make another scar file with all the functions in it pretty simple but how would you call the into your script, can your function list be located within you script folder and call it from there somehow? or does it have to be within in the includes folder?

 

You just create include files, there's no rule stating include files can't be used to break up a script into multiple pieces. The convenient thing about SCAR's new include system is that it's very flexible. You can just place the files in the same folder as your script and include them like {$I ScriptFunctions.scar}, or in a subfolder of the folder where your script is located: {$I SubFolder\ScriptFunctions.scar}.

 

SCAR's include system will go looking for an include file relative to the current include file first, then relative to the script path and then relative to the includes folder.

Link to comment
Share on other sites

This is a limit imposed in most if not all code editors actually.

 

 

 

You just create include files, there's no rule stating include files can't be used to break up a script into multiple pieces. The convenient thing about SCAR's new include system is that it's very flexible. You can just place the files in the same folder as your script and include them like {$I ScriptFunctions.scar}, or in a subfolder of the folder where your script is located: {$I SubFolder\ScriptFunctions.scar}.

 

SCAR's include system will go looking for an include file relative to the current include file first, then relative to the script path and then relative to the includes folder.

 

That makes since, that is pretty awesome because that means you dont need to have an include with scar u can just make your own include and stick it in the scripts folder, i will be using this more often, as this would deff make scripts more readable when using forms as they could be placed in separate file and then just call the start form procedure form that file =)

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
  • Create New...