Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Professional Discussion / Use wordpad instead of notepad

Author
Message
Battoad
AGK Developer
19
Years of Service
User Offline
Joined: 12th Feb 2007
Location: A Dark Place
Posted: 24th Mar 2014 12:44
Is it possible to opt for wordpad to open a txt document instead of notepad without altering default programs.

I want to keep notepad as my normal default text editor but for one DBpro program I need the text to be written and read from wordpad.

Can I specify to use wordpad from within my DBpro program.

Green Gandalf
VIP Member
21
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 24th Mar 2014 12:54
Quote: "but for one DBpro program I need the text to be written and read from wordpad"


What do you mean? What text are you talking about?



Powered by Free Banners
tiffer
20
Years of Service
User Offline
Joined: 6th Apr 2006
Location: Scotland
Posted: 24th Mar 2014 12:55
What's wrong with using an IDE?

Cwatson
Green Gandalf
VIP Member
21
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 24th Mar 2014 12:56
Indeed.



Powered by Free Banners
Battoad
AGK Developer
19
Years of Service
User Offline
Joined: 12th Feb 2007
Location: A Dark Place
Posted: 24th Mar 2014 13:19 Edited at: 24th Mar 2014 13:20
Confusion!
From within a DBPro program I am writing, I wish to write/copy some text into wordpad instead of using my default text editor, notepad, as you may do with game scores etc. i.e make & write a txt file.
I would like to be able to specify wordpad to write to from within my program without having to change default programs each time I run this specific DBPro program.

If this can be done using an IDE, can you explain further?

Green Gandalf
VIP Member
21
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 24th Mar 2014 13:27
How are you writing text from within your DBPro program? Do you mean your program is opening Notepad for you? If so why don't you open with Wordpad instead? I'm still rather confused as to what the problem is.



Powered by Free Banners
Barry Pythagoras
12
Years of Service
User Offline
Joined: 14th Mar 2014
Location:
Posted: 24th Mar 2014 13:33 Edited at: 24th Mar 2014 13:37
I typed hello, and saved it with wordpad, then I changed the document name to document.txt.

You get this...

Quote: "{\rtf1\ansi\ansicpg1252\deff0\deflang2057{\fonttbl{\f0\fswiss\fcharset0 Arial;}}
{\*\generator Msftedit 5.41.15.1515;}\viewkind4\uc1\pard\f0\fs20 Hello\par
}"


I then made a new txt document, and pasted that line into it. Then I changed the text document to rtf.

It worked!

So, to make a document work with wordpad include the extra formatting in my quote, and save it as .rtf then it will work. You can test all of the formatting by renaming files between txt, and rtf.
Battoad
AGK Developer
19
Years of Service
User Offline
Joined: 12th Feb 2007
Location: A Dark Place
Posted: 24th Mar 2014 13:37 Edited at: 24th Mar 2014 13:38
ok sorry for not getting my problem across.
I create a txt file from within DBpro. My default text editor is notepad, so the txt file is opened with notepad.
I can change my default programs in windows to change the default text editor to wordpad, in which case my txt file is then opened in wordpad.
However I want to keep notepad as my default windows text editor but want just one specific DBPro program to use wordpad to open the txt files related to this DBPro program.
I do not want to have to keep changing my windows default programs each time, so is it possible to specify a specific text editor such as wordpad from within DBPro, to open txt files for a specific DBPro program without manually changing default settings each time.

Hope I have explained clearly enough.

oops missed the reply from Barry.

Green Gandalf
VIP Member
21
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 24th Mar 2014 13:42
Why don't you use Wordpad as I said before? I'm still confused as to what the real problem is. The following code works perfectly for me. No need to mess about with default settings etc.




I'm using 64bit W7. Wordpad might be located somewhere else on your system.



Powered by Free Banners
Barry Pythagoras
12
Years of Service
User Offline
Joined: 14th Mar 2014
Location:
Posted: 24th Mar 2014 13:44
Text files end with .txt
Wordpad files end with .rtf
And DBPro files end with .dba and .dbpro

Windows often hides the extensions, but they are there. It sounds like you want to open .dba with wordpad.

Right click..Open With/Choose Program

might work.
Battoad
AGK Developer
19
Years of Service
User Offline
Joined: 12th Feb 2007
Location: A Dark Place
Posted: 24th Mar 2014 13:46
@ Barry, thank you. Just tested it. Changing txt to rtf opens up using wordpad whilst keeping other txt documents to be opened in notepad.

Brill, works a treat, thanks.

Battoad
AGK Developer
19
Years of Service
User Offline
Joined: 12th Feb 2007
Location: A Dark Place
Posted: 24th Mar 2014 13:54
@ GG, thanks also. Both solutions are good.

I need to use a specific program to open a document and I wasn't sure how to do this if the program to be used to open the document wasn't the default. By executing wordpad first doesn't affect any default program but opens the txt document as required.
Your solution in executing wordpad.exe is possibly more useful as it allows for any further options requiring other specific programs to be called into action when they differ from the defaults.

many thanks, glad we got there.

tiffer
20
Years of Service
User Offline
Joined: 6th Apr 2006
Location: Scotland
Posted: 24th Mar 2014 14:00
would be interesting to know what your working on.

Cwatson
Battoad
AGK Developer
19
Years of Service
User Offline
Joined: 12th Feb 2007
Location: A Dark Place
Posted: 24th Mar 2014 14:09
Hi tiffer, no probs.

I am exploring the possibilities of a pdf editor, stumbled upon by accident.

When I copy text from a pdf and paste it into a txt document, if the txt document is opened with notepad then I get a long "column" of text, not much use to anyone, however if it is opened with wordpad then the layout is as it should be,

I think it may be possible to create a pdf editor for free instead of acrobats high price.

Blobby 101
20
Years of Service
User Offline
Joined: 17th Jun 2006
Location: England, UK
Posted: 24th Mar 2014 15:03
The issue (as far as I'm aware) isn't with the program it's opening with, but with the file format itself - .PDF and .RTF files contain formatting information, whereas .txt is just plain text.

tiffer
20
Years of Service
User Offline
Joined: 6th Apr 2006
Location: Scotland
Posted: 24th Mar 2014 15:40
You would have to explore the pdf format specifically.

Cwatson
Battoad
AGK Developer
19
Years of Service
User Offline
Joined: 12th Feb 2007
Location: A Dark Place
Posted: 24th Mar 2014 15:42 Edited at: 24th Mar 2014 15:43
@Blobby 101
Interesting and probably true but the plot thickens.

If I open a pdf, select all, copy and paste into a notepad txt, formatting is lost.
However, if I open a pdf, select all, copy and paste into a wordpad RTF,(formatting correct), but then save RTF, select all and copy from the rtf and then paste into notepad txt, layout formatting is still applied correctly in the txt file.

Green Gandalf
VIP Member
21
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 24th Mar 2014 16:10 Edited at: 24th Mar 2014 16:16
Quote: "if I open a pdf, select all, copy and paste into a wordpad RTF"


Doesn't work for me. I can select all - but I can't copy and paste it elsewhere. Which version of Adobe Reader are you using? I'm using 10.1.9.

Edit Weird. It does now. Anyway, how can you keep the formatting in Notepad? The sample pdf file I've just tested has a variety of fonts.



Powered by Free Banners
Battoad
AGK Developer
19
Years of Service
User Offline
Joined: 12th Feb 2007
Location: A Dark Place
Posted: 24th Mar 2014 16:16
Quote: "Which version of Adobe Reader are you using?"


11.0

Green Gandalf
VIP Member
21
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 24th Mar 2014 16:17
See edit.



Powered by Free Banners
Barry Pythagoras
12
Years of Service
User Offline
Joined: 14th Mar 2014
Location:
Posted: 24th Mar 2014 16:29 Edited at: 24th Mar 2014 16:35
Quote: "However, if I open a pdf, select all, copy and paste into a wordpad RTF,(formatting correct), but then save RTF, select all and copy from the rtf and then paste into notepad txt, layout formatting is still applied correctly in the txt file."


I think that you are seeing .rtf formatting. I don't get any PDF formatting when I try it. Although I do get some raw links.

If I rename a PDF as rtf I get a mess.
Battoad
AGK Developer
19
Years of Service
User Offline
Joined: 12th Feb 2007
Location: A Dark Place
Posted: 24th Mar 2014 16:33
Quote: "select all and copy from the rtf and then paste into notepad txt, layout formatting is still applied correctly in the txt file"


The fonts etc are not formatted because that's not possible, but the layout is.

If you copy from pdf and paste directly into a txt document opened by notepad, you will just get a long column.

If you copy from pdf and paste directly into a document opened by wordpad, you will maintain layout and formatting.

If you then copy from wordpad and paste back into a txt document opened by notepad, you will keep the layout far closer than by copying from pdf to txt opened with notepad.

Barry Pythagoras
12
Years of Service
User Offline
Joined: 14th Mar 2014
Location:
Posted: 24th Mar 2014 16:36 Edited at: 24th Mar 2014 16:38
Oh I see yes, you get the correct layout. But you were trying to save to PDF I thought. That still isn't going to work.
Battoad
AGK Developer
19
Years of Service
User Offline
Joined: 12th Feb 2007
Location: A Dark Place
Posted: 24th Mar 2014 17:43
Quote: "Oh I see yes, you get the correct layout. But you were trying to save to PDF I thought."


No I got side tracked when it was suggested that no formatting takes place in txt files opened in notepad. There has to be some although very little and whatever it will be no use to me.

I can use the rtf format or files opened with wordpad to keep original formatting even after editing, but converting back to pdf is a different matter. I have an idea or two on how this may be achieved but I am not at that stage yet.

This thread, now answered for me, was how to ensure the text file is opened by wordpad and not my default notepad.

Thanks for all contributions.

Login to post a reply

Server time is: 2026-07-06 10:39:24
Your offset time is: 2026-07-06 10:39:24