rootuid wrote: Tue Jul 29, 2025 11:05 pm
How do I compile and debug from VsCode?
I think many beginners try to start writing code in their usual editor and try to build a connection with the compiler. But after a while, you'll realize that it's better to write in a standard IDE.
1. The IDE understands the compiler directives that are located at the end of the file. You'll need to
write an analyzer for these data to link the compiler to a different editor.
2. You'll need to create a list for
auto-completing functions and keywords when typing.
3. The debugger interacts with the IDE, showing the values of variables during debugging and highlighting lines with errors.
4. There are
many tools written for the IDE, but they may not be compatible with your editor because they use Scintilla.
A javascript example for searching for an icon and the name of an exe file
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
}