Login
Username:

Password:

Remember me



Lost Password?

Register now!

Sections

Who's Online
57 user(s) are online (43 user(s) are browsing Forums)

Members: 1
Guests: 56

benny, more...

Support us!

Headlines

 
  Register To Post  

[Solved ... using AWNPipe texteditor]
Quite a regular
Quite a regular


See User information
Hi all,

Recently, I have been experimenting with AWNPipe.

I have created some nice GUI using AWNPipe for window, menu, toolbar buttons, and text display.

Now, I want to use AWNPipe text editor function to actually edit an existing text file and then save the file after the changes.

I have figured out how to create the texteditor gadget and how to display the file. As I type, the new text shows up in the display,
but I can't figure out how to actually save the file.

I am assuming that AWNPipe uses the Reaction texteditor.gadget.

Any help would be appreciated.

----
redfox


BTW, this was very easy to do with RxMUI and the MUI texteditor gadet. The MUI texteditor gadget has an open file command and a save file command. Easy, peesy.


Edited by redfox on 2025/9/11 18:41:23
Edited by redfox on 2025/9/11 18:43:51
Edited by redfox on 2025/9/11 18:45:00
Edited by redfox on 2025/9/13 4:05:12
Edited by redfox on 2025/9/13 4:05:42
Go to top
Re: How do I save text from AWNPipe texteditor gadget to a file?
Just can't stay away
Just can't stay away


See User information
Hi, if you can use texteditor_gd AREXX comamnd,maybe:

POSITION SOF
MARK ON
POSITION EOF
COPY

as "data" is on clipboard, create a file and paste contents.

Go to top
Re: How do I save text from AWNPipe texteditor gadget to a file?
Quite a regular
Quite a regular


See User information
@jabirulo

Thank you for the suggestion, however, nothing appeared in clipboard, so I decided to use NotePad instead.

Cheers,
redfox

Go to top
Re: How do I save text from AWNPipe texteditor gadget to a file?
Quite a regular
Quite a regular


See User information
Update...

I understand what jabirulo was suggesting ...

POSITION SOF
MARK ON
POSITION EOF
COPY

was supposed to mark the text from start of file to end of file,
then copy the text to the clipboard.


After alot of trial and error, today I got the COPY command to work, but I have to manually highlight the the text with the mouse. I can't get the other commands to work. I just get a "received ok" response from the texteditor gadget.

The following ARexx command seems to copy the highlighted text to the clipboard.

call topipe('ID 'TE' command="COPY"')

ID 'TE' is a variable name for my texteditor gadget.

However, when I try to copy from the clipboard to a text file,
the text has a filetype header imbedded in the first line.

FORM2FTXTCHRS&

Again ... rather than reinvent the wheel, I decided to just use NotePad instead. I can prefill text into the textfile, edit with NotePad if I need to make changes, save the file and move on. It is easy to launch NotePad using an ARexx script.

address command 'SYS:Utilities/NotePad "filename"'


Update...

Used ARexx delete string command to delete those extra characters in the clipboard file. There must have been some nonprintable characters, because I could see 14 but had to delete 20.

Now working fine without NotePad. Please note, my program is not a replacement for NotePad or any other editor. This is simply a learning exercise to get more experience tinkering with ARexx and AWNPipe. I still have alot of debug code, but it works now.

I must highlight all the text in the editor window. I use the COPY function to copy from editor to clipboard, then I "save" the text back to the original text file by using ARexx readln and writeln commands to copy from clipboard to text file.

Cheers,
redfox


Edited by redfox on 2025/9/13 4:04:12
Edited by redfox on 2025/9/13 4:08:55
Go to top

  Register To Post

 




Currently Active Users Viewing This Thread: 1 ( 0 members and 1 Anonymous Users )




Powered by XOOPS 2.0 © 2001-2024 The XOOPS Project