Code: Select all
type print
as string b="FreeBASIC"
declare sub bug
static as string d
end type
sub print.bug
redim d(0)
d(0)=b
print d(0)
end sub
(@print)->bug
sleep
Code: Select all
type print
as string b="FreeBASIC"
declare sub bug
static as string d
end type
sub print.bug
redim d(0)
d(0)=b
print d(0)
end sub
(@print)->bug
sleep
Code: Select all
Type UDT
Declare Sub s (Byval Print As Integer)
Dim As Integer Print
End Type
Sub UDT.s (Byval Print As Integer)
'Print Print '<-- this doesn't work
write Print
End Sub
Dim As UDT test
test.s(3)
Print 5
Sleep
No:dodicat wrote:I think this is a bug though
Code: Select all
dim as string d=__function__
print d
scope
redim d(1 to 10)
d(5)=__function__
print d(5)
end scope
sleep
Code: Select all
dim as integer d
scope
redim d(10) '' should induce a compiler error message
'd = 1 '' error 72: Array access, index expected, before '=' in 'd = 1'
print d(10)
end scope
Code: Select all
Type Print
Dim Print As String = "You won!"
Declare Sub Conflict (Byref Print As String)
End Type
Sub Print.Conflict (Byref Print As String)
With This
'--- Zone beginning of code insertion ---
..print(.print)
'--- Zone ending of code insertion ------
End With
End Sub
Dim conflict As Print
conflict.Conflict("You lost!")
Sleep
I think here that a dangerous mind would answer ... +1...dodicat wrote:17011472061230192962203758803520196527181634231072185214065217301763591936026977
What's the rule of this challenge dodi? It's possible that I missed the page where you've posted it.dodicat wrote:No, Tourist Trap, no such danger here.
The row of numbers is a longer message than +1.
Three lines of code should do.
Code: Select all
function scramble(byval s as string) as string
s=s+string(iif(4-(len(s) mod 4)=4,0,4-(len(s) mod 4))," ")
dim as string g,acc
for n as long=1 to len(s) step 4
g=str(cvl(mid(s,n,4)))
g=string(iif(10-(len(g) mod 10)=10,0,10-(len(g) mod 10))," ")+g
acc+=g
next n
return acc
end function
dim as string alphabet="ABCDEFGHIJKLMNOPQRSTUVWXYZ"
dim as string s= scramble(alphabet)
print alphabet
print s
print
alphabet=lcase(alphabet)
s= scramble(alphabet)
print alphabet
print s
sleep
Code: Select all
Dim As Integer array(1 To 5, 1 To 9)
For I As Integer = 1 To 5
For J As Integer = 1 To 9
array(I, J) = I*10 + J
Next J
Next I
Type Array0
As Integer a0(1 To 9)
Declare Operator [] (Byval index0 As Integer) Byref As Integer
End Type
Operator Array0.[] (Byval index0 As Integer) Byref As Integer
Return This.a0(index0)
End Operator
Type Array1
As Array0 a1(1 To 5)
Declare Operator [] (Byval index1 As Integer) Byref As Array0
End Type
Operator Array1.[] (Byval index1 As Integer) Byref As Array0
Return This.a1(index1)
End Operator
'--- Zone beginning of code insertion ---
'--- Zone ending of code insertion ------
For I As Integer = 1 To 5
For J As Integer = 1 To 9
Print a[I][J];
Next J
Print
Next I
Print
Sleep
Code: Select all
11 12 13 14 15 16 17 18 19
21 22 23 24 25 26 27 28 29
31 32 33 34 35 36 37 38 39
41 42 43 44 45 46 47 48 49
51 52 53 54 55 56 57 58 59