Search found 19 matches
- 21 Dec 2011, 18:43
- Forum: Mindstorms Software
- Topic: [NXC] How to keep a variable "alive" in a subroutine
- Replies: 6
- Views: 8995
Re: [NXC] How to keep a variable "alive" in a subroutine
Thanks for the comprehensive reply. I understand now. Now time for major debugging (the price I am paying for using someone else's code that I'm modifying) When I change sub ReceiveSolution() to sub ReceiveSolution(string token) it accepts is, but then takes me to a "break;" at the very bo...
- 21 Dec 2011, 15:18
- Forum: Mindstorms Software
- Topic: [NXC] How to keep a variable "alive" in a subroutine
- Replies: 6
- Views: 8995
Re: [NXC] How to keep a variable "alive" in a subroutine
By the way, I looked at a lot of the Google results and they are 99% referring to integers. I looked into passing strings and I'm still a littel confused - it seems you have to convert to char and call the location of the char . I tried a few examples I saw and still get missing parameters or too ma...
- 21 Dec 2011, 10:15
- Forum: Mindstorms Software
- Topic: [NXC] How to keep a variable "alive" in a subroutine
- Replies: 6
- Views: 8995
Re: [NXC] How to keep a variable "alive" in a subroutine
Indeed - though I want to pass on a variable from within the main routine rather than a fixed string value... I've put "///FORUM COMMENT" by the important bit - I want to use the value of the string "token" in the second subroutine (threre is also a fair bit of textout debugging ...
- 20 Dec 2011, 20:20
- Forum: Mindstorms Software
- Topic: [NXC] How to keep a variable "alive" in a subroutine
- Replies: 6
- Views: 8995
[NXC] How to keep a variable "alive" in a subroutine
Hi - I'm revisiting an old project and I'm still stumped on the same problem.... I have a string variable in a subroutine. Lets call it "x". This subroutine calls another subroutine , on occasions, and that "called" subroutine needs to use the string "x" value from it's...
- 30 Sep 2011, 16:38
- Forum: Mindstorms Projects
- Topic: Connect 4 and Image Processing
- Replies: 9
- Views: 21161
Re: Connect 4 and Image Processing
Very clever design using the cam. It's also interesting how Robin has a different perspective on the 4RowBot. I built the 4RowBot (took me a week to learn how to compile Lejos Java apps , in particular, packages - it's all about the paths!, I digress). I agree you have to make sure the board is alig...
- 30 Sep 2011, 16:11
- Forum: Mindstorms Software
- Topic: [NXC] How important is the order of Voids?
- Replies: 10
- Views: 15005
Re: [NXC] How important is the order of Voids?
haha :-) I'm actually pretty methodic (I used to program a lot when I was younger) - testing each new chunk of code until I'm totally happy, with lots of pauses and visual checking chucked in - not forgetting testing each idea for new code within a section I already know works and monitoring the out...
- 27 Sep 2011, 08:37
- Forum: Mindstorms Software
- Topic: [NXC] How important is the order of Voids?
- Replies: 10
- Views: 15005
Re: [NXC] How important is the order of Voids?
Wondeful! Thanks guys.
And yes, subroutines and functions they are from now on. (I learn OS's from tinkering and it's only now that I'm really getting stuck into the NXC guide)
Robot is working well and just needs a little more debugging
And yes, subroutines and functions they are from now on. (I learn OS's from tinkering and it's only now that I'm really getting stuck into the NXC guide)
Robot is working well and just needs a little more debugging

- 26 Sep 2011, 08:24
- Forum: Mindstorms Software
- Topic: [NXC] How important is the order of Voids?
- Replies: 10
- Views: 15005
Re: [NXC] How important is the order of Voids?
Well, it helps to talk to yourself sometimes 

- 25 Sep 2011, 18:47
- Forum: Mindstorms Software
- Topic: [NXC] How important is the order of Voids?
- Replies: 10
- Views: 15005
Re: [NXC] How important is the order of Voids?
SOLVED: syntax syntaxt! Well I've learnt about NXC ordering of code, and I've learnt about global variables. I thought that making a variable global would be as simple as defining it at the top of my program, but it seems you need to make a copy as such, and use that global variable. So now I have t...
- 25 Sep 2011, 18:13
- Forum: Mindstorms Software
- Topic: [NXC] How important is the order of Voids?
- Replies: 10
- Views: 15005
Re: [NXC] How important is the order of Voids?
Small update, I've learnt a bit about global variables but am still getting nowhere. Now I'm reading that you can attach variables to calls to subroutines and then the subroutine can read that variable. I'm failing on the syntax tho. As far as I understand you can have things like void main (); { te...