Mikroelektronika MIKROE-724 データシート

ページ / 726
192
mikoBasic PRO for dsPIC30/33 and PIC24
MikroElektronika
‘ procedures prototypes
sub procedure sub_procedure_name([dim byref] [constParamName as [^]type, [dim byref
[constParamName2, ParamName3 as [^]type)
‘ functions prototypes
sub  function  sub_function_name([dim  byref]  [const]  ParamName  as  [^]type,  [dim  byref
[constParamName2, ParamName3 as [^]type) as [^]type
‘********************************************************
‘* Implementation:
‘********************************************************
implements
‘ constants declarations
const ...
‘ variables declarations
dim ...
‘ procedures declarations
sub procedure sub_procedure_name([dim byref] [constParamName as [^]type, [dim byref
[constParamName2, ParamName3 as [^]type) [ilevel 0x123] [overload] [forward]
  <local declarations>
  ...
end sub
‘ functions declarations
sub  function  sub_function_name([dim  byref]  [const]  ParamName  as  [^]type,  [dim  byref
[const]  ParamName2,  ParamName3  as  [^]type)  as  [^]type  [ilevel  0x123]  [overload
[forward]
  <local declarations>
  ...
end sub
end.
Note: Sub functions and sub procedures must have the same declarations in the interface and implementation section. 
Otherwise, compiler will report an error.
Scope and Visibility
Scope
The scope of an identifier is a part of the program in which the identifier can be used to access its object. There are 
different categories of scope, which depends on how and where identifiers are declared: