Questions tagged [braces]

The symbols "{" and "}", commonly used in programming languages. Please use this tag only if the specific usage of these symbols is a relevant part of the question.

The curly brackets (or braces) "{" and "}" are special cases of brackets, along with parentheses and square brackets ("[" and "]").

Curly brackets have many uses in most programming languages, such as:

  • identify code blocks;
  • create lists and arrays;
  • pass arguments to commands in TeX.
195 questions
0
votes
1 answer

i want my function braces autocomplete in c sharp using visual studio

I want my function parentheses auto complete in c# using visual studio. I have tried brace completer extension for visual studio but it only complete the curly braces. And also tried productivity power tool , but was not able to find this…
0
votes
1 answer

dialog box with error message while working with swing in java

i'm not a good programmer in java. While I work with this coding I was stuck with some errors. Could anyone pls help me? import java.awt.*; import java.awt.event.*; import javax.swing.*; import javax.swing.JOptionPane; public class test4…
0
votes
1 answer

Perl Regex match balanced parentheses

Following strings - match: "MNO(A=(B=C) D=(E=F)) PQR(X=(G=H) I=(J=(K=L)))" - "MNO" "MNO(A=(B=C) D=(E=F))" - "MNO" "MNO" - "MNO" "RAX.MNO(A=(B=C) D=(E=F)) PQR(X=(G=H) I=(J=(K=L)))" - "RAX.MNO" "RAX.MNO(A=(B=C) D=(E=F))" - "RAX.MNO" "RAX.MNO" -…
RaphaelH
  • 2,144
  • 2
  • 30
  • 43
0
votes
5 answers

RegEx for String.Format

Hiho everyone! :) I have an application, in which the user can insert a string into a textbox, which will be used for a String.Format output later. So the user's input must have a certain format: I would like to replace exactly one placeholder, so…
Nikki
  • 1
0
votes
1 answer

Visual C++ Express Brace-Completion

I really like the Visual C++ Express Version for efficient C++-Coding. I'm just missing the feature of auto brace-completion, for example when I type { and press enter ist should automatically add }. I googled a Lot but just found Addons for the…
0
votes
1 answer

Regex match token with argument

A token can be like this {num} or {num:2} (2 being an arg) I would like to achieve matching like this: // no args [0] = num // args (anything after the colon and before the closing brace as one match is fine) [0] = num [1] = 2 I managed to match…
Dominic
  • 62,658
  • 20
  • 139
  • 163
0
votes
3 answers

include/import separate AS3 file

I am trying to just include a .as file in my flash application. I'm sure it's not that difficult and I'm just getting something slightly wrong, but at the top of my code I always put: include {"Le Bot src/Skill.as";} OR import {"Le Bot…
0
votes
3 answers

If Statements And Braces.. Different Result With/Without

Alright, so I'm in the process of learning C++, and I've hit a strange effect while working with one of the tutorials, and I don't quite get while it's happening.. For the tutorial (copied from the example offered), I have written a function within…
kovibear
  • 15
  • 5
0
votes
3 answers

AutoHotKey: "{Enter" Hotstring

As I've started using AutoHotKey daily, I thought it'd be a good idea to implement it in my coding. I'd like it to create a structure like this: { (Tab) } when { followed by an Enter are entered.   So far, I've got: :*{Enter:: SendInput,…
mythofechelon
  • 3,692
  • 11
  • 37
  • 48
0
votes
6 answers

Javascript count keys in braces of function

I call a function like so: update_insert('information',{ element_id: 1, type: 'menu', info: 'Hi how are ya?', new_window: '' }); The function is: function update_insert(table,data){ alert(data.length); } I am trying to get the…
Ilya Karnaukhov
  • 3,838
  • 7
  • 31
  • 53
-1
votes
3 answers

Writing in Ruby, testing for matching parentheses, brackets and curly braces

The question says to write a function that takes a string of braces, and determines if the order of the braces is valid. It should return true if the string is valid, and false if it's invalid. All input strings will be nonempty, and will only…
R4V3N
  • 11
  • 1
  • 5
-1
votes
1 answer

short MPI program (C Code), declaring variable in root doesn't work

So I have a question regarding my little MPI program. (I am new to programming so its probably just some beginners mistake) I made a program which calculates pi by using the formula: (1/n) * the sum of 4/(1+(i/n)^2); Only problem is, I have to…
IDS
  • 1
  • 1
-1
votes
2 answers

How to get rid of extra curly braces in JSON?

I'm basically creating a contact book, and I want to do it storing data on JSON to practice it. I have sort a code that allows it from a dictionary, but the problem is that when I rerun the script, another dictionary is appended into the existing…
-1
votes
1 answer

Why should I omit braces in the following example?

Why does the emission of braces in the following infamous example produce the desired greeting output? However, when adding braces on row 37 & 40 under the else, for the two statements, an infinite loop is produced? The first code example produces…
Gerard R
  • 1
  • 1
-1
votes
1 answer

Xcode 11.3.1 braces in new line?

I'm using the auto creation of Xcode and would like to have the function-braces in a new line. I know this question was asked years before, but there is no working solution for me. I already set an option in the preferences, but I think this doesn't…
Lukas
  • 11
  • 1
1 2 3
12
13