NOTE: This will probably require changes for non Pelles builds.
Currently, the BC.exe file doesn't include version information via a Manifest, so I worked out a different way to get the current version of the file.
This redirects the output of the 'bc.exe -v' invocation directly to a variable, and then extracts the version number using Posix Regex.
You'll need to point the bcx variable below to where you have BCX installed.
#include <regex.h>
Dim As File commandOutput
Dim As String buffer, version, bcx
Dim As regex_t regex
Dim As regmatch_t pmatch[bcxstrsize]
Dim As Integer ret, length
bcx = "c:\Users\riveraa\Apps\BCX\BC.exe"
commandOutput = popen( bcx & " -v", "r" )
ret = regcomp( ®ex, "([0-9]+\.[0-9]+\.[0-9]+)", REG_ICASE Or REG_EXTENDED )
Get$ commandOutput, buffer, bcxstrsize
ret = regexec( ®ex, buffer, bcxstrsize, pmatch, 0 )
length = ( pmatch[1].rm_eo - pmatch[1].rm_so ) + 1
version = Mid$( buffer, pmatch[1].rm_so, length )
Print crlf$,"Captured Version: ", Trim$( version )
regfree(®ex)
pclose( commandOutput )
Pause