Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 7 years ago.
Improve this question
[ERROR] Lua is unable to understand file "darkrp_customthings/jobs.lua" because its author made a mistake around line number 21.
The best help I can give you is this:
There is an opening '(' bracket at line 20, but this bracket is never closed or not closed in time. It was expected to be closed before the '=' at line 21.
Can someone help correct the errors in my code?
The code:
https://www.dropbox.com/s/o2w9jx2kqefu2n0/job%20.txt?dl=0
You wrote something like this (simplified):
TEAM_TERRORIST = AddExtraTeam(
"Terrorist",
customCheck = function(ply) end
)
This is not valid syntax in Lua, where there are no named parameters.
Maybe the AddExtraTeam function expects a table instead? E.g. this is valid syntax:
TEAM_TERRORIST = AddExtraTeam{
"Terrorist",
customCheck = function(ply) end
}
Not sure this is the right solution though, I don't know DarkRP.
Related
Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 3 years ago.
Improve this question
So im really new to this, and I dont know why it isnt working
Ive googled all around the place, all I can find is that you should put an end somewhere but I dont know where.
Power = peripheral.wrap("ic2:oldmfsu")
mon = peripheral.wrap("monitor_0")
local maxPower = 0
local curPower = 0
local perPower = 0
monX.monY = mon.getsize()
function checkpower()
etc
I expect it to count the number of energy that is stored.
The error message tells you that mon is nil. That means that peripheral.wrap("monitor_0") returned nil instead of the expected table.
Indexing a nil value is not allowed because it doesn't make sense. Hence Lua complains about your attempt.
https://www.computercraft.info/wiki/Peripheral.wrap
Function peripheral.wrap
Returns a table containing functions pointing to the peripheral's
methods, which can then be called as if using peripheral.call(side,
method). If no peripheral is found at the specified side, returns
nil instead.
So check wether mon is nil befor you index it and maybe print an error message else.
Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 4 years ago.
Improve this question
I looked all the similar questions on the web but nothing turned useful to me. I have a string which I receive from server i.e.
'Justin Timberlake - Can't Stop the Feeling'
It has single quotes in it. Before passing it to NSPredicates, it gets changed to
"text = \'\'Justin Timberlake - Can\'t Stop the Feeling\'\'"
I tried everything, i.e. replacing single quote with \' etc. But nothing helped. What else should I do.
The problem is that the string you get from the server has a single quote already in it ("Can't"). To make it work in a predicate you need to use substitution:
let predicate = NSPredicate(format: "text = %#", "Justin Timberlake - Can't Stop the Feeling")
Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 6 years ago.
Improve this question
My cxBarEditItem1 has properties : combobox.
However when I begin to write :
cxBarEditItem1.Properties.Items.Add ...
Delphi shows me it's an error. It seems 'items' do not exist.
What am I doing wrong ? How can I fill it ?
The compiler doesn't know that cxBarEditItem1.Properties refers to a ComboBox at runtime. You have to cast to tell it:
Assert(cxBarEditItem1.Properties is TcxComboBoxProperties);
TcxComboBoxProperties(cxBarEditItem1.Properties).Items.Add('Hello');
I don't have the DevExpress Expressbar controls... But I have downloaded the help file for the components. I can recommend the help, it's very useful.
From what I can see, you really want to put a TcxBarCombo on your bar, which does have an items property.
I think you have dropped a non-ribbon style Combo on to your ribbon, which may be a separate component on your form... Maybe try clicking on the combo and seeing what the component name is in the object inspector, then use that name to add items to the control.
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions concerning problems with code you've written must describe the specific problem — and include valid code to reproduce it — in the question itself. See SSCCE.org for guidance.
Closed 9 years ago.
Improve this question
I'm new in delphi and i thought it might be safer to swap object names in loop instead of copying whole block for each object. So I need to use variable name as some objects name.
Here is an example of what i tried and what i am trying to do.
Var
YazGrid: TStringGrid;
I defined a variable for grid name as above and i am trying to use like this:
Some Loop
begin
if a_variable>=10 then
YazGrid:=form1.StringGrid1
else
YazGrid:=form1.StringGrid2;
YazGrid.Cells[1,i] := 'SomeText';
End;
As the result- it comes out with the "Access Violation" error. How should i do this?
Thanks in advance.
Everything looks right in your code.
Make sure that variable "i" in bound. Anyway, even if "i" out-of-bound, this shound't raise Access Violation.
Tested with Delphi XE2 and XE4.
I suppose that error occure in code that not showed in your sample.
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions concerning problems with code you've written must describe the specific problem — and include valid code to reproduce it — in the question itself. See SSCCE.org for guidance.
Closed 9 years ago.
Improve this question
x = {"utf8"=>"✓",
"authenticity_token"=>"xxxxxxxxxxxxx=",
"file"=>#>,
"unit_id"=>"00001"}
I have ruby data structure like this and um trying to get the value of #original_filename field
I tried something like this
x["#original_filename"]
and
x[:original_filename]
But both has thrown me an error . How to access that specified element value?
looks like you're trying to upload a file; from your tiny screenshot maybe you're referring to params[:file].original_filename?
The parameter ["file"] is a ActionDispatch::Http::UploadedFile, which has the original_filename member variable, as you can see in the params displayed in your image or here:
http://api.rubyonrails.org/classes/ActionDispatch/Http/UploadedFile.html
So, the way to get this value would be x["file"].original_filename