Announcement

Collapse
No announcement yet.

#COMPILE EXE ?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Semen Matusovski
    replied
    Peter -

    I selected more friendship variant.
    I prefer another variant (release' files in main directory, source and resource modules in subdirectories).
    To avoid such problems with exe I wrote small fictive module.
    To be more clear, I describe a technique on your sample.

    ONE TIME somewhere you compile this module
    (let's name it fict.bas)

    Code:
    #Compile Exe
    #Register None
    #Include "Win32Api.Inc"
    DefLng A-Z
    Function PbMain
       Local TmpAsciiz As Asciiz * %MAX_PATH
       lResult = GetModuleFileName(ByVal 0, TmpAsciiz, SizeOf(TmpAsciiz) - 1)
       If lResult = 0 Then Exit Function
       i = 0
       Do
          j = Instr(i + 1, TmpAsciiz, "\")
          If j = 0 Then Exit Do Else i = j
       Loop
    
       CatalogExe$ = Left$(TmpAsciiz, i)
       If Right$(CatalogExe$, 1) <> "\" Then CatalogExe$ = CatalogExe$ + "\"
       ExeName$ = Mid$(TmpAsciiz, i + 1)
    
       y = Shell(CatalogExe$ + "Release\" + ExeName$, 1): Sleep 0
    
    End Function
    When you want to debug a new program, you copy fict.exe to a directory with BAS and rename it to myprog.exe.

    Now you can use Compile.Exe "Release\Myprog.Exe", because IDE will start the fictive module from the same directory as BAS.
    Fictive module defines full path (for example, C:\Prog\MyProg.Exe") and in own turn start C:\Prog\Release\MyProg.Exe (prepared by IDE).

    ------------------

    Leave a comment:


  • Lance Edmonds
    replied
    not at this time. this is covered in the faq forum http://www.powerbasic.com/support/pb...hread.php?t=32

    the workaround is to place a shortcut on the desktop to the target exe, then open the properties to the shortcut and assign a "shortcut key" such as ctrl + alt + 1

    this way you can launch the exe after compiling simply by pressing the chosen shortcut key combination.


    ------------------
    lance
    powerbasic support
    mailto:[email protected][email protected]</a>

    Leave a comment:


  • Guest's Avatar
    Guest started a topic #COMPILE EXE ?

    #COMPILE EXE ?

    I like to have a sub-directory called Release containing the application-exe-file, and a sub-directory called Resource containing the resource-files. Therefore i initialte my programs with:

    #COMPILE EXE "Release\MyProg.exe"
    #RESOURCE "Resource\Script1.pbr"

    The problem is that when i press ctrl+E (Build and Execute) to compile my program, the program is not executed. The reason is that PB tries to execute "MyProg.exe" instead of "Release\MyProg.exe". Is there a way to solve this problem ?

    Regards
    Peter

    [This message has been edited by Peter Stephensen (edited March 19, 2000).]
Working...
X