Integration with other IDEs

Got an idea for enhancing PureBasic? New command(s) you'd like to see?
AZJIO
Addict
Addict
Posts: 2143
Joined: Sun May 14, 2017 1:48 am

Integration with other IDEs

Post by AZJIO »

When using in AkelPad, I found myself having to write my own reading settings at the end of the source code in order to add an icon to the application, as well as the name of the file to be created. In this regard, I wanted to ask if there is an intermediate official analyzer of this data in order to form the compiler command line? And if not, then using a third-party IDE is not very convenient.

Here is a JavaScript example to get the filename and icon path, I did it myself. But this is simplistic, I don't know how it will work with paths, and also there is no version number import and stuff.

Code: Select all

function ExeFindSource(pFile, pExt) {
	var pTmp = AkelPad.ReadFile(pFile);
	var Pos1 = pTmp.indexOf('; Executable = ')
	if (Pos1 != -1)
	{
		Pos1 += 15 //  pStart.length
		var Pos2 = pTmp.indexOf('.' + pExt, Pos1)
		if (Pos2 != -1)
		{
			pTmp = pTmp.substring(Pos1, Pos2 + 4)
			pTmp = sFileDir + '\\' + pTmp
			return pTmp
		}
	}
	return sFileWiExt + pExt
}

function IconFindSource(pFile) {
	var pTmp = AkelPad.ReadFile(pFile);
	var Pos1 = pTmp.indexOf('; UseIcon = ')
	if (Pos1 != -1)
	{
		Pos1 += 12 //  pStart.length
		var Pos2 = pTmp.indexOf('.ico', Pos1)
		if (Pos2 != -1)
		{
			pTmp = pTmp.substring(Pos1, Pos2 + 4)
			var fso = new ActiveXObject("Scripting.FileSystemObject");
			pTmp = sFileDir + '\\' + pTmp
			if (fso.FileExists(pTmp))
			{
				pTmp = ' /ICON "' + pTmp + '"'
			} else {
				pTmp = ''
			}
		}
	}
	return pTmp
}
Quin
Addict
Addict
Posts: 1131
Joined: Thu Mar 31, 2022 7:03 pm
Location: Colorado, United States
Contact:

Re: Integration with other IDEs

Post by Quin »

+1
User_Russian
Addict
Addict
Posts: 1520
Joined: Wed Nov 12, 2008 5:01 pm
Location: Russia

Re: Integration with other IDEs

Post by User_Russian »

AZJIO wrote: Sat Jul 15, 2023 2:53 pmIn this regard, I wanted to ask if there is an intermediate official analyzer of this data in order to form the compiler command line?
The analyzer is in an IDE, and the IDE is open source. https://github.com/fantaisie-software/p ... reBasicIDE
Post Reply