Skip to main content
Stack Overflow for Teams is now Stack Internal: See how we’re powering the human intelligence layer of enterprise AI. Read more >
Filter by
Sorted by
Tagged with
0 votes
1 answer
54 views

I disable I/O checking inside a procedure: procedure RewriteText( FileName: string; var TextFile: text; var ErrMsg: string ); begin {$I-} assign(TextFile, FileName); rewrite(...
Bogdan Doroschenko's user avatar
0 votes
1 answer
194 views

I have started using the horse web framework for building an API in Delphi. The VCL sample mentions the following as a comment in the Main.Form.pas file: // Need to set "HORSE_VCL" ...
user31362432's user avatar
3 votes
2 answers
207 views

I’m working with Delphi and placing breakpoints (red circles on the left side of the editor near the line numbers). When I start debugging (e.g., using F4 or Run > Run to Cursor), some of the ...
TomR's user avatar
  • 3,364
3 votes
1 answer
68 views

I want to have a macro defined in a class. I wish to define it first in my main, but use an #ifndef to create it if the user chooses not to. For some reason it would seem like the class is being ...
Kudapucat's user avatar
  • 148
0 votes
0 answers
52 views

For a computation demonstration project in Linux and Python env, I need to call a C multiplication routine "matmult.c" but before I want to perform an important test if I could do another ...
Frederic Peugny's user avatar
1 vote
0 answers
242 views

I want to use iOS 18's #Index in an app that still supports iOS 17. This doesn't work: @Model final class MyModel { if #available(iOS 18, *) { #Index<MyModel>([\.prop1, \.prop2]) ...
fer0n's user avatar
  • 1,303
1 vote
1 answer
308 views

Is there a compiler directive or some kind of directive that I can use to check in the code if Skia is enabled or not for the platform that I am compiling to? I have a form that is used in multiple ...
Martin Kakhuis's user avatar
1 vote
0 answers
122 views

Stupid question. I am writing code in pure assembly for STM32 variants. I want to make two different versions from the same source file by assembling twice with a simple change that is selectable ...
Jeff Casey's user avatar
2 votes
0 answers
93 views

Please tell me the Delphi 11.3 compiler directives for development modes and the application store, if they exist. A switch is needed for different logic. Development is carried out in the FireMonkey ...
Vanar's user avatar
  • 31
0 votes
0 answers
86 views

I'm looking through the WEBLib.StdCtrls source code in TMS Web Core and regularly I see a {$IFNDEF LCLTMSWEB} compiler directive such as here with the TWebLabel component: {$IFNDEF LCLTMSWEB} [...
Shaun Roselt's user avatar
  • 4,361
1 vote
1 answer
153 views

I can use the following compiler directive code to specify Platform specific code: {$IFDEF MSWINDOWS} // This code is for Windows {$ENDIF} {$IFDEF IOS} // This code is for iOS {$ENDIF} {$IFDEF ...
Shaun Roselt's user avatar
  • 4,361
1 vote
2 answers
356 views

For functions, we can use pass by name as below: function void xyz(string x,int y); $display(x,,y); endfunction initial begin xyz(.x("Hi"),.y(2)); end Now, I have a macro ...
Rutuja14's user avatar
0 votes
1 answer
932 views

When a macro is created but no value is assigned, is there a default value? #define MACRO (end of line). Macro definition has the syntax: #define <IDENTIFIER> <value>. Even if we don't ...
Darvid's user avatar
  • 37
1 vote
1 answer
158 views

I have a SwiftUI View for a watchOS / iOS app in which I use the #if os(xxxOS) compiler directive to select between a watchOS specific View or an iOS specific View to provide the content for the the ...
djmlewis's user avatar
  • 353
0 votes
1 answer
154 views

I have Visual Studio C# project template with #if DEBUG #endif directives like this: #if DEBUG ... #endif But when I creating project from this template it doesn't contain this part. Can I somehow ...
Kazbek's user avatar
  • 182
2 votes
1 answer
610 views

Problem I've just caught my self writing dynamic assertion that depends on a constant usize::MAX. I wrote: u128::try_from(letters.len()) .expect("No support for platform with `max pointer ...
Sir 's user avatar
  • 347
0 votes
2 answers
291 views

Question How do I make a compiler directive stay in the DPR file? Description I need to turn off this compiler warning because I don't intend to make my library compatible with C++. If I put the ...
Error - CPU Not Foud's user avatar
1 vote
1 answer
1k views

How does the compiler know which source file is the one I am including? Does it work as long as the name of the header and source file are the same? For example, the header file example.h refers to ...
Captain Toad's user avatar
1 vote
0 answers
51 views

Suppose I have this code (all in the same class): #if CONDITION private static readonly string firstName = "First Name"; #endif string GetName(){ #if CONDITION return ...
Daniel's user avatar
  • 7,800
2 votes
2 answers
747 views

Is it possible to make a compiler directive for the .dfm properties introduced on Delphi 11 like {$IFDEF CompilerVersion > 34.0} PixelsPerInch = 96 {$ENDIF} So other developers that use 10.4....
Mobius one's user avatar
0 votes
0 answers
252 views

until now I have been using DOSBox and TASM to compile, link and run my 8086 code. Whenever I wanted to use local labels I would have just added LABELS @@ at the start of each code file and used @@...
Algo's user avatar
  • 198
0 votes
1 answer
496 views

I have a c# .net core project that is using preprocessor directives ( #if DEBUG) to enable unsafe SSL Connections during debugging. Now when I release-build the whole project and open the generated ...
lb0's user avatar
  • 33
1 vote
2 answers
168 views

I'm trying to identify the reason of a bug that happens on a MUD c code base. Where the use of the #define UMAX(a, b) ((a) > (b) ? (a) : (b)) , is used to return the max of two values. It ...
user15205703's user avatar
-2 votes
1 answer
914 views

Tell me about Free Pascal compiler error 3208 "Illegal assignment to for-loop variable."
Bilbo's user avatar
  • 378
1 vote
0 answers
1k views

NOTE: I think this is quite basic, please point me in the right direction if this is already answered. I did look online but surprisingly unable to find the answer, I could be using wrong words to ...
Aniruddha Gore's user avatar
1 vote
3 answers
137 views

I have this line of code: #define ALPHABET_SIZE 'z' - 'a' + 1 When I hover over ALPHABET_SIZE anywhere in my code it tells me that it expands to 'z' - 'a' + 1. So I wondered if this expression has to ...
Algo's user avatar
  • 198
2 votes
0 answers
166 views

I am working on a refactoring a Python program. I have copied and pasted some messy source files into new Python modules and I'm working through the module top-to-bottom cleaning it up etc. As a ...
ec2011's user avatar
  • 610
1 vote
1 answer
133 views

I would like to configure ctags to recognize compiler directives in a fortran code. More specifically, I would like to match the following vim search result /\v[ \t]*#define[ \t]+([-[:alnum:]*+!_:\/.?]...
Josja's user avatar
  • 141
1 vote
0 answers
308 views

I have a generic function that fetches from DB objects based on a given type and filter: class Employee: Object { @objc dynamic var id: String = UUID().uuidString @objc dynamic ...
Iosif's user avatar
  • 387
1 vote
0 answers
248 views

I am trying to automatically generate the extension of my DLLs to get FileName.$(Platform).DLL. Supposedly I can use {$E ext} to set the extension to FileName.ext, and I want FileName.ext.dll The ...
Nani's user avatar
  • 123
1 vote
0 answers
38 views

I have a class library that targets multiple frameworks. i.e. <TargetFrameworks>netstandard2.0;netstandard2.1</TargetFrameworks> When msbuild builds my application it correctly spits out ...
Matt Ruwe's user avatar
  • 3,426
2 votes
1 answer
122 views

Weird one maybe. Is there anyway to detect a hotkey combo at run-time after firing up the project in VS. E.g. If I hold shift and press f5 or run in VS then i want to fire a special line of code. ...
Matt's user avatar
  • 2,903
2 votes
1 answer
384 views

I've read Microsoft's article about how to detect target framework, for example : netcoreapp2.2 net47 net58 But there are situations where I don't care about the exact version, but the general ...
Royi Namir's user avatar
  • 149k
3 votes
3 answers
1k views

I'm using Visual Studio 2019 with SDK based project, with multiple targets: <TargetFrameworks>netstandard2.0;net45;net46</TargetFrameworks> But when I write conditional code, I see (...
Royi Namir's user avatar
  • 149k
3 votes
3 answers
4k views

Using #if, #endif in Swift (using Xcode) produces errors if it cuts into the flow of an operation. This screenshot says it all: Does anyone know a solution to make this example work, without repeating ...
msedore's user avatar
  • 91
8 votes
1 answer
2k views

What does the phrase {$R *.dfm} mean in the code editor? I have tried this: //{$R *.dfm}
Djemoui's user avatar
  • 87
-1 votes
1 answer
133 views

Compiler is a combination of many programs. So which program takes care of which part during compilation? I read somewhere that the preprocessor program takes care of the C preprocessor directives(...
Pratik P's user avatar
7 votes
1 answer
7k views

I am working with compiler directives for Cython (http://docs.cython.org/en/latest/src/reference/compilation.html#globally). $ cat temp.pyx # cython: language_level=3 print("abc", "def", sep=" ,") # ...
Saim Raza's user avatar
  • 1,480
4 votes
1 answer
123 views

using compiler directives like #if A some instructions #elseif B some instructions #end In C\C++ language, one can tell the compiler to ignore some parts of code under some conditions. I`m curious ...
AlirezaGH's user avatar
  • 399
4 votes
1 answer
1k views

I've been fascinated by the __future__ module - in particular, its ability to change the way statements are parsed in python. What's most interesting is how doing something like from __future__ ...
cs95's user avatar
  • 406k
0 votes
0 answers
363 views

I'm working in an environment in which all projects are placed into a Global Solution irrelevant of the specific business areas of the projects. So the solution is a monstrosity. I'm accustomed to a ...
Mark's user avatar
  • 1,707
3 votes
2 answers
155 views

Is it possible to create a conditional define like so: {$if typeof(TNode) = record} type PNode = ^TNode; {$else} type PNode = TNode; {$end} Why do I want this? I'm alternating between using class and ...
Johan's user avatar
  • 77.4k
3 votes
2 answers
3k views

In the spirit of What are the consequences of ignoring: warning: unused parameter, but I have static functions that are unused, #include <stdlib.h> /* EXIT_SUCCESS */ #include <stdio.h> /...
Neil's user avatar
  • 1,922
2 votes
1 answer
145 views

I'm working with a program, full of compiler directives, programmed in Visual Studio. I've made some changes and now I'm stuck with an unresolved external compiler/linker error. I believe this is ...
Dominique's user avatar
  • 17.6k
0 votes
1 answer
2k views

I want to use the `include directive to call upon a non-specific file name. For example, there is this file name "name_defines.svh" in some other directory. Since the "name" of "name_defines.svh" ...
TheSprintingEngineer's user avatar
1 vote
0 answers
376 views

I would like to temporarily disable a gfortran compiler option for a piece of Fortran code. I am looking for something like: !GFORTRAN$ PUSH_OPTION(-fcheck=bounds) SUBROUTINE FOO(BAR) INTEGER BAR(...
Alexander Pozdneev's user avatar
0 votes
1 answer
89 views

I have a file that is included on the bundle that has the following name: databaseX.sqlite where X is the app's version. If the version is 2.8, the file should be named database2.8.sqlite. I have to ...
Duck's user avatar
  • 36.2k
1 vote
2 answers
234 views

What is the conditional compiler directive binded to Delphi XE4 compiler? I though something like this: {$ifdef VerDXE4} code segment compiled only by the Delphi XE4 compiler {$endif}
The Bitman's user avatar
  • 1,339
1 vote
1 answer
2k views

In my C++ .h file: class foo { #define useThis true ... } In my .cpp file: #if useThis ... generate A code #else ... generate B code #endif The problem is that the #define values are not being read ...
Bob Jones's user avatar
  • 2,048
0 votes
2 answers
2k views

In systemverilog there is no `if compiler directive. So the following lines are incorrect: `define BITS 16 reg[`BITS-1:0] my_reg; ... `if `BITS > 10 my_reg[31] = 1'b0; endif ... Without `if ...
betontalpfa's user avatar
  • 3,846