File: splitString.pcm

package info (click to toggle)
extrema 4.4.4.dfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 19,416 kB
  • ctags: 6,689
  • sloc: cpp: 88,991; sh: 8,229; makefile: 480
file content (43 lines) | stat: -rw-r--r-- 710 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
!
! long string = ?1
! number of strings = ?2
! vector of strings = ?3
! error flag = ?4
!
?4 = 0
!
! eliminate blanks at the beginning of long string
!
do i__ = [1:clen(?1)]
  if nes(?1[i__],' ') then
    start__ = i__
    goto NEXT
  endif
enddo
?4 = 1
return
!
NEXT:
!
?2 = 1
TOP:
  j__ = index(?1[start__:#],' ')
  if (j__=0) then j__=clen(?1)-start__+2
  ?3[?2] = ?1[start__:j__+start__-2]
  if (j__+start__-2>=clen(?1)) then goto DONE
  if (clen(?1)>=j__+start__+1) then
    do i__ = [j__+start__:clen(?1)]
      if nes(?1[i__],' ') then
        start__ = i__
        goto NEXT_2
      endif
    enddo
  endif
  NEXT_2:
  if (?2>10) then return
  ?2 = ?2+1
goto TOP
!
DONE:
!
destroy i__ j__ k__ start__