Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Problem parsing copy/paste buffer with tok()
#1
I wrote a program to read the copy buffer from Excel and enter values into a web table.

It works fine except the decimal "." character is recognized as a delimiter and I want the decimal in the value output to the table.

I've tried to exclude the decimal "." character in the delimiter array d but can't get it to work

????

john black
garland, tx USA

;; create variables
str s s2 ;;string to store clipboard
ARRAY(str) a ;;array of strings from clipbloard

int i j
int nt ;;number of tokens

;; set delimeters to all blanks < 33, < and >
;; set period to non-delimitter

str d.all(256 2 0)
d.set(1 0 33)
d[34]=1; d['<']=1; d['>']=1; d[46]=0

;; here is the parse routine

nt = tok(s a 1000 d)

for(i 0 nt)
a[i].setsel
key T
#2
With table use flag 0x100.
Can use tok without table. Delimiters can be " [9][]<>". It is space, tab, new line characters, <, >.
#3
Thanks!!! It worked.
Great support!!!


Forum Jump:


Users browsing this thread: 1 Guest(s)