Questions tagged [field]

In computer science a field is a smaller piece of data from a larger collection.

In computer science, data that has several parts can be divided into fields. Relational databases arrange data as sets of database records, also called rows or tuples. Each record consists of several fields, also called attributes; the fields of all records form the columns.

In object-oriented programming, field (also called data member or member variable) is the data encapsulated within a class or object. In the case of a regular field (also called instance variable), for each instance of the object there is an instance variable: for example, an Employee class has a Name field and there is one distinct name per employee. A static field (also called class variable) is one variable, which is shared by all instances.

Source: Field (Computer Science) - Wikipedia article

Related tags:

5904 questions
30
votes
4 answers

Inconsistent accessibility: field type 'world' is less accessible than field 'frmSplashScreen

I have this error called Inconsistent accessibility: field type 'world' is less accessible than field 'frmSplashScreen' In my code there is a public partial class called frmSplashScreen There is also a public class called world The line that…
user1761786
  • 321
  • 1
  • 3
  • 6
29
votes
2 answers

Why does WPF support binding to properties of an object, but not fields?

I've got a WCF service that passes around status updates via a struct like so: [DataContract] public struct StatusInfo { [DataMember] public int Total; [DataMember] public string Authority; } ... public StatusInfo GetStatus() { ... } I…
Paul Alexander
  • 31,970
  • 14
  • 96
  • 151
29
votes
4 answers

Convert static variables from Java to Kotlin

I'm trying to convert the following code to Kotlin AND still have one of the classes (Foo) used by Java. What is the proper way of making this conversion? Original Java: public class Foo { public static final String C_ID = "ID"; public static…
Jeff Campbell
  • 1,565
  • 2
  • 15
  • 18
28
votes
8 answers

Basic Hidden field in yii

I'm trying to place data in hidden text in yii, but I don't know how. I need a similar code to a regular php syntax: It's supposed to be a field with static value of a. I just need it to go with…
marchemike
  • 3,179
  • 13
  • 53
  • 96
28
votes
1 answer

Why do I have to do ldarg.0 before calling a field in MSIL?

I want to call a function, with as parameters a string and an Int32. The string is just a literal, the Int32 should be a field. So I thought it should be something like: .method public hidebysig instance string TestVoid() cil managed { .maxstack…
Jan Jongboom
  • 26,598
  • 9
  • 83
  • 120
28
votes
5 answers

How to render form field with information that it is required

Is there any clever way to make django forms render field with asterisks after fields that are required? Or to provide some other clever for to mark required fields? I wouldn't like to have to do it again in a template if I already set a field as…
gruszczy
  • 40,948
  • 31
  • 128
  • 181
27
votes
2 answers

SQLAlchemy: How to order query results (order_by) on a relationship's field?

Models from sqlalchemy.ext.declarative import declarative_base from sqlalchemy import Column, ForeignKey from sqlalchemy import Integer from sqlalchemy import Unicode from sqlalchemy import TIMESTAMP from sqlalchemy.orm import…
The Pjot
  • 1,801
  • 1
  • 12
  • 20
27
votes
6 answers

SSRS Field Expression to change the background color of the Cell

I'm trying to write a field expression for a Cell in my report where I have to change the background color of the cell depending on the string value in the cell. Ex: if the column has a value 'Approved' in it, the cell should show a green background…
Avinash
  • 1,273
  • 4
  • 16
  • 23
27
votes
3 answers

Check field length using awk

I have a file of 3 fields: 123710337783,351898014413150,123028040249634 123710337785,352934028758390,123028040109275 I need to check that the fields meet the following lengths: Field 1 = 12 Field 2 = 15 or 16 Field 3 = 15 I get an error when…
bernie
  • 803
  • 4
  • 12
  • 18
27
votes
9 answers

Is it ever justified to have an object which has itself as a field?

Is it ever justified to have an object which has itself as a field like this : class Thing { Thing field; public Thing() { this.field = this; } } I'm not talking about a class with a field of the same type but a class made so…
Autar
  • 1,589
  • 2
  • 25
  • 36
27
votes
2 answers

Hidden field in rails form

I have this form in a view in my project. I need to pass the task_id to a certain controller, but the log does not seem to be receiving the parameters. I don't know what the problem is. <%= form_for :taskid, :url => {:action=>"index",…
HeshamW
  • 347
  • 1
  • 4
  • 6
27
votes
12 answers

Is there a name for "this" in Java?

Eclipse will give an error, "The left-hand side of an assignment must be a variable", when I try something like: public class Thing{ String a1; int a2; public void meth(){ Thing A = new Thing(); this = A; } } I had to assign each…
Jay
  • 396
  • 3
  • 6
27
votes
20 answers

More private than private? (C#)

Sometimes you have a private field that backs a property, you only ever want to set the field via the property setter so that additional processing can be done whenever the field changes. The problem is that it's still easy to accidentally bypass…
Fxper
  • 271
  • 2
  • 3
27
votes
2 answers

No more _source if script_fields is used in elasticsearch query

I am running a simple query like so: { "query": { "term": { "statuses": "active" } }, "script_fields": { "test": { "script": "_source.name" } } } The problem is that once I introduce the script_fields, I no…
F21
  • 32,163
  • 26
  • 99
  • 170
26
votes
2 answers

HTML text field over canvas element

I have been playing around with text in the canvas, and although it is easy to draw, it is not easy to interact with. I began implementing keyboard press functionality to update text on the canvas, but then gave up when I realized I would have to…
puk
  • 16,318
  • 29
  • 119
  • 199