Data update
This commit is contained in:
parent
5150844a7d
commit
4bb20c9b71
7735 changed files with 38060 additions and 199180 deletions
|
|
@ -1,19 +0,0 @@
|
|||
Name: declare -- a local declaration block has an optional name
|
||||
A : constant Integer := 42; -- Create a constant
|
||||
X : String := "Hello"; -- Create and initialize a local variable
|
||||
Y : Integer; -- Create an uninitialized variable
|
||||
Z : Integer renames Y: -- Rename Y (creates a view)
|
||||
function F (X: Integer) return Integer is
|
||||
-- Inside, all declarations outside are visible when not hidden: X, Y, Z are global with respect to F.
|
||||
X: Integer := Z; -- hides the outer X which however can be referred to by Name.X
|
||||
begin
|
||||
...
|
||||
end F; -- locally declared variables stop to exist here
|
||||
begin
|
||||
Y := 1; -- Assign variable
|
||||
declare
|
||||
X: Float := -42.0E-10; -- hides the outer X (can be referred to Name.X like in F)
|
||||
begin
|
||||
...
|
||||
end;
|
||||
end Name; -- End of the scope
|
||||
|
|
@ -1,5 +0,0 @@
|
|||
MOVE 5 TO x
|
||||
MOVE FUNCTION SOME-FUNC(x) TO y
|
||||
MOVE "foo" TO z
|
||||
MOVE "values 1234" TO group-item
|
||||
SET some-index TO 5
|
||||
|
|
@ -1,18 +0,0 @@
|
|||
01 normal-date.
|
||||
03 year PIC 9(4).
|
||||
03 FILLER PIC X VALUE "-".
|
||||
03 month PIC 99.
|
||||
03 FILLER PIC X VALUE "-".
|
||||
03 dday PIC 99. *> Misspelling is intentional; day is a reserved word.
|
||||
|
||||
01 reversed-date.
|
||||
03 dday PIC 99.
|
||||
03 FILLER PIC X VALUE "-".
|
||||
03 month PIC 99.
|
||||
03 FILLER PIC X VALUE "-".
|
||||
03 year PIC 9(4).
|
||||
...
|
||||
PROCEDURE DIVISION.
|
||||
MOVE "2012-11-10" TO normal-date
|
||||
MOVE CORR normal-date TO reversed-date
|
||||
DISPLAY reversed-date *> Shows '10-11-2012'
|
||||
|
|
@ -1,4 +0,0 @@
|
|||
01 a PIC X(20). *> a is a string of 20 characters.
|
||||
01 b PIC 9(10). *> b is a 10-digit integer.
|
||||
01 c PIC 9(10)V9(5). *> c is a decimal number with a 10-digit integral part and a 5-digit fractional part.
|
||||
01 d PIC 99/99/99. *> d is an edited number, with a slash between each pair of digits in a 6-digit integer.
|
||||
|
|
@ -1,4 +0,0 @@
|
|||
*> Group data items do not have a picture clause.
|
||||
01 group-item.
|
||||
03 sub-data PIC X(10).
|
||||
03 more-sub-data PIC X(10).
|
||||
|
|
@ -1,8 +0,0 @@
|
|||
DATA DIVISION.
|
||||
WORKING-STORAGE SECTION.
|
||||
01 initialized-data PIC X(15) VALUE "Hello, World!".
|
||||
01 other-data PIC X(15).
|
||||
...
|
||||
PROCEDURE DIVISION.
|
||||
DISPLAY initialized-data *> Shows 'Hello, World!'
|
||||
DISPLAY other-data *> Will probably show 15 spaces.
|
||||
|
|
@ -1,3 +0,0 @@
|
|||
01 group-item VALUE "Hello!12345".
|
||||
03 a-string PIC X(6). *> Contains "Hello!"
|
||||
03 a-number PIC 9(5). *> Contains '12345'.
|
||||
|
|
@ -1,6 +0,0 @@
|
|||
some-str (1:1) *> Gets the first character from the string
|
||||
some-num (1:3) *> Get the first three digits from the number
|
||||
another-string (5:) *> Get everything from the 5th character/digit onwards.
|
||||
|
||||
*> To reference modify an array element
|
||||
some-table (1) (5:1) *> Get the 5th character from the 1st element in the table
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
import system'collections;
|
||||
|
||||
public program()
|
||||
public Program()
|
||||
{
|
||||
var c := nil; // declaring variable.
|
||||
var a := 3; // declaring and initializing variables
|
||||
|
|
|
|||
|
|
@ -1,2 +0,0 @@
|
|||
$s = "abc"
|
||||
$i = 123
|
||||
|
|
@ -1,2 +0,0 @@
|
|||
4 + $foo # yields 4
|
||||
"abc" + $foo + "def" # yields "abcdef"
|
||||
|
|
@ -1 +0,0 @@
|
|||
Get-ChildItem Variable:
|
||||
|
|
@ -1 +0,0 @@
|
|||
Remove-Item Variable:foo
|
||||
|
|
@ -1,5 +0,0 @@
|
|||
Get-Variable # retrieves the value of a variable
|
||||
New-Variable # creates a new variable
|
||||
Set-Variable # sets the value of a variable
|
||||
Clear-Variable # deletes the value of a variable, but not the variable itself
|
||||
Remove-Variable # deletes a variable completely
|
||||
|
|
@ -8,3 +8,9 @@ gg = '10.' /*same as above ───► GG
|
|||
hh = "+10" /*assigns chars +10 ───► hh */
|
||||
ii = 1e1 /*assigns chars 1e1 ───► ii */
|
||||
jj = +.1e+2 /*assigns chars .1e+2 ───► jj */
|
||||
kk = '123'x /*assigns hex 00000123 ───► KK */
|
||||
kk = 'dead beaf'X /*assigns hex deadbeaf ───► KK */
|
||||
ll = '0000 0010'b /*assigns blank ───► LL (ASCII) */
|
||||
mm = '0000 0100'B /*assigns blank ───► MM (EBCDIC)*/
|
||||
cat = "Honest as the Cat when the meat's out of reach."
|
||||
/*assigns a literal ───► cat */
|
||||
|
|
|
|||
|
|
@ -1,8 +1,3 @@
|
|||
kk = '123'x /*assigns hex 00000123 ───► KK */
|
||||
kk = 'dead beaf'X /*assigns hex deadbeaf ───► KK */
|
||||
ll = '0000 0010'b /*assigns blank ───► LL (ASCII) */
|
||||
mm = '0000 0100'B /*assigns blank ───► MM (EBCDIC)*/
|
||||
|
||||
xxx = '11 2. 333 -5'
|
||||
parse var xxx nn oo pp qq rr
|
||||
/*assigns 11 ───► NN */
|
||||
|
|
@ -14,5 +9,9 @@ parse var xxx nn oo pp qq rr
|
|||
/*a "null" is a string of length zero (0), */
|
||||
/*and is not to be confused with a null char.*/
|
||||
|
||||
cat = 'A cat is a lion in a jungle of small bushes.'
|
||||
/*assigns a literal ───► CAT */
|
||||
parse value 1 2 3 with ss tt uu
|
||||
/*assigns 1 ───► SS */
|
||||
/*assigns 2 ───► TT */
|
||||
/*assigns 3 ───► UU */
|
||||
parse value ss tt with tt ss
|
||||
/*swaps SS and TT */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue