亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? pascal.txt

?? a collection of mega hacking tools
?? TXT
?? 第 1 頁 / 共 4 頁
字號:
3) Arrays.



  3.1) Array's definition:

      ***********************

First a few words about the Array, the array is a type of variable, the idea is that a simple 

variable can't include inside itself more than one value... but the array type of variable CAN.

Under the "VAR" (in your program) you define the number of cells to the array, in the next

way: 

 program example;

 var

  arr: ARRAY [1..3] OF integer; { here we declared to the array variable called "arr", 3 cells, and

                                              the value every cell can get is only an "Integer" type. }

begin  { the main "Begin" }

 ...

The two dots betweet the 1 and the 3 means 'from where to where'. you can use as many cells

as you whish... You can use any name you like for the array, instead of "arr" in this small

example, you MUST keep this form: 

arrayname: ARRAY [the_first_cell .. the_last_cell] OF the_type_of_value_in_every_cell.

Those cells makes the program more effective, and less work for you.



  3.2) Using Arrays:

      *******************

Ok... now you know how to difine an array, but you don't know how to use it, now look:

we said that the array is number of cells, right?! And we want to enter a specific cell and enter

a value into it, the next example will explain to you how to enter a value into a specific cell, and

how  to read a value from a specific cell as well.

The next example will show you away to enter into the cell a value:

 Begin  {the main "Begin" }

  arr[1]:=22;  {the cell number 1 will include inside it the value 22 }

  arr[2]:=5;    {the cell number 2 will include inside it the value 5 }

  arr[3]:=0;    {the cell number 3 will include inside it the value 0 }



The idea is that the number of the Cell is in the [ ]. Remember that you can't use a number of 

cell which is out of range (in this case the range is from 1(including 1) to 3(including 3), so you 

CAN'T do the: 

 arr[4]:=1;   { the number of the cell is 4, and our last cell number is 3, so the compiler will show 

                   an 'Error'!!!  REMEMBER that! }



Now, how do you read from the value from a specific cell?! Lets say i would like to print the the

cell number 2 on screen... look:

 writeln(arr[2]);  { This will print the value inside the cell 2 on the screen }



Just remember that "arr[2]" is like a simple variable, you can do what ever you like with it...

You can play any math on it, just like on a simple variable ( * , + , -), but it's 'div', or / depended

on the type of the value inside the cell (if it "Integer" then it's div, and if it's "Real" then it's / )

Ok... Lets move on...



  3.5) Using Arrays and Loops:

      ********************************

Until now we wrote in the [ ] the number of the cell we want to use, but in 90% of working

with arrays, we never use a specific cell... We'll use Loops, the 'Index' of the loop instead of a

specific value (the specific number of the cell) in the [ ]... Check out the next example and you'll

get the idea:

 program example_ARRAYS_LOOPS;

 var

  i: integer;  { here we declared an "Integer" type variable, which we will use as an Index. }

 begin  { the main begin }

  for i:=1 to 3 do  { a simple "For" loop from 1 to 3 (including 1 and 3) }

   arr[i]:=i+1;  { every cell from 1 to 3 will get the INDEX, the "i"+1... so cell 1 will include 2, 

                      cell 2 will include 3, and cell 3 will include 4 }

 end.  {the main end }



You can use any type of loop as you wish, and the number number of the cell is the Index, or you can use variables, as long as this variable will change every time the loop will repeat itself 

( Like the variable is been Increased or Decreased, it's your choise! ) so you won't get into 

a situation when you will use the same cell.



=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

4) Strings.



  4.1) What the heck Strings are?!

       ***********************************

Remember the "Char" type variables, well a String is just like an Array but every cell in this array

will be from "Char" type. You can use arrays of "Char" type, but this will be stupid... because 

there is a special declaration of String, I'll explain how to declare and use the string in the next two sections.



  4.2) String's definition:

      ************************

Here I'll compare the "Char" type array declaration,  and the original String's type declaration.



1. Ok, lets start with the "Char" type array first:

 program Char_Array;

 var

  fake_string: array[1..5] of char;



2. And now the original String's one: 

 program the_String;

 var

  str: string;



Using the original way is better because, it's much more simple and less to write, and you don't

always have to declare a specific range, but if you like to do it (if you know the number of chars

you're going to use, or you just like to save some memory space, or both. ), here is the way you

declare an exact number of chars in the string:

 var

  str: string[5];



And this will create a string variable of 5 chars.



  4.2) Using basic String:

      *************************

Ok, I'll explain you now the process of working with Strings, like compering two strings, making 

an input to a string, pulling an output of the string, how to find out the length of the string, and making:

4.2.1)Comparing two strings, the direct way:

 if (str1>str2) then

  ...



4.2.2)Comparing two strings, char by char:

  for i:=1 to 10 do

   if (str1[i]=str2[i]) then

     ...



4.2.3)Making a string input, the direct way:

 readln(str1);



4.2.4)Making a string input, char by char:

 for i:=1 to 10 do

  readln(str1[i]);



4.2.5)Pulling an output of the string, the direct way:

 writeln(str1);



4.2.6)Pulling an output of the string, char by char:

 for i:=1 to 10 do

  write(str1[i]);



4.2.7)Getting the length of the string, the only way:

 x:=length(str1); { the variable x must be from an integer type ONLY. }

                        { now 'x' includes the number of chars there are in the 'str1' string. }



Well, that's all you need to know on how you need to declare and use the string, simple hah!? :)

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

5) Procedures and Functions.



  5.1) What the heck a Procedure is?!

      ****************************************

Until now we wrote our entire programs in one part!!! But this isn't effective, like lets take for

example a program which you need to print on the screen 3 different lines, at the beginning, 

at the middle, and at the end. In each part you need print all 3 lines... so what... you will

write those lines at every part of the program again and again, it's stupid don't you think...?!

So, what we'll do is write a small "procedure" which will include inside itself those 3 lines...

But first I'll explain to you, what a procedure is. A procedure can include inside itself commands

and conditions checking, and every thing you learn until now. The procedure may be used from

any place at the Main of the programs (between the Main "Begin" and the Main "End."), the 

procedure may be used from another procedure as well. If you haven't understood it so well, don't worry, after a few examples you'll get the idea. Let us continue...



  5.2) Writing a Procedure:

      ***************************

The Procedures will be written before the Main "Begin".

To open a procedure you write: "Procedure" then the name of the procedure, and then ";",

simple, don't you think... Now, under it, you must put "Begin", (it's the law :) ) even if you have 

only one command in the procedure. The procedure will end when you'll put "End;".

Look at the next example to get the idea:

 program Procedure_example;  { the program's title }

 procedure line;  { openning a procedure }                       

  begin  { the Procedure's "Begin" }

   writeln(' Uncle Fucker, just like the song says.');

  end;

 begin  { the Main "Begin" }

  write('I am an');  { printing on the screen: "I am an", and staying on the same line... }

  line;  { using the procedure, it's like the code written inside the procedure is passed here... }

          { the 'writeln' command in the procedure will start from the last line, print " Uncle Fucker,    

            just like the song says.", and then, it will jump one line down. }

  write('You are an');

  line;

  write('We all a bunch of ');

  line;

 end.  { the Main "End" }



We didn't use "Var" in our small example program, because we didn't need any global variables in our example program.we could also declare some Local variables, by placing a "Var" before the procedure's "Begin", just like the regular "Var" we knew from the first chapters, except that:

Those Local variables will exist only in the procedure, and will be deleted if you won't store them 

inside a Global variable (the variables we declared in the "Var" under the "Program" 's name,

as you know the global variable are known to the whole program, and the local variable are only

known to the procedure itself, to the specific procedure, not to all of the procedures.



  5.3) Parameters' rules:

      ************************

Until now what we did, was only a simple procedure... This means that we could only use: Global 

variable (the variable you declaring in the "Var" under the "Program" 's name) inside the procedure, but what we will do know is returning variable from the procedure, and inputting them 

into it (the procedure)...

To do that you need to remember the next two rules:

1. When you send a variable to procedure, the type of variable you send to the procedure

is the same as the type of the variable which will receive the Data of the variable you sent.

I know it's like Chinese to you, or French to all the Chinese readers :)

2. If you like to send an Array to a procedure you need to write a "Type" definition, under the

"program" (before the "Var"). This is how you do it:



 program Type_definition;

 const

  m = 5;

 type

  arr_type = array[1..m] of integer;

 var

 ...



'arr_type' is now a new declaration type, this 'arr_type' could have any name as you like.

If you like to send an array to procedure, and you wrote the procedure so it will receive

an array from the 'arr_type' type, then the array which you'll send to this procedure 

MUST have the same number of cells as the type the procedure receives. In the above

example of "Type" the array MUST be 5 cells long, from 1 to 5.

Now, after you understood the rules you may move on to the next section, which will explain

you: Who to use Parameters, how to send variables to another procedure and even to receive them back with a new Data in them... just continue reading!



  5.4) Writing a Procedure with Parameters passing:

      ********************************************************

Well I hope you understood the rule, becuase we can't go on to the "writing a procedure with 

parameters passing" part without those rules, so if you're not sure if you understood the rules, 

please reread the rules chapter again and again until you'll under stand them perfectly!!!

But if you did understand them, let's go on...

The whole idea of parameters passing is to make the programming more simple and more 

effective, like for example, take a look at the next procedure:



 procedure example1;

  begin

   writeln('a newbie is a lamer :)');

  end;



Now, instead of 'newbie' you could place any other word, isn't it?!

So, how about writing a procedure that will place a String type variable instead the word newbie, 

so you may use this procedure in different places with a different meaning. You could do it like

this:



 procedure  example2(the_word: string);

  begin

   writeln('a ',the_word,' is a lamer :)');

  end;



Now, you probably ask, "so... how do I use this procedure???". Very simple, look at this small 

program:



 program the_use;

  var

   name: string;

   number: integer;

  begin  { the Main Begin }

   name:='moron';

   number:=25;

   example2(name);  { this line will print on the screen: "a moron is a lamer :)" }

   example2('moron');  { this line will print the same thing as the line above, the variable 'name',                                                                                                                                     

                                  received inside itself the line: moron . }

   example2(number);  { this line won't work because, actually with this line in the code, you 

                                   won't be able even to compile the code, why you ask, then return back

                                   and reread the rules chapter again, because the type of variable wich the

                                   procedure receives does not much the type of variable you send to the 

                                   procedure!!! }

  end.  { the Main End }



Ok, now you can send more than one variable to a procedure, but you need to write a procedure

to receive that much variables, and when you send the values/variables to the procedure you 

need to send them at the same order as the variables were writen in the procedure to receive 

those values/variabels, they also must mutch the order they been written, it's all said in the 

rules part!!!



In the next chapter you'll learn how to return values from the procedure as a parameter!



  5.5) Returning Parameters in Procedures:

      **********************************************

After you learn the parameters' rules, and you know how to write a procedure with them,

I may now teach you how to return values with them:

 procedure return_example(var a: integer);



You see the littele "var" before the 'a' variable, this means that at the end of the procedure the 

value which inside the variable 'a' will be returned to the variable you send to this procedure, and which the variable 'a' received it's value!



This way is mostly used, when you need to return more than one value, or you need to return special values, like Arrays, which is that the only way to do that!



In the next chapter you will see other ways to return one value only, without sending any other variable to pass the value.



  5.6) What the heck is a Function?!

      **************************************

Very good, you got this far, I'm proud of you, because now comes the GOOD part, but a little harder than the previous chapters, but don't worry >:)

Well, a function is actually a procedure, that must always return a value, even if the function 

haven't received any values/variables into itself!

The only thing you need to know is that a Function can return one value only, in the section you will see how to write a function, how to return the value, and you will learn the rules of writing

a function, so, just continue reading!

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美性生活久久| 国产精品热久久久久夜色精品三区 | 久久精品国产亚洲一区二区三区| 国产成人自拍在线| 欧美高清性hdvideosex| 亚洲日本一区二区| 国产黄人亚洲片| 欧美美女黄视频| 1024成人网色www| 国产91丝袜在线播放0| 欧美电影免费观看完整版| 亚洲一区二区三区四区在线免费观看 | 成人免费视频caoporn| 欧美一级生活片| 亚洲成av人片在线| 欧日韩精品视频| 亚洲欧洲国产专区| 不卡一区在线观看| 中文一区二区在线观看| 国产精品影音先锋| 久久久综合网站| 国产精品影视在线观看| 久久综合视频网| 狠狠狠色丁香婷婷综合激情| 欧美精品亚洲二区| 三级精品在线观看| 91精品国产91综合久久蜜臀| 天堂资源在线中文精品| 欧美日韩一区二区在线观看 | 色94色欧美sute亚洲线路二| 中文字幕乱码日本亚洲一区二区| 极品少妇xxxx偷拍精品少妇| 日韩女优av电影| 韩国精品主播一区二区在线观看| 精品国产亚洲在线| 国产一区二区三区久久久| 久久综合九色综合97婷婷女人 | 久久影院午夜片一区| 久久电影网站中文字幕| 精品少妇一区二区三区免费观看| 久久机这里只有精品| 精品理论电影在线| 国产精品99久久久久| 亚洲欧洲成人精品av97| 欧美中文字幕一二三区视频| 视频一区二区中文字幕| 欧美va日韩va| 风间由美一区二区av101| 中文字幕亚洲一区二区va在线| 99在线热播精品免费| 一卡二卡三卡日韩欧美| 日韩一区二区三区电影在线观看| 国产精品一二三四区| 国产精品视频第一区| 在线视频欧美精品| 久久成人综合网| 久久精品在线免费观看| 日本精品一级二级| 日韩高清在线不卡| 欧美激情一区在线| 欧美色图片你懂的| 国产乱子伦一区二区三区国色天香| 国产精品美女久久久久久| 91电影在线观看| 国模一区二区三区白浆| 亚洲少妇屁股交4| 欧美变态凌虐bdsm| 一本一道综合狠狠老| 美女mm1313爽爽久久久蜜臀| 国产精品成人在线观看| 欧美一级片免费看| 99久久精品情趣| 免费观看一级欧美片| 国产精品国产成人国产三级| 日韩欧美亚洲国产精品字幕久久久 | 欧美日韩在线精品一区二区三区激情 | 亚洲aaa精品| 欧美国产一区视频在线观看| 欧美精品一级二级| 91麻豆成人久久精品二区三区| 免费一级欧美片在线观看| 综合久久久久久久| 久久久99久久精品欧美| 欧美色综合影院| 99精品久久只有精品| 久久成人精品无人区| 亚洲午夜国产一区99re久久| 久久久久久久久久久久电影 | 国产精品欧美精品| 精品国产三级电影在线观看| 久久久一区二区三区捆绑**| 在线观看91精品国产麻豆| 国产一区二区伦理片| 午夜精品福利一区二区三区av | 91免费国产在线| 国产一区二区电影| 久久精品国产澳门| 亚洲国产精品自拍| 亚洲免费观看高清完整版在线观看熊| 日韩三级视频在线观看| 欧美高清性hdvideosex| 色香蕉久久蜜桃| 91欧美激情一区二区三区成人| 成人免费视频视频| 风间由美性色一区二区三区| 国产一区二区精品在线观看| 精品国产一区二区三区久久影院| 色狠狠av一区二区三区| 91啪亚洲精品| 色综合久久天天| 日韩西西人体444www| 91成人国产精品| 欧美综合视频在线观看| 在线观看日韩av先锋影音电影院| 91亚洲大成网污www| 91啪亚洲精品| 色久综合一二码| 欧美日韩一区二区三区高清| 欧美性三三影院| 777久久久精品| 欧美va亚洲va香蕉在线| 久久久亚洲综合| 国产精品国产三级国产aⅴ原创 | 欧美一区三区四区| 日韩一区二区在线免费观看| 日韩亚洲欧美在线| 久久久美女毛片| 亚洲色图一区二区三区| 一区二区三区丝袜| 免费观看在线色综合| 韩国女主播成人在线| 成人亚洲一区二区一| 91成人免费网站| 日韩欧美国产综合在线一区二区三区| 精品久久人人做人人爽| 国产精品免费视频一区| 一区二区三区精品| 免费精品99久久国产综合精品| 精品一区二区免费在线观看| 粉嫩蜜臀av国产精品网站| 色婷婷av一区二区| 日韩欧美激情在线| 国产精品私人影院| 午夜伊人狠狠久久| 国产真实乱偷精品视频免| 一本到不卡免费一区二区| 欧美一区二视频| 欧美韩国日本综合| 亚洲成人免费在线| 国产成人精品网址| 欧美日韩不卡一区二区| 欧美激情一区二区在线| 亚洲福利视频一区二区| 国产成人aaaa| 欧美日韩在线一区二区| 国产女同互慰高潮91漫画| 一二三区精品福利视频| 国产伦精一区二区三区| 欧美三级欧美一级| 国产精品乱码妇女bbbb| 青青草国产精品97视觉盛宴| 成人高清免费观看| 欧美一级黄色大片| 亚洲精品你懂的| 国产一区二区三区四| 欧美丰满嫩嫩电影| 自拍偷在线精品自拍偷无码专区 | 亚洲高清免费在线| 成人久久18免费网站麻豆| 欧美一级视频精品观看| 一区二区三区91| 波多野结衣中文字幕一区| 精品精品欲导航| 日韩在线观看一区二区| 在线免费不卡电影| 自拍偷拍亚洲欧美日韩| 国产a区久久久| 久久在线观看免费| 免费高清在线视频一区·| 欧美日免费三级在线| 亚洲欧美另类小说| aaa亚洲精品一二三区| 久久久精品tv| 国产精品主播直播| xfplay精品久久| 久久99国产精品久久| 日韩一区二区三区免费观看| 视频一区二区不卡| 欧美久久久久久久久久| 亚洲成a人v欧美综合天堂| 91蝌蚪国产九色| 亚洲日本va午夜在线电影| av不卡免费电影| 亚洲日本丝袜连裤袜办公室| 99久久国产综合精品色伊| 1000部国产精品成人观看| 成人av午夜影院| 中文字幕亚洲视频| 色国产综合视频| 亚洲国产精品久久艾草纯爱|