Initial data commit
This commit is contained in:
parent
72d218235f
commit
f23f22d71c
199087 changed files with 3378941 additions and 0 deletions
35
Task/Variables/OxygenBasic/variables.basic
Normal file
35
Task/Variables/OxygenBasic/variables.basic
Normal file
|
|
@ -0,0 +1,35 @@
|
|||
'WAYS OF DECLARING VARIABLES
|
||||
'AND ASSIGNING VALUES
|
||||
var int a,b,c,d
|
||||
int a=1,b=2,c=3,d=4
|
||||
dim int a=1,b=2, c=3, d=4
|
||||
dim as int a=1,b=2, c=3, d=4
|
||||
dim a=1,b=2, c=3, d=4 as int
|
||||
print c '3
|
||||
|
||||
'CREATING ARRAY VARIABLES
|
||||
int array[100]
|
||||
dim int a={10,20,30,40} 'implicit array
|
||||
print a[3] '30
|
||||
|
||||
'COMMONLY USED TYPES:
|
||||
'byte word int sys float char string
|
||||
|
||||
'LIMITING SCOPE
|
||||
dim int a=10
|
||||
scope
|
||||
dim int a=100
|
||||
dim int b=1000
|
||||
print a '100
|
||||
end scope
|
||||
print a 'prior a: 10
|
||||
print b 'error b is out of scope
|
||||
|
||||
'REFERENCING VARIABLES
|
||||
dim int*p 'p is a pointer variable
|
||||
dim int a={2,4,6,8}
|
||||
@p=@a[3] 'address of p is assigned address of a[3]
|
||||
print @p 'the address
|
||||
print p '6
|
||||
print p[1] '6
|
||||
print p[2] '8
|
||||
Loading…
Add table
Add a link
Reference in a new issue