Jump to content
SomeoneFixThisShit

Why can't this language get even the simplest things done?

Recommended Posts

SomeoneFixThisShit
Dim $cData = ClipGet();

Dim $split = StringSplit($cData, '\n', 1);

MsgBox(0, "test", $split[0])

 

If I set $cData to "test\ntest" then it will work. But multiline data from the clipboard? It doesn't get split at all. And I tried \n, \r\n, @CR, @CRLF.

($split[0] is 1, even if I have a long multiline string in the clipboard)

 

Share this post


Link to post
Share on other sites
AutoBert

i have no problem with clipboard using standard data: 

#include <Array.au3>

$sData = 'Line 1\n'
$sData &= 'Line 2\n'
$sData &= 'Line 3\n'
$sData &= 'Line 4'

ClipPut($sData)

$aSplit = StringSplit(ClipGet(), '\n', 1);
_ArrayDisplay($aSplit)

So you must find out which delimiter are used and maybe fine tune with StringRegExp for your needs. Are there any delimiters in clipboard data?

Share this post


Link to post
Share on other sites
mikell

This language works nice if you do things as they should be done
So you can't even make difference between the string '\n' and the newline macro @LF ?
Please have a look at the help file before grumbling  :P

Dim $cData = ClipGet();

Dim $split = StringSplit($cData, @LF, 1);

MsgBox(0, "test", $split[0])

 

Share this post


Link to post
Share on other sites
Subz

Paste your text into something like Notepad++ turn on symbols and you can see what characters you can split on,.  As mikell and AutoBert have shown as long as you know the character to split on, it should work.  If it doesn't its usually because something you've missed, not a bug in Autoit.

"a good workman never blames his tools."

  • Like 1

Share this post


Link to post
Share on other sites
jchd

Why not fixing your own shit by after reading the help file seriously?

  • Thanks 1

This wonderful site allows debugging and testing regular expressions (many flavors available). An absolute must have in your bookmarks.
Another excellent RegExp tutorial. Don't forget downloading your copy of up-to-date pcretest.exe and pcregrep.exe here
RegExp tutorial: enough to get started
PCRE v8.33 regexp documentation latest available release and currently implemented in AutoIt beta.

SQLitespeed is another feature-rich premier SQLite manager (includes import/export). Well worth a try.
SQLite Expert (freeware Personal Edition or payware Pro version) is a very useful SQLite database manager.
An excellent eBook covering almost every aspect of SQLite3: a must-read for anyone doing serious work.
SQL tutorial (covers "generic" SQL, but most of it applies to SQLite as well)
A work-in-progress SQLite3 tutorial. Don't miss other LxyzTHW pages!
SQLite official website with full documentation (may be newer than the SQLite library that comes standard with AutoIt)

Share this post


Link to post
Share on other sites
JLogan3o13

@SomeoneFixThisShit so after creating a nasty thread it turns out to be your own lack of coding skill. Per your report we will not remove this thread but will lock it so that others can see 99.9% of the time it isn't the language's fault you aren't capable of figuring something out.

If you approach future thread with the same attitude, be assured your time on this forum will be brief.

  • Like 1

√-1 2^3 ∑ π, and it was delicious!

Share this post


Link to post
Share on other sites
Guest
This topic is now closed to further replies.

×