Loading ...
Sorry, an error occurred while loading the content.

RE: [libertybasic] Re: how to calculate lines that contains numbers?

Expand Messages
  • Stefan Pendl
    ... Why do you use STR$(), DATE$() already returns a string in this case? ---code start (watch for line wraps) call SplitText date$(), call SplitText
    Message 1 of 11 , Dec 1, 2008
    • 0 Attachment
      >
      > Bill,
      > I readily admit, in my post i reversed the (d$, n, "/")
      > (only in my post, not in my program)
      >
      > I thought I made my question clear....
      > d$ = str$(Date$(d))
      > print "d$ = "; d$
      > result is >> d$ = '09/08/2008'
      >
      > Please note that Date$(number) produces chr$(39), then
      > "09/08/2008", then chr$(39)
      >
      > My question is: how to parse d$ using Word$()?
      >

      Why do you use STR$(), DATE$() already returns a string in this case?

      '---code start (watch for line wraps)
      call SplitText date$(), " "
      call SplitText date$("mm/dd/yyyy"), "/"
      call SplitText date$("mm/dd/yy"), "/"
      call SplitText date$("yyyy/mm/dd"), "/"
      call SplitText date$(36485), "/"
      end

      sub SplitText String$, Delimiter$
      Count = 0
      print
      print String$

      do
      Count = Count + 1
      print Count; ". Word is ... "; word$(String$, Count, Delimiter$)
      loop until word$(String$, Count + 1, Delimiter$) = ""
      end sub
      '---code end

      ---
      Stefan Pendl
    Your message has been successfully submitted and would be delivered to recipients shortly.