Hello NG,
I try to use the String Function to fill a String Variable.
Here is my Code:
VName$ = String(255, Chr(0))
Serial$ = String(255, Chr(0))
FSName$ = String(255, Chr(0))
GetVolumeInformation_("C:\", VName$, 255, Serial$, 0, 0, FSName$, 255)
CallDebugger
Debug VName$
Debug Serial$
Debug FSName$
OpenConsole()
PrintN(VName$)
PrintN(Serial$)
PrintN(FSName$)
Input()
I get the Error String is not a function, an array or a linked list.
Any Ideas??
Thanks for all your help
Stefan
CloseConsole()
End
String Funktion
Re: String Funktion
> VName$ = String(255, Chr(0))
In addition to what thefool said, it also must be mentioned that you cannot
use Chr(0) in strings, as that is used to terminate a string. If you need to
fill a string, better to use something like Space(255) instead (to fill it with
255 spaces).
In addition to what thefool said, it also must be mentioned that you cannot
use Chr(0) in strings, as that is used to terminate a string. If you need to
fill a string, better to use something like Space(255) instead (to fill it with
255 spaces).
Code: Select all
a$=Chr(0)+Chr(0)+Chr(0)
Debug Len(a$) ; Returns 0, not 3.
I compile using 5.31 (x86) on Win 7 Ultimate (64-bit).
"PureBasic won't be object oriented, period" - Fred.
"PureBasic won't be object oriented, period" - Fred.