Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
exit codes in freebasic
#1
so, end # will send an exit code at the end of a program.
how can other freebasic programs detect this exit code? (preferably not using the windows api) it'd be nice if there were a cross-platform method of doing this. maybe make shell return the exit code or something?
ttp://m0n573r.afraid.org/
Quote:quote: "<+whtiger> you... you don't know which way the earth spins?" ... see... stupidity leads to reverence, reverence to shakiness, shakiness to... the dark side
...phear
Reply
#2
exec(), run() and chain() return the exit code.
Reply
#3
thanks. :bounce:
ttp://m0n573r.afraid.org/
Quote:quote: "<+whtiger> you... you don't know which way the earth spins?" ... see... stupidity leads to reverence, reverence to shakiness, shakiness to... the dark side
...phear
Reply
#4
i'm trying to use this for an interface to fbc from a program. i hacked something together that works, but it's super ugly Sad :barf:
there must be a better way of doing this, but it eludes me Sad
Code:
type returntype
   erroroutput as string
   returnnum as integer
end type

declare sub compilefile(byval filename as string,byval options as string,byref returned as returntype)

option escape
print "some stuffs before it ran...\nyup...\n\nblah\n\n\n\nyep :P"
dim results as returntype
line input "what file to compile?", fiel$
compilefile fiel$,"",results
if results.returnnum<>0 then
   print "error!"
   print "here's what i say to that: "; results.erroroutput
else
   print "everythings good!"
end if
sleep

sub compilefile(byval filename as string,byval options as string,byref returned as returntype)
   oldcsrlin=csrlin
   oldpos=pos
   color 0
   a=exec("c:\\fb\\fbc.exe",filename+options)
   for i=oldcsrlin to csrlin-1
      lien$=""
      for f=iif(i=oldcsrlin,oldpos,1) to 80
         lien$+=chr$(screen(i,f))
      next
      outpu$+=rtrim$(lien$)+"\n"
   next
   outpu$=left$(outpu$,len(outpu$)-1)
  
   numspaces=((csrlin)-oldcsrlin)*80+(pos-oldpos)
  
   locate oldcsrlin,oldpos:print string$(numspaces," "):locate oldcsrlin,oldpos
   color 7
   returned.erroroutput=outpu$

   returned.returnnum=a
end sub
ttp://m0n573r.afraid.org/
Quote:quote: "<+whtiger> you... you don't know which way the earth spins?" ... see... stupidity leads to reverence, reverence to shakiness, shakiness to... the dark side
...phear
Reply
#5
You are writing a ide with wx-c.dll for purebasic do ya... :wink:
8)
Keep up the good work Big Grin
Reply
#6
shhhhhhhhhh!

not really, i'm just porting vongodric's code since he used wxwidgets Tongue

too bad it's so long... i've been working on it for a week Tongue

most of the interface is ported, just have to port the edit & view menu functions and the compile menu functions, which are pretty straightforward (except for the compiling itself since it uses a non-ported function, hence the need for this)
ttp://m0n573r.afraid.org/
Quote:quote: "<+whtiger> you... you don't know which way the earth spins?" ... see... stupidity leads to reverence, reverence to shakiness, shakiness to... the dark side
...phear
Reply
#7
8)
It would be really great if fb would get a multiple platform ide...

BTW: did you solve the problem with the non existent wx scintilla control on linux?
Reply
#8
can't with this port i'm working on Sad
like i said wxstyledtextctrls aren't working under linux Sad
don't know why, maybe wxNET doesn't support them...

you're welcome to try to get them to work though :wink:
ttp://m0n573r.afraid.org/
Quote:quote: "<+whtiger> you... you don't know which way the earth spins?" ... see... stupidity leads to reverence, reverence to shakiness, shakiness to... the dark side
...phear
Reply
#9
ok a bit of digging reveals this:
Quote:

wxStyledTextCtrl


Requires contrib/stc, and --enable-stc build flag.

i never got the thing to build, i dunno if they didn't build the release version with support for it or what, but if someone else could compile it with said build flag, it'll make me feel worse when it doesn't work Tongue
ttp://m0n573r.afraid.org/
Quote:quote: "<+whtiger> you... you don't know which way the earth spins?" ... see... stupidity leads to reverence, reverence to shakiness, shakiness to... the dark side
...phear
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)