TIP: Click on subject to list as thread! ANSI
echo: c_plusplus
to: ALL
from: RICKEY PARRISH
date: 1998-03-21 00:18:00
subject: help with a front-end

Hello.  Im writing a simple front-end for a program that I have here, and I 
have a few questions:
1)      heres part of the code:
char *runit;                    // not sure if char *runit is right :)
runit="mpg123";                 // program i wanna run is mpg123
runit=runit + "-m -z /stuff/mp3s/example.mp3"; 
                                // i'll add a few questions, and these
                                // are just example run-time arguments
                                // that i might use.  so i wanna run
                                // mpg123 -m -z /stuff/mp3s/example.mp3
                                // id use the + in qbasic, but this isnt
                                // qbasic :)  (how do i add text to a string  
                               // that already exists is my question here)
system(runit);                  // this is about the only thing that i know
                                // works.  its prolly the wrong way to shell
                                // and run a new program, but hey, if it aint
                                // broke, dont fix it :)
2)      id like to have a config file for this program.  i THINK 
open("test.txt"); works, but im not sure because I dont know how to write to 
it or close it or anything :)  any help there would be appreciated.  all the 
file needs to be is a simple text file with a different option on each line.  
it might look like:
--
/usr/local/bin/mpg123
/win95/windows/desktop/mp3s
yes
no
yes
yes
no
yes
--
or i could even use 1 for yes, 0 for no, or something like that if its easier 
than using words.
3)      last thing: getting input.  im using c=getc(stdin); to get the input, 
but i dont have a help file (yet), so i dont know how to use
case blah
        do this
case blah2
        do this instead
end case
or even if that is used in C.  im just switching from quickbasic right now :)
im gonna get RHIDE, an IDE recommended to me, and hopefully i'll be able to 
figure some of this out for myself.
thanks a lot for any help.  ttyl
--- Maximus/2 2.02
---------------
* Origin: T-Shirts 'N Genes BBS Duncan Canada (250) 748-3408 (1:340/204)

SOURCE: echomail via exec-pc

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.