Include a file: Difference between revisions

Content added Content deleted
(Reactivate seed7 example)
(Added FreeBASIC)
Line 340: Line 340:


Different compilers behave differently, and standardisation attempts have not reached back to earlier compilers.
Different compilers behave differently, and standardisation attempts have not reached back to earlier compilers.

=={{header|FreeBASIC}}==
File to be included :
<lang freebasic>' person.bi file
Type Person
name As String
age As UInteger
Declare Operator Cast() As String
End Type

Operator Person.Cast() As String
Return "[" + This.name + ", " + Str(This.age) + "]"
End Operator</lang>

Main file :
<lang freebasic>' FB 1.05.0 Win 64

' main.bas file
#include "person.bi"

Dim person1 As Person
person1.name = "Methuselah"
person1.age = 969
Print person1
Print
Print "Press any key to quit"
Sleep</lang>

{{out}}
<pre>
[Methuselah, 969]
</pre>


=={{header|Furryscript}}==
=={{header|Furryscript}}==