PDA

View Full Version : All about Const's!



wonderguy6
04-18-2007, 10:42 AM
Me didn't know Were to post this.



Const's!

1. What are const's?
Const's are What people use for "Setups" in there scripts.
Const's CANNOT Be Changed by the script.
Const's are very useful for managing things, For example, There are 10 places in a 300 line script were people need to change to fit there character or the script. Wouldn't it just be easier to have it all on the first few lines of your script?. I Know it would be for me. Const's Make this possible.


2. How would I Implement these?
These are very easy to implement.
1. Okay, We need to script to know were the consts are located.. Right?
Well,
For a script that dose not have includes:
program Withoutincludes;
const
String = 'String'; //A Few comments about it
begin
end.

For a script that dose have includes:
program Withincludes;
{.include include/include.scar}
const
String = 'String'; //A Few comments about it
begin
end.

Okay but now your thinking... I Have my const Set up... But, How do i setup the Strings?

Once again this is VERY Simple.

For example for a simple hello World script. You would have:
program elloworld;
begin
WriteLn ('Hello World');
end.

But if you were implementing Consts you would put

program elloworld;
const
StringName = 'Hello World';[i] //Outputs Hello World
begin
WriteLn (StringName);
end.

You can change 'StringName' to whatever you wish. But you must also change it everywere you have put it in the script.
[i]see Fig.1.0.0


3. Conclusion
So now... What do you think would be a good idea to have in your script?
People Searching and searching for the setup.
Or having 1 Simple area were users input it into?


4. Figures (Fig, Screenshots)
http://img136.imageshack.us/img136/7007/figure1jl1.png
Fig.1.0.0

FineDreadHawk
04-27-2007, 04:54 AM
Very basic but still informative

WhoCares357
04-27-2007, 08:42 PM
Show boolean and integer?