Page 1 of 1

Left(a$,-2); StringFieldSize(a$,seperator)

Posted: Tue Oct 25, 2011 8:41 am
by GPI
left(a$,-2) should be the same as left(a$,len(a$)-2), same for right(a$,-2)

Also a build in

Code: Select all

Procedure StringFieldSize(String$,Separator$)
  count=1
  For I=1 To Len(string$)
    If Mid(string$,i,1)=Separator$
      count+1
    EndIf
  Next
  ProcedureReturn count
EndProcedure
Would be nice.

Re: Left(a$,-2); StringFieldSize(a$,seperator)

Posted: Tue Oct 25, 2011 8:45 am
by Trond
You mean like CountString()?

Re: Left(a$,-2); StringFieldSize(a$,seperator)

Posted: Tue Oct 25, 2011 11:52 pm
by netmaestro
CountString would need to have 1 added to it to return the correct number of stringfields.

I like the idea but I think StringFieldCount() might be a more descriptive name. However, they seem to be moving away from Count()'s in favor of Size(), like ListSize(), etc. so maybe Size() would be better after all to conform with the rest.