To LUGNET HomepageTo LUGNET News HomepageTo LUGNET Guide Homepage
 Help on Searching
 
Post new message to lugnet.robotics.rcx.nqcOpen lugnet.robotics.rcx.nqc in your NNTP NewsreaderTo LUGNET News Traffic PageSign In (Members)
 Robotics / RCX / NQC / 1630
1629  |  1631
Subject: 
RE: Ideas for NQC
Newsgroups: 
lugnet.robotics.rcx.nqc
Date: 
Tue, 9 Mar 2004 11:10:50 GMT
Reply-To: 
<Marco.Correia@soporcel.%antispam%pt>
Viewed: 
7668 times
  
For NQC, something that you can add is optional use of
semi-colon. It's a pain when I do a program as simple as this:

task main()
{
    On(OUT_A)
}

and the compiler says:
line 4: Error: parse error.
Semi-colon is not necessary if commands are in different
lines, they are only
necessary between commands in the same line.  I think this is
not part of the API, it is part of the programming language.

...a bit like NQP (Not Quite Pascal) :D ?

For BricxCC, I suggest adding automatic correction of command
case. For example, if you write
playtone(523,10), instead of showing "undefined function
'playtone' in line xx", try to make BricxCC change it into PlayTone.

That would have to be called NQB (Not Quite BASIC) ;)

Ok, now, seriously, this could be usefull for lazzy typists like me, but
remember that C is case sensitive, so, how could BricxCC decide between
PlayTone and a PLAYTONE constant and a playtone variable, not to mention,
some task named Playtone ?
(I know you shouldn't abuse these confusing identifiers, but... heck, blame
it on C authors)
(BTW, I hate C syntax... hmmm... ...and BASIC syntax ...and MFC's)

I don't know if something with C in the name should start breaking C rules.
Why C then ? ...why not NQBasic then ? ...why not using LEGO own
"basic-like" language then ?

I think there's still room for improvment on NQC before converting it to
NQSomething-else.

Speaking of NQSomething-else, I personally, would like to see a RCX language
that would run on a PC (so it could use all PC resources like tcp/ip, Vision
Command and any other peripherals connected to the PC) and it's syntax would
include all RCX downloadable / immediate commands, so I could do something
like:

---8<----Program Running on a PC-----8<-----

set Drone on USB type RCX2 //pBrick
set Rover on COM2 type CyberMaster //pBrick
set Target on COM1 type Spybotics //pBrick
set Vision on USB type VisionCommand //local PC "sensor"

module Foo1
  ...
  a pBrick module
  that does
  something usefull
  a bit like
  your average NCQ
  program, with task declarations
  and a main
  ...
end module

module Foo2 for RCX2
  ...
  another pBrick module
  that also does
  something usefull
  but can use extra RCX2
  specific commands
  ...
end module

task ListenDrone
  ...
  this could act as a task
  running on local pc,
  much like a pBrick task
  ...
end task

...

main
  download Foo1 to Drone
  download Foo2 to Drone as program 2
  download Foo1 to Rover
  download Foo1 to Target

  while zone(Vision,1)=BRIGHT

    case zone(Vision,5)
GREEN:
        MessageBox("GO!!!!")
        start program 2 on Drone
        start Rover
        start Target
        MessageBox("...gone")

    BLUE:
  if Ask("Should Rover do Foo3 now ?") then
          download Foo3 to Rover
          start program 1 on Rover // start remote program
    start task ListenDrone // start local task
  end if

      RED:
        stop Rover
        stop Target
  start program 1 on Drone
        MessageBox("Stop some...")
    end case

  end while

  stop all on all
end program


...something like this, with tighter and better syntax...

maybe use this syntax instead:
if download(Foo2,Rover,1) then
  start(Rover,1)
else
  message("Can't download Foo2 to Rover !!!")
end if

In the end, we could do PC-side programs very pBrick aware, interacting with
both, the PC resources (local peripherals, like Vision Command) and various
pBricks, sending commands, downloading programs, starting/stoping remote
tasks/programs, requesting variable/sensor values and datalog.

Yes, I know this could be done with any modern language, but, there's no
standard way to do it. I think we need a PC-side "NQC" version.

LEGO *should* have done this with RIS 2.0.
After making Vision Command available, LEGO should take the oportunity to
make such an integrate  system, IMHO.

mc.



Message is in Reply To:
  Ideas for NQC
 
Hi John, Now that Dave Baum has given you the control under NQC, how will you manage to work both on NQC and on BricxCC??? I recomend the following changes: For NQC, something that you can add is optional use of semi-colon. It's a pain when I do a (...) (20 years ago, 8-Mar-04, to lugnet.robotics.rcx.nqc)

29 Messages in This Thread:











Entire Thread on One Page:
Nested:  All | Brief | Compact | Dots
Linear:  All | Brief | Compact
    

Custom Search

©2005 LUGNET. All rights reserved. - hosted by steinbruch.info GbR