12-14-2024, 07:52 PM
Hi friends
here I share just some thinking about variable of type STRING and of FIXED lenght
in QBasic and in QB64 is possible to create variables of type STRING with a fixed lenght.
wiki di STRING
There is some little differences between STRING and FIXED STRING.
1. The last type cannot be initializated as a void string o null string because it must keep its fixed dimension.
2. the fixed string cannot add value in tail because it must keep its fixed dimension
so in runtime it cannot recursively modify itself
please run this code to get the experience of this behaviour
Can be this enough interesting to note into wiki of STRING?
thanks for feedbacks
here I share just some thinking about variable of type STRING and of FIXED lenght
in QBasic and in QB64 is possible to create variables of type STRING with a fixed lenght.
wiki di STRING
There is some little differences between STRING and FIXED STRING.
1. The last type cannot be initializated as a void string o null string because it must keep its fixed dimension.
2. the fixed string cannot add value in tail because it must keep its fixed dimension
so in runtime it cannot recursively modify itself
please run this code to get the experience of this behaviour
Code: (Select All)
Dim a As String * 8, b As String, c As String * 2, d As Integer
' initialization to a void/null string
a = ""
b = ""
c = ""
Print " a c b"
Print ">" + a + "<", ">" + c + "<", ">" + b + "<"
' filling the string variable
For d = 1 To 10
a = a + LTrim$(Str$(d))
c = c + LTrim$(Str$(d))
b = b + LTrim$(Str$(d))
Next d
Print ">" + a + "<", ">" + c + "<", ">" + b + "<"
End
Can be this enough interesting to note into wiki of STRING?
thanks for feedbacks