Posting code examples to this forum

For everything that's not in any way related to PureBasic. General chat etc...
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by PB.

I've just noticed that if you don't format your code with (CODE) and (/CODE),
then you are able to paste the copied code into the PureBasic editor correctly,
that is, with line breaks where they're supposed to be. The only downside is
that you lose indentation formatting, but at least you're not trying to fix the
line breaks manually, which is a real hassle with long code snippets!

For example, try copying and pasting both these examples into PureBasic, and
note which does it correctly...

; This is a non-formatted example.
; It posts with correct line-breaks,
; but unfortunately loses indents.
Repeat
a=a+1
ForEver

Code: Select all

; This is a formatted example.
; It posts with incorrect line breaks,
; but with correct indents.
Repeat
  a=a+1
ForEver
So... I would suggest not using the formatted method, simply because it makes
it pointless for copying-and-pasting into the PureBasic editor. Comments?


PB - Registered PureBasic Coder

Edited by - PB on 29 July 2002 13:37:36
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by El_Choni.

Hmm, maybe you're using IE? Mozilla 1.1a copies the formatted text just as it was posted. Maybe we should post both versions of the code to allow cross-browser copying XD.

Sorry :wink:, bye,

El_Choni
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by Danilo.

>So... I would suggest not using the formatted method, simply because it makes
>it pointless for copying-and-pasting into the PureBasic editor. Comments?

I dont like that because its NOT readable.

If you want to copy&paste, paste in Wordpad first
and copy&paste from there to PureBasic - or just hit
the "reply with quote" button and copy from there
until the forum is fixed.

cya,
...Danilo

(registered PureBasic user)
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by PB.

> maybe you're using IE?

Yep. I should have known Micro$oft's browser was the problem.

> I dont like that because its NOT readable.

True, but when copying someone else's code to test a problem, it's quicker,
especially because formatting is not needed during quick testing.

But as pointed out, Internet Explorer is the cause. I just tried it with Opera
and it copies normally. Oh well, I guess I'll have to use the inconvenience of
Wordpad when copying text (grrr!).

PB - Registered PureBasic Coder
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by fweil.

...,

I am using IE also with that issue (cut/paste bad result) so that I use to open the destination file with Wordpad to keep correct formatting (except leading blanks or tabs).

To send code examples I never use

Code: Select all

 marker, but I never have had any remark about the result. Now I understand that most of people will not have problems because I do not use it.

I also checked with my Netscape (4.7) and it works for both tagged and untagged code.

I just not use Netscape for visiting PureBasic web site because some page generate bugs.

I just red the page source code (of this page where I am now writing this message), and I was surprised reading the Web page content with so much scripts. It makes nice things but I am not sure it will be easy to have a compatible code for all browsers.

For the problem you mentionned PB, I think it just comes from that IE does not convert  to  when cut/pasting to PB editor.

What makes it different using a Mozilla1.1 browser because the text clipboard is probably the same at start. Is it a problem that could be managed from PB editor at paste of data ?

Francois Weil
14, rue Douer
F64100 Bayonne
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by Iontichy.
- or just hit
the "reply with quote" button and copy from there

cya,
...Danilo
I use the same solution with IE

---------------
star traveler
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by MrVainSCL.

Hi @ all
You can copy formated code-snips of "

Code: Select all

" sections correctly to your PureEditor if you copy it as normal and hold down the shift key (also shift+strg+v) to paste it correct to the editor... The editor will not tokenize it... so just save the pasted stuff as temp.pb and reload it.. works very fine for me... I use IE too...

PIII450, 256MB Ram, 6GB HD, RivaTNT, DirectX8.1, SB AWE64, Win2000 + all Updates...

greetz
MrVainSCL! aka Thorsten
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by Danilo.

Yes, you have to save and reload it first.
2 extra Steps that are not needed in a "normal" Editor.

The SHIFT+STRG+V (SHIFT+CTRL+V) method doesnt
Syntax highlight the pasted Text (its black on
black here) and the Font is also changed.

Lets hope for a better Editor... or at least the SourceCode.

cya,
...Danilo

(registered PureBasic user)
Post Reply