Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Help me with making my own compiling program.
#1
Inspired by Martin Rampersad's article on QB Express Issue 2 I wanted to make my own compiling program and at it on the right click menu.

I've added the compile function in the menu like this:
[Image: download.php?id=216]

Here is what I programmed so far:
Code:
DIM File$
DIM SFile$
DIM Path$
DIM PF$
DIM Libs(99)            AS STRING
DIM LibNames(99)        AS STRING
DIM LibNr               AS INTEGER

'PF$ = "C:\QB\he.bas"
PF$ = COMMAND$

PF$ = LEFT$(PF$, LEN(PF$) - 1)
PF$ = RIGHT$(PF$, LEN(PF$) - 1)

PRINT PF$
SLEEP

DO
  Q = INSTR(PF$, "\")
  Path$ = Path$ + LEFT$(PF$, Q)
  PF$ = RIGHT$(PF$, LEN(PF$) - Q)
LOOP UNTIL Q = 0
File$ = PF$
SFile$ = LEFT$(File$, LEN(File$) - 4)

OPEN "C:\QB\Makeexe.ini" FOR INPUT AS #1
INPUT #1, LibNr
FOR i = 0 TO LibNr - 1
  INPUT #1, LibNames(i)
  INPUT #1, Libs(i)
NEXT
CLOSE #1

R$ = "C:\QB\Link " + SFile$ + ".OBJ /EX /NOE /NOD:C:\QB\Brun45.bi, " + SFile$ + ".EXE, NUL, C:\QB\BCOM45.LIB"
Sel = 0

DO

  CLS
  COLOR 3, 0
  PRINT "Do you want to ad any libs?"
  PRINT "Press Space to ad a lib and Press ESC to exit!"
  PRINT
  FOR i = 0 TO LibNr - 1
    IF Sel = i THEN
      COLOR 0, 3
    ELSE
      COLOR 3, 0
    END IF
    PRINT LibNames(i)
  NEXT i
  COLOR 3, 0

  DO
    Press$ = INKEY$
    SELECT CASE Press$
      CASE CHR$(0) + CHR$(80)
        Sel = Sel + 1
      CASE CHR$(0) + CHR$(72)
        Sel = Sel - 1
      CASE " "
        R$ = R$ + "+ " + Libs(Sel)
        PRINT "Library is added"
        SLEEP
    END SELECT
  LOOP UNTIL Press$ <> ""

  IF Sel < 0 THEN Sel = 0
  IF Sel > LibNr - 1 THEN Sel = LibNr - 1

LOOP UNTIL Press$ = CHR$(27)

Q$ = "C:\QB\BC " + Path$ + File$ + ", " + SFile$ + ".obj /O/T/C:512"

PRINT Q$
PRINT R$

SLEEP
SHELL Q$
SLEEP
SHELL R$
SLEEP

This is how the makeexe.ini file looks like
Code:
2
Rellib
C:\QB\LIBS\Rel.lib
RelMox
C:\QB\LIBS\Relmox.lib

But it still doesn't work on all .bas files.
Do any of you guys have any idea's???
Reply
#2
possibly save them all as text documents (use the radio button things when saving...switch it to "Text File - Readable by other programs" i think thats how it goes....)

that might work...


Oz~
Reply
#3
Quote:But it still doesn't work on all .bas files.
Do any of you guys have any idea's???

what errors do you get?
Reply
#4
I think i found the problem.

The program to be compiled can't find the files that are include so I should change:

REM $INCLUDE: 'Libname.bi'
in
REM $INCLUDE: 'C:\Path\Libname.bi'

----------------------------------------------------------
But I have another problem, I can't delete every .exe file I created this way. Is this problem caused because I editted the register maybe. I if somebody knows something please tell me.
Reply
#5
Or, you could make it set the path to where the BAS file is, that way you can still use relative paths.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)