Member Avatar for b1izzard

Hi all, I want to compile the cobol program with a click of a button in toolbar provided if its compiler location and command to compile is specified.
e.g

c:\cob>cobol hello.cob 'command line equivalent

VB equivalent:

Dim command As String
         command = "cd " & app_path 
         'app_path="c:\cob"
         'app_param="cobol"
         'file_name="hello.cob"  
         stats = Shell("cmd.exe /k " & command & app_param & file_name, vbNormalFocus)

In the Cmd prompt I get:

The Directory name is Invalid.
c:\cob>

But there exists a directory named cob and file named "hello.cob".
Help needed!

Member Avatar for b1izzard

I Got it solved

command = app_param & " " & file_name 'cobol num.cob
         ChDir (app_path) 'compiler path
         stats = Shell("cmd.exe /k " & command, vbNormalFocus)
Member Avatar for b1izzard

I Got it solved

command = app_param & " " & file_name 'cobol num.cob
         ChDir (app_path) 'compiler path
         stats = Shell("cmd.exe /k " & command, vbNormalFocus)
commented: Well done. +4
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.