RetroForum Welcome, Guest. Please login or register.
September 07, 2010, 05:27:52 AM
Home Help Search Calendar Login Register

RetroForth Discussion  |  Older Boards  |  Development  |  Topic: Executing Programs with RF « previous next »
Pages: 1 Go Down Print
Author Topic: Executing Programs with RF  (Read 1919 times)
Josef Gabriel
Jr. Member
***

Karma: +0/-0
Offline Offline

Posts: 23

I'm a llama!


View Profile
Executing Programs with RF
« on: October 07, 2005, 11:53:10 PM »

Hi all,

     I want to create a RetroForth script to do some file conversions for me. The script would use 2 other programs to do the work for me. I was wondering how to do this. The handbook covers using c functions, but not really programs.

Thank you,

Josef
Logged
Charles Childers
Administrator
Sr. Member
*****

Karma: +2/-0
Offline Offline

Posts: 745


View Profile WWW
Re: Executing Programs with RF
« Reply #1 on: October 08, 2005, 01:52:32 AM »

I assume that you want to invoke these other programs from inside RetroForth? If so, it can be done, but I'll need to know what OS you're doing the work on to make sure I use the proper API's when I write an example for you.
Logged
Josef Gabriel
Jr. Member
***

Karma: +0/-0
Offline Offline

Posts: 23

I'm a llama!


View Profile
Re: Executing Programs with RF
« Reply #2 on: October 08, 2005, 08:40:28 PM »

Charles,

     I am using Windows XP. I am planning on running Lame and TooLame with modifiers each.

Example: lame -a -b 80-e

Thank you,

Josef

Edit: Example: lame --decode <input.mp3> <output.wav> Where ouput.wav could be "-" like in stdout
tooLame -a -b 80 -e <output.wav from lame> <output.mp2>
« Last Edit: October 08, 2005, 09:51:29 PM by Josef Gabriel » Logged
Charles Childers
Administrator
Sr. Member
*****

Karma: +2/-0
Offline Offline

Posts: 745


View Profile WWW
Re: Executing Programs with RF
« Reply #3 on: October 08, 2005, 10:45:27 PM »

This isn't too hard; the hardest part will be building the strings initially. Here's a trivial example:


Code:
| This is the import+wrapper that we need to use
| to invoke external programs

from kernel32.dll
2 import WinExec
: run ( addr count -- ) zt 9 WinExec drop ;

| In a definitionL
: notepad s" notepad" run ;

| At the interpreter:
" notepad myfile.txt" run
Logged
Josef Gabriel
Jr. Member
***

Karma: +0/-0
Offline Offline

Posts: 23

I'm a llama!


View Profile
Re: Executing Programs with RF
« Reply #4 on: October 08, 2005, 11:08:49 PM »

Charles,

     This is wicked awesome.

Thank you,

Josef
Logged
Pages: 1 Go Up Print 
RetroForth Discussion  |  Older Boards  |  Development  |  Topic: Executing Programs with RF « previous next »
Jump to:  


Login with username, password and session length

Powered by MySQL Powered by PHP Powered by SMF 1.1 RC2 | SMF © 2001-2005, Lewis Media Valid XHTML 1.0! Valid CSS!