Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
tok _command
#1
do you have a better idea how to split filepath from _command ?
(drop file on exe or shortcut)
problem is that a filename can also have spaces, so using space
as a delimiter is not really helpful.

Code:
Copy      Help
ARRAY(str) arr
int j nt
nt = tok(_command arr -1 " ")
for(j 0 nt) out arr[j]

thanks
pi
#2
what string it is?
#3
the shortcut commandline:

"C:\Programme\Quick Macros 2\qmcl.exe" M "filecoast_upload" C

when drop more than 1 file tok is nessesary, because i want to make
only one upload a time.

for example:
E:\something to upload\test5785.zip E:\something to upload\test 1.zip
pi
#4
Are they without quotes? I receive with quotes.

Code:
Copy      Help
;out _command

str s="''C:\Documents and Settings\G\Desktop\winamp.txt'' ''C:\Documents and Settings\G\Desktop\todo.txt''"
ARRAY(str) a
tok s a -1 "'' " 4
int i
for i 0 a.len
,out a[i]
,
#5
Gintaras Wrote:Are they without quotes? I receive with quotes.
i removed the quotes while posting.
it has quotes when a space is in the filename, but not when there is no space.

E:\upload\test1.zip E:\upload\test5785.zip
"E:\something to upload\test5785.zip" "E:\something to upload\test 1.zip"
pi
#6
The example will work. When you specify flag 4 and include ", delimiters within "" are ignored.
#7
yep, works.
thanks again.
pi


Forum Jump:


Users browsing this thread: 1 Guest(s)