Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
26
Task/Scope-modifiers/FreeBASIC/scope-modifiers.basic
Normal file
26
Task/Scope-modifiers/FreeBASIC/scope-modifiers.basic
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
'Declares a integer variable and reserves memory to accommodate it
|
||||
Dim As Integer baseAge = 10
|
||||
'Define a variable that has static storage
|
||||
Static As String person
|
||||
person = "Amy"
|
||||
'Declare variables that are both accessible inside and outside procedures
|
||||
Dim Shared As String friend
|
||||
friend = "Susan"
|
||||
Dim Shared As Integer ageDiff = 3
|
||||
Dim Shared As Integer extraYears = 5
|
||||
|
||||
Sub test()
|
||||
'Declares a integer variable and reserves memory to accommodate it
|
||||
Dim As Integer baseAge = 30
|
||||
'Define a variable that has static storage
|
||||
Static As String person
|
||||
person = "Bob"
|
||||
'Declare a local variable distinct from a variable with global scope having the same name
|
||||
Static As Integer extraYears = 2
|
||||
|
||||
Print person; " and "; friend; " are"; baseAge; " and"; baseAge + ageDiff + extraYears; " years old."
|
||||
End Sub
|
||||
|
||||
test()
|
||||
Print person; " and "; friend; " are"; baseAge; " and"; baseAge + ageDiff + extraYears; " years old."
|
||||
Sleep
|
||||
Loading…
Add table
Add a link
Reference in a new issue