OCCRA
Go to Post When you start new threads, keep in mind that ChiefDelphi has about 14.6 million subforums about nearly everything you can imagine in the world of FIRST. You have to be in the forum you'd like for your thread to appear in when you choose to start a new topic. - Madison [more]
Home
Go Back   Chief Delphi > Old Forum Archives > 2001
CD-Events   CD-Media   CD-Spy   FRC-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
 
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 06-23-2002, 09:57 PM
archiver archiver is offline
Forum Archival System
#0047 (ChiefDelphi)
 
Join Date: May 2001
Location: Pontiac, MI
Posts: 21,214
archiver has a reputation beyond reputearchiver has a reputation beyond reputearchiver has a reputation beyond reputearchiver has a reputation beyond reputearchiver has a reputation beyond reputearchiver has a reputation beyond reputearchiver has a reputation beyond reputearchiver has a reputation beyond reputearchiver has a reputation beyond reputearchiver has a reputation beyond reputearchiver has a reputation beyond repute
Programming question

Posted by Nick at 1/14/2001 10:52 PM EST


Student on team #240, Mach V, from Jefferson Monroe High School and Visteon.



Here's a thought. Say I were to input a standard 1 byte analog device (y). But instead of setting the variable (x) as a byte I change it to, let's say a nib (4 bits). I am curious to the value x. Would the program give a simple error? Or would x be assigned a value? If y = 255 then x = 15? If y = 0 then x = 0? Here's the real challenge if y = 240 (binary 11110000) does x = 15 or x = 0? If anyone has the slightest clue please let me know.
__________________
This message was archived from an earlier forum system. Some information may have been left out. Start new discussion in the current forums, and refer back to these threads when necessary.
  #2   Spotlight this post!  
Unread 06-23-2002, 09:57 PM
archiver archiver is offline
Forum Archival System
#0047 (ChiefDelphi)
 
Join Date: May 2001
Location: Pontiac, MI
Posts: 21,214
archiver has a reputation beyond reputearchiver has a reputation beyond reputearchiver has a reputation beyond reputearchiver has a reputation beyond reputearchiver has a reputation beyond reputearchiver has a reputation beyond reputearchiver has a reputation beyond reputearchiver has a reputation beyond reputearchiver has a reputation beyond reputearchiver has a reputation beyond reputearchiver has a reputation beyond repute
Re: Programming question

Posted by Matt Leese at 1/14/2001 11:56 PM EST


Other on team #73, Tigerbolt, from Edison Technical HS and Alstom & Rochester Institute of Technology.


In Reply to: Programming question
Posted by Nick on 1/14/2001 10:52 PM EST:



I believe that PBasic should emit an error (it is strongly typed, no?). That's just my initial impression. You can get at the high-nibble and low-nibble of a byte if you so wish (high nibble being first four bits and low nibble being the last four bits). The same works for any datatype. I don't remember the exact syntax off hand but it should be in the manual and there's at least an example of it in the default code using bits.

Matt


__________________
This message was archived from an earlier forum system. Some information may have been left out. Start new discussion in the current forums, and refer back to these threads when necessary.
  #3   Spotlight this post!  
Unread 06-23-2002, 09:57 PM
archiver archiver is offline
Forum Archival System
#0047 (ChiefDelphi)
 
Join Date: May 2001
Location: Pontiac, MI
Posts: 21,214
archiver has a reputation beyond reputearchiver has a reputation beyond reputearchiver has a reputation beyond reputearchiver has a reputation beyond reputearchiver has a reputation beyond reputearchiver has a reputation beyond reputearchiver has a reputation beyond reputearchiver has a reputation beyond reputearchiver has a reputation beyond reputearchiver has a reputation beyond reputearchiver has a reputation beyond repute
Strongly typed?

Posted by Joe Johnson at 1/15/2001 7:00 AM EST


Engineer on team #47, Chief Delphi, from Pontiac Central High School and Delphi Automotive Systems.


In Reply to: Re: Programming question
Posted by Matt Leese on 1/14/2001 11:56 PM EST:



Matt, what PBASIC are YOU programming in? I am not a programmer by training so I may be all wet here, but I don't think that PBASIC meets the definition of a strongly typed language.

As to what will happen if you set a variable that is not as wide as the thing you are setting it equal to, the sad truth is that everything to the left of the bits PBASIC needs is ignored!

SO...
X VAR nib
X = 16 'FYI 16 is 0001000 in binary
' X will be set to 0 because the right 4 bits are 0000

Joe J.


__________________
This message was archived from an earlier forum system. Some information may have been left out. Start new discussion in the current forums, and refer back to these threads when necessary.
  #4   Spotlight this post!  
Unread 06-23-2002, 09:57 PM
archiver archiver is offline
Forum Archival System
#0047 (ChiefDelphi)
 
Join Date: May 2001
Location: Pontiac, MI
Posts: 21,214
archiver has a reputation beyond reputearchiver has a reputation beyond reputearchiver has a reputation beyond reputearchiver has a reputation beyond reputearchiver has a reputation beyond reputearchiver has a reputation beyond reputearchiver has a reputation beyond reputearchiver has a reputation beyond reputearchiver has a reputation beyond reputearchiver has a reputation beyond reputearchiver has a reputation beyond repute
Re: Strongly typed?

Posted by Matt Leese at 1/15/2001 7:18 AM EST


Other on team #73, Tigerbolt, from Edison Technical HS and Alstom & Rochester Institute of Technology.


In Reply to: Strongly typed?
Posted by Joe Johnson on 1/15/2001 7:00 AM EST:



I'll be honest. I haven't touched it since last year (yet). I honestly never did the whole "put a value into the wrong type of variable" so this was more or less my guess. Apparently I guessed wrong. And for PBasic to be strongly typed it'd just have to not allow this type of situation. Basically not allow it to compile. Part of the reason I said it was strongly typed is that BASICs in general tend to be (more so then say C).

Matt
__________________
This message was archived from an earlier forum system. Some information may have been left out. Start new discussion in the current forums, and refer back to these threads when necessary.
  #5   Spotlight this post!  
Unread 06-23-2002, 09:57 PM
archiver archiver is offline
Forum Archival System
#0047 (ChiefDelphi)
 
Join Date: May 2001
Location: Pontiac, MI
Posts: 21,214
archiver has a reputation beyond reputearchiver has a reputation beyond reputearchiver has a reputation beyond reputearchiver has a reputation beyond reputearchiver has a reputation beyond reputearchiver has a reputation beyond reputearchiver has a reputation beyond reputearchiver has a reputation beyond reputearchiver has a reputation beyond reputearchiver has a reputation beyond reputearchiver has a reputation beyond repute
PBASIC -- A language for consenting adults?

Posted by Joe Johnson at 1/15/2001 8:10 PM EST


Engineer on team #47, Chief Delphi, from Pontiac Central High School and Delphi Automotive Systems.


In Reply to: Re: Strongly typed?
Posted by Matt Leese on 1/15/2001 7:18 AM EST:



I have heard C described as a language for consening
adults because it assumes that the programmer knows
what he/she is doing and lets them set a structure
equal to a bit or a character or a logical.

PBASIC is similar in this regard in that it does not do
a whole lot of checking to give the user messages along
the lines of "do you really mean that?"

Programmers Beware!

Joe J.



__________________
This message was archived from an earlier forum system. Some information may have been left out. Start new discussion in the current forums, and refer back to these threads when necessary.
  #6   Spotlight this post!  
Unread 06-23-2002, 09:57 PM
archiver archiver is offline
Forum Archival System
#0047 (ChiefDelphi)
 
Join Date: May 2001
Location: Pontiac, MI
Posts: 21,214
archiver has a reputation beyond reputearchiver has a reputation beyond reputearchiver has a reputation beyond reputearchiver has a reputation beyond reputearchiver has a reputation beyond reputearchiver has a reputation beyond reputearchiver has a reputation beyond reputearchiver has a reputation beyond reputearchiver has a reputation beyond reputearchiver has a reputation beyond reputearchiver has a reputation beyond repute
Re: PBASIC -- A language for consenting adults?

Posted by Matt Leese at 1/15/2001 8:35 PM EST


Other on team #73, Tigerbolt, from Edison Technical HS and Alstom & Rochester Institute of Technology.


In Reply to: PBASIC -- A language for consenting adults?
Posted by Joe Johnson on 1/15/2001 8:10 PM EST:



PBasic isn't nearly as bad as C is though. But seriously, PBasic is a pretty easy language to learn. There's not enough complexity there to be difficult When you can do pointer-pointers in PBasic then I'll consider it hard. And BTW, if C is for consenting adults then I must've been breaking the law learning it at 13.....

Matt
__________________
This message was archived from an earlier forum system. Some information may have been left out. Start new discussion in the current forums, and refer back to these threads when necessary.
  #7   Spotlight this post!  
Unread 06-23-2002, 09:57 PM
archiver archiver is offline
Forum Archival System
#0047 (ChiefDelphi)
 
Join Date: May 2001
Location: Pontiac, MI
Posts: 21,214
archiver has a reputation beyond reputearchiver has a reputation beyond reputearchiver has a reputation beyond reputearchiver has a reputation beyond reputearchiver has a reputation beyond reputearchiver has a reputation beyond reputearchiver has a reputation beyond reputearchiver has a reputation beyond reputearchiver has a reputation beyond reputearchiver has a reputation beyond reputearchiver has a reputation beyond repute
Re: Programming question

Posted by Lloyd Burns at 1/15/2001 1:14 AM EST


Other on team #188, Woburn Robotics, from Woburn Collegiate and Canada 3000, ScotiaBank, Royal Bank Financial.


In Reply to: Programming question
Posted by Nick on 1/14/2001 10:52 PM EST:



If you wany the low nibble of byte "ANALOG1", why not define "LSNANA1" as the low nibble of ANALOG1? Then if ANALOG1 = 0xA5 = B'10100101', LSNANA1 = 0x5 = B'0101', and you have no processing to do; the compiler does it all !


__________________
This message was archived from an earlier forum system. Some information may have been left out. Start new discussion in the current forums, and refer back to these threads when necessary.
 


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Communications via the Programming Port Larry Barello Technical Discussion 9 06-10-2003 10:33 PM
my idea of a question forum... Ken Leung General Forum 12 11-30-2002 11:17 AM
MnM EASY Question of the Day Winners! Mike Bonham General Forum 22 05-03-2002 08:21 PM
Rookie Programmer has question about the default code DanL Programming 3 01-26-2002 06:59 PM
pbasic programming punarhero Programming 4 01-21-2002 10:32 PM


All times are GMT -5. The time now is 03:20 PM.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi