help me to creat a progam with vars...plssss?

please help me to be familiar with vars.first and foremost, as of now, what i know is just on how to use concat, integer, and string in a basic way.how about the other, example, using a procedure in a var?

what else can i do using the var?

i know that gotoxy can make a simple presentation of an image by using characters, digits, special characters, etc. but i don't know how to make them move. how is it?

that's all for now that i am needing... thank you for helping me.this is a great support for me to eal with pascal....

Comments

: please help me to be familiar with vars.: first and foremost, as of now, what i know is just on how to use concat, integer, and string in a basic way.: how about the other, example, using a procedure in a var?: : what else can i do using the var?: : i know that gotoxy can make a simple presentation of an image by using characters, digits, special characters, etc. but i don't know how to make them move. how is it?: : that's all for now that i am needing... thank you for helping me.: this is a great support for me to eal with pascal....: Variables are storage containers for data, no matter what that data is. The type of the variable determines the type of data it can store. I would suggest that you look at the following types in the help files to get an idea of what is possible (look also at the examples):- integer- real- string- boolean- array- record- pointer- TObjectThese types are listed from simplest to understand to hardest.

Here is an example of a moving asterix using GotoXY(). Pressing any key will stop the animation:[code]uses Crt;

: : please help me to be familiar with vars.: : first and foremost, as of now, what i know is just on how to use concat, integer, and string in a basic way.: : how about the other, example, using a procedure in a var?: : : : what else can i do using the var?: : : : i know that gotoxy can make a simple presentation of an image by using characters, digits, special characters, etc. but i don't know how to make them move. how is it?: : : : that's all for now that i am needing... thank you for helping me.: : this is a great support for me to eal with pascal....: : : Variables are storage containers for data, no matter what that data is. The type of the variable determines the type of data it can store. I would suggest that you look at the following types in the help files to get an idea of what is possible (look also at the examples):: - integer: - real: - string: - boolean: - array: - record: - pointer: - TObject: These types are listed from simplest to understand to hardest.: : Here is an example of a moving asterix using GotoXY(). Pressing any key will stop the animation:: [code]: uses: Crt;: : var: x, dir: integer;: begin: x := 4;: dir := 1;: repeat: GotoXY(x, 10); write(' '); { Delete previous asterix }: x := x + dir; { Update the location }: GotoXY(x, 10); write('*'); { Write the new asterix }: if x > 20 then { Limit the path of the asterix }: dir := -1: else if x < 4 then: dir := 1;: Sleep(250); { Timing of the animation. Interrupt code for 250 ms }: until Keypressed;: readkey;: end.: [/code]: thank you for helping me, at least my worry lessened down, another thing i would like to ask if you don't mind to, but, as of now, i have been recieved an assignment to make a converter, can i have any tip about how to convert a number from decimal to hexadecimal, binary, and octal? i had a hard time dealing on it because i dion't have yet learned how to use other type of numbers except decimal....

: : : please help me to be familiar with vars.: : : first and foremost, as of now, what i know is just on how to use concat, integer, and string in a basic way.: : : how about the other, example, using a procedure in a var?: : : : : : what else can i do using the var?: : : : : : i know that gotoxy can make a simple presentation of an image by using characters, digits, special characters, etc. but i don't know how to make them move. how is it?: : : : : : that's all for now that i am needing... thank you for helping me.: : : this is a great support for me to eal with pascal....: : : : : Variables are storage containers for data, no matter what that data is. The type of the variable determines the type of data it can store. I would suggest that you look at the following types in the help files to get an idea of what is possible (look also at the examples):: : - integer: : - real: : - string: : - boolean: : - array: : - record: : - pointer: : - TObject: : These types are listed from simplest to understand to hardest.: : : : Here is an example of a moving asterix using GotoXY(). Pressing any key will stop the animation:: : [code]: : uses: : Crt;: : : : var: : x, dir: integer;: : begin: : x := 4;: : dir := 1;: : repeat: : GotoXY(x, 10); write(' '); { Delete previous asterix }: : x := x + dir; { Update the location }: : GotoXY(x, 10); write('*'); { Write the new asterix }: : if x > 20 then { Limit the path of the asterix }: : dir := -1: : else if x < 4 then: : dir := 1;: : Sleep(250); { Timing of the animation. Interrupt code for 250 ms }: : until Keypressed;: : readkey;: : end.: : [/code]: : : thank you for helping me, at least my worry lessened down, another thing i would like to ask if you don't mind to, but, as of now, i have been recieved an assignment to make a converter, can i have any tip about how to convert a number from decimal to hexadecimal, binary, and octal? i had a hard time dealing on it because i dion't have yet learned how to use other type of numbers except decimal....: The codepedia contains a few function to perform such conversions. For more info on other types of numbers see the wikipedia. I would suggest that you learn to use them on paper first. Hint: view numbers as follows:decimal 123: 1*10^2 + 2*10^1 + 3*10^0 = 123 (decimal)octal 123: 1*8^2 + 2*8^1 + 3*8^0 = 83 (decimal)binary 1011: 1*2^3 + 0*2^2 + 1*2^1 + 1*2^0 = 11 (decimal)

: : : : please help me to be familiar with vars.: : : : first and foremost, as of now, what i know is just on how to use concat, integer, and string in a basic way.: : : : how about the other, example, using a procedure in a var?: : : : : : : : what else can i do using the var?: : : : : : : : i know that gotoxy can make a simple presentation of an image by using characters, digits, special characters, etc. but i don't know how to make them move. how is it?: : : : : : : : that's all for now that i am needing... thank you for helping me.: : : : this is a great support for me to eal with pascal....: : : : : : : Variables are storage containers for data, no matter what that data is. The type of the variable determines the type of data it can store. I would suggest that you look at the following types in the help files to get an idea of what is possible (look also at the examples):: : : - integer: : : - real: : : - string: : : - boolean: : : - array: : : - record: : : - pointer: : : - TObject: : : These types are listed from simplest to understand to hardest.: : : : : : Here is an example of a moving asterix using GotoXY(). Pressing any key will stop the animation:: : : [code]: : : uses: : : Crt;: : : : : : var: : : x, dir: integer;: : : begin: : : x := 4;: : : dir := 1;: : : repeat: : : GotoXY(x, 10); write(' '); { Delete previous asterix }: : : x := x + dir; { Update the location }: : : GotoXY(x, 10); write('*'); { Write the new asterix }: : : if x > 20 then { Limit the path of the asterix }: : : dir := -1: : : else if x < 4 then: : : dir := 1;: : : Sleep(250); { Timing of the animation. Interrupt code for 250 ms }: : : until Keypressed;: : : readkey;: : : end.: : : [/code]: : : : : thank you for helping me, at least my worry lessened down, another thing i would like to ask if you don't mind to, but, as of now, i have been recieved an assignment to make a converter, can i have any tip about how to convert a number from decimal to hexadecimal, binary, and octal? i had a hard time dealing on it because i dion't have yet learned how to use other type of numbers except decimal....: : : The codepedia contains a few function to perform such conversions. For more info on other types of numbers see the wikipedia. I would suggest that you learn to use them on paper first. Hint: view numbers as follows:: decimal 123: 1*10^2 + 2*10^1 + 3*10^0 = 123 (decimal): octal 123: 1*8^2 + 2*8^1 + 3*8^0 = 83 (decimal): binary 1011: 1*2^3 + 0*2^2 + 1*2^1 + 1*2^0 = 11 (decimal): my point is this: when you type a certain decimal number, and then you enter, it will converted into hexadecimal, octal, or binary...

: : If you look at IntToBin declaration, it says:: : [code]: : function IntToBin(Value: integer): string;: : [/code]: : this reads that after the IntToBin word, there must be a "(" followed by some integer literal or variable, and finally a ")". The complete call needs to look something like this:: : [code]: : IntToBin(12);: : [/code]: : this will return the binary representation of 12. If you want to see the binary representation of a value inside a variable you need to pass a variable into the IntToBin function:: : [code]: : IntToBin(SomeIntVar);: : [/code]: : Calling IntToBin without any parameters (the value inside the "(" and ")") is useless, because the computer doesn't know, which value to convert into binary.: : : i felt something wrong with this declaration:: [code]: IntToBin(Val : Integer): String;: [/code]: : the code ( String;) makes the procedure never works. instead, an error message will appear: ";" needed.: when i had debugged it, another error message appears: "BEGIN" expected.

Make sure that you are declaring it as a FUNCTION and not a PROCEDURE. Note the difference is that a FUNCTION returns a value, whereas a PROCEDURE does not.

Procedures require that you use the data inside them, then they are gone (although there are exceptions to this) and function will return values to the line that called the function so that you can use the data again.