Questions tagged [inout]
90 questions
0
votes
1 answer
How to handle bidirectional pin (inout) in a verilog task
I want to use a bidirectional data bus in my controller.Here's the code
module controller ( clk, data_out);
// Port Declaration
input clk;
inout [7:0] data_out;
reg [7:0] a;
reg [7:0] b;
wire [7:0] c;
// data should write to…
![](../../users/profiles/4569179.webp)
Dumidu nadeera
- 13
- 4
0
votes
2 answers
Cannot pass immutable value of type 'NSObject' as inout argument
This should work, but I've got no clue why it doesn't. The code is self-explanatory.
class Themer {
class func applyTheme(_ object: inout NSObject) {
//do theming
}
}
And I apply theme to the button like so:
class ViewController:…
![](../../users/profiles/3970488.webp)
Aswath
- 480
- 3
- 14
0
votes
1 answer
swift 3 update syntax from swift 2
in swift 2.2 its work:
var messages = [JSQMessage]()
//...
for i in 1...10 {
let sender = (i%2 == 0) ? "Server" : self.senderId
let messageContent = "Message nr. \(i)"
var message = JSQMessage(senderId: sender, displayName: sender, text:…
![](../../users/profiles/6394379.webp)
Denis Windover
- 324
- 5
- 18
0
votes
0 answers
Updating an inout param async does not update reference
Using the below playground, when I print in the async I would assume the counts should be the same, but they are not. It seems that swift does not properly use inout asynchronously, but I need to be able to update an inout reference in an…
![](../../users/profiles/1223595.webp)
steventnorris
- 5,056
- 20
- 82
- 156
0
votes
1 answer
Verilog "In, out, or inout does not appear in port list"
I can't understand what this error means.
I want to make a simple calculator with memory, however this error jumped out and I cant get what the
** Error: C:\Users\Kainy\Desktop\LOGIC\calculator\cal.v(14): In, out, or inout does not appear in port…
![](../../users/profiles/6529491.webp)
Kainy Yang
- 25
- 1
- 7
0
votes
1 answer
Swift inout parameter for const properties
Is it possible to use a let property with a similar function parameter to inout when I do't want to change the property itself but that property's properties?
e.g.
let someLine = CAShapeLayer()
func setupLine(inout line:CAShapeLayer, startingPath:…
![](../../users/profiles/667834.webp)
richy
- 2,596
- 1
- 29
- 40
0
votes
1 answer
How do you pass a chunk of an array to an inout function? Type-erasure?
I have a function
func doThing(inout array: [Int]) { //thing }
I have the array
var stuff = [0,1,2,3,4,5,6]
I want doThing to operate on just the first three elements.
doThing(&stuff[0..<3])
doesn't work since
var partOfStuff: ArraySlice =…
![](../../users/profiles/4678091.webp)
lanza
- 1,062
- 1
- 7
- 24
0
votes
1 answer
Use the inout keyword when passing an NSManagedObjectContext into a function?
I'm working on my first real Core Data application and have been able to successfully pass the pointer to my managedObjectContext instance throughout my application using segues. I've run into a question however as I am at a crossroad where I need…
![](../../users/profiles/1664443.webp)
Dan Beaulieu
- 17,926
- 15
- 92
- 126
0
votes
1 answer
How to set a Inout parameter inside a closure
So my question is this:
I'm trying to implement a extension to CLGeoCoder to be able to get a city name from a CLLocation but I'm facing a problem when I try to set the inout city name string inside the completionhandler of the…
![](../../users/profiles/2826880.webp)
Martin
- 591
- 4
- 15
0
votes
2 answers
How to modify a two dimensional array passed to a function?
My function is as following
func helper(root: TreeNode?, _ result: [[Int]], _ list: [Int], _ sum: Int, _ total: Int) {
list.append(root!.val)
if(total + root!.val == sum && root?.left == nil && root?.right == nil) {
…
![](../../users/profiles/5146239.webp)
Xuting
- 1
- 1
-1
votes
2 answers
Inout vs pass by reference swift optimization
I have a very large list of numbers and I would like to pass it to a function to do some manipulations to it. Originally, I created a function with an inout property. As many know, inout in swift does NOT pass by reference, rather it makes an…
![](../../users/profiles/1320720.webp)
EK_AllDay
- 1,033
- 1
- 14
- 33
-1
votes
2 answers
inout with reg type in verilog
I have used inout with c but for c to be on the LHS of procedural assignment, it needs to be a reg type variable. Can anyone help me out with this code?
module multiedgeclk(input clk ,[7:0] a,b,d, inout [7:0] c, output reg [7:0]f);
always @(posedge…
![](../../users/profiles/8357487.webp)
Priya Mittal
- 11
- 1
- 3
-1
votes
1 answer
VHDL: assigning to inout port from testbanch
I have VHDL module with bidirectional port which nested in Top module. In testbanch I try to assign data to signal which connected to bidirectional port of Top. But assigned data don't propogate to nested module bidirectional port, I see assigned…
![](../../users/profiles/6092298.webp)
Alex
- 41
- 4
-2
votes
1 answer
How to write columnwise in FORMAT in FORTRAN 77
I am using FORTRAN77 as a third party language on ANSYS computation software. Here we can write the entire row and columns to files during I/O operations. I am not able to however move the cursor to the first row and write column wise thereafter-…
![](../../users/profiles/12326351.webp)
Vikram
- 1
- 1
-4
votes
1 answer
"&" in "swap(&someInt, &anotherInt)". What does it represent? What is its function?
I'm new to Swift and I'm trying to learn the concept of 'inout' keyword. I saw this code in "the swift programming language 2.1". My question is, why is there a "&" in "swap(&someInt, &anotherInt)". What does it represent? What is its function?
func…
![](../../users/profiles/5581182.webp)
Thor
- 8,608
- 10
- 43
- 113