Code: Select all
Debug Len(#CRLF$) ; Returns 2
a$="123"+#CRLF$+"456"+#CRLF$+"789"
For i=1 To CountString(a$,#CRLF$)+1
Debug StringField(a$,i,#CRLF$)
Next
Code: Select all
Debug Len(#CRLF$) ; Returns 2
a$="123"+#CRLF$+"456"+#CRLF$+"789"
For i=1 To CountString(a$,#CRLF$)+1
Debug StringField(a$,i,#CRLF$)
Next
Manual wrote: Delimiter$ The string delimiter to use to separte the fields. It can be a multi-characters delimiter.
14 February 2013 : Version 5.10MachineCode wrote:I see in the manual that StringField's delimiter can only be one character. But, this works with #CRLF$. Why?
Code: Select all
Debug Len(#CRLF$) ; Returns 2 a$="123"+#CRLF$+"456"+#CRLF$+"789" For i=1 To CountString(a$,#CRLF$)+1 Debug StringField(a$,i,#CRLF$) Next
Syntax
Result$ = StringField(String$, Index, Delimiter$)
Description
Returns the string field at the specified index.
Parameters
String$ The string to parse.
Index The field index to return. The first index is 1.
Delimiter$ The string delimiter to use to separate the fields. It can be a multi-characters delimiter.
Example
Supported OSCode: Select all
For k = 1 To 6 Debug StringField("Hello I am a splitted string", k, " ") Next
All
Interesting! But I'm still using 5.00 at the moment, so I never saw the new manual change.ts-soft wrote:But it works with PB4.10+
I assume always we talk about latest final, stable versions. If you speak about any older version, it would be helpful to mention it.ts-soft wrote:But it works with PB4.10+
MachineCode wrote:Without looking at the manual (since 5.10 is not installed ATM), does LTrim() and RTrim() support multi-character removal too?
LTrim & RTrim v5.10 wrote:'Character$' has to be a one character length string
Where have you your eyes? PB4.10+ means all Versions, since PB4.10.Danilo wrote:I assume always we talk about latest final, stable versions. If you speak about any older version, it would be helpful to mention it.ts-soft wrote:But it works with PB4.10+
"Not in the helpfile" means it is not officially supported by version 5.0 he is using. It is like the new 'string.s + i.i' feature - still experimental (means: not working correctly in all cases) and not mentioned in the manual,ts-soft wrote:MachineCode speaks over PB5.00, this can you see, as he mentioned, this is not in the helpfile.
Do you mean this feature isn't mentioned? If so, check this out:Danilo wrote:[...] It is like the new 'string.s + i.i' feature - still experimental (means: not working correctly in all cases) and not mentioned in the manual, not mentioned in the history.
PB 5.10 history wrote:- Added: autocast of numeric values when string are involved, allowing to concatenate string and numeric in constants
Yes, this is exactly what I meant. It is mentioned in the history in this case (thank you!), ...[removed blah blah]c4s wrote:Offtopic:Do you mean this feature isn't mentioned? If so, check this out:Danilo wrote:[...] It is like the new 'string.s + i.i' feature - still experimental (means: not working correctly in all cases) and not mentioned in the manual, not mentioned in the history.PB 5.10 history wrote:- Added: autocast of numeric values when string are involved, allowing to concatenate string and numeric in constants
Code: Select all
a$="123"+#CRLF$+"456"+#CRLF$+"789"
For i=1 To CountString(a$,#CRLF$)+1
s.s=StringField(a$,i,#CRLF$)
Debug Str(Asc(s))+" / "+Str(Asc(Trim(s,#LF$)))+" : "+s+" / "+Mid(s,2,3<<4)
Next