Go to Post Seemed like a solid plan in my head. - davidthefat [more]
Home
Go Back   Chief Delphi > Technical > Programming
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
 
 
Thread Tools Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #8   Spotlight this post!  
Unread 06-02-2007, 09:06
Metalgod4eva Metalgod4eva is offline
Registered User
None #0870
 
Join Date: Jan 2007
Location: Southold
Posts: 7
Metalgod4eva is an unknown quantity at this point
Re: Robot style EOF?

Quote:
Originally Posted by kitscuzz View Post
Kevin tends to use chars as another form of integers. Chars are, in fact, simply numbers, 8 bits in length that happen to be interpreted differently when sent to a terminal. There is not an "End Of File" command because you never send strings except to the camera, and then you really only send the characters and the line in terminated by a \r or \n, and wait for the camera to reply appropriately.

The processor interprets the data based on the information given to it by the code, aka if you pass a character, the processor waits for 8 bits of data, there is no need to indicate the "EOF" of a character because the processor knows that there is only 8 bits, no more, no less.

The "End Of File" command is actually an antiquated way of identifying the end of files in old DOS operating systems. The "EOF" command is no longer used except as a method of terminating input at a terminal (and even then, it's rare because the EOF command varies based on the operating system, not the hardware), and for saving files for VERY old systems. It is also occasionally used as indicating the end of a file when being sent over the internet (look into netcat 1.0).

The reason most systems don't use the EOF anymore is because they simply identify the size of the file at the start of the data, and then the computer doesn't need to read the whole file in order to allocate an appropriate amount of memory to display the file.
Actually EOF does not identify the size of the file or the start of data. EOF stands for End Of File/stream and job to signal like a semicolon in C statements, that the particular data stream is finished. EOF is represented as -1 or '\o'. As a native C programmer I have never heard anyone ever mention that EOF was no longer a macro in the standard lib anymore ^ have I seen it even not been. I understand that when working with robot on partial C code that does not conform to ANSI or hides most the code in many files that you just assume that if you don’t run across EOF does not mean its not there. EOF is a macro and is used for every line of stream. AKA after every \n a -1 is placed. Think of it as more of an End OF line. http://www.cprogramming.com/faq/cgi-...wer=1048865140
In response to kitscuzz:
Char are 1 byte and 3 byte padding:
"EOF" is not a character, its -1 an int:
Name an OS does not use EOF:
When passing a string to a cam: A string is an array, there is no string support in C. So all chars are saved in ordnance of the 0th element to MAX-1 element, The MAX element is '\0' || NULL in a char array and '-1’ in and int array. /*Lets for argument sake allow NULL == EOF even though there different in the char array the eof follows null*/ That is also the reason Even if you never declared the array all the function for strings must use them, thus all strings use EOF, all arrays use EOF. Brain W. Kernighan and Dennis M. Ritchie creators of c have an ANSI Book read pages 17, 28, chapter 7 151, 242+. Have a great day!
 


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 On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
2006 Robot Awards-CD Style JackN General Forum 18 21-05-2006 18:51
Style Changes Brandon Martus CD Forum Support 33 20-06-2005 11:17
Style suggestions evulish CD Forum Support 14 15-12-2003 23:01
New Style Brandon Martus Announcements 2 08-12-2003 01:48
style srawls Programming 19 23-05-2002 17:02


All times are GMT -5. The time now is 04:46.

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


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