Subs are always declared at the top?

Pantelis

Member
Licensed User
Longtime User
Hi to all

In beginersGuide in page 231 says: Subs are always declared at the top level of the module.
What that means? If I have inside a sub “A” a calling to a sub “B” that is below the “A” this is wrong? The Sub that handles events of Views must be below the other subs? Another meaning?

Thanks
 

klaus

Expert
Licensed User
Longtime User
The whole sentence is:
B4X:
Subs are always declared at the top level of the module, you cannot nest two Subs
one inside the other.
It means:[code]
Sub TestA 
     TestB
End Sub

Sub TestB

End Sub
The order of the Subs is of no importance, it can also be :
B4X:
Sub TestB 

End Sub

Sub TestA
     TestB
End Sub
You cannot do:
B4X:
Sub A 
    Sub B

    End Sub
End Sub
It means nothing else.

Best regards.
 
Upvote 0

exjey

Member
Licensed User
Longtime User
Klaus i remember the old ..decates i was programming in Turbo Pascal for DOS, and that language supported a procedure inside a procedure, weird :sign0188:

Hi Pantelis, Evros here. Nice to meet you outside our borders!
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…