comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » simple question about bytes
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
simple question about bytes [message #16986] Thu, 02 September 1999 00:00 Go to previous message
Gerhard D. Rappold is currently offline  Gerhard D. Rappold
Messages: 10
Registered: March 1998
Junior Member
Hi,

I want to check if a line in an ascii file starts with a number or
character. My idea was to read the first character and convert it to
"byte" and check if its in or out the range of '48b' and '58b'. The code
example is :

; check for header
header=''
readf, lun, header
firstchar=strmid(header,0,1)
first_byte=byte(firstchar)

no_head=0
head_index=0
WHILE ((first_byte LT 48b) AND (first_byte GT 57b)) DO BEGIN
readf, lun, header ; reads next line
head_index=head_index+1 ; counts header lines
no_header =head_index
ENDWHILE
...

it compiles fine but on runtime I get the errormessage :

Expression must be a scalar in this context: <BYTE Array(1)>

How can I change the variable 'first_byte' from byte array to a byte
scalar ?

Or any other hint for a solution would be great!

Thank's

Gerhard
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: directing control after program interruption
Next Topic: runtime IDL, blocking widgets

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Sat Oct 11 03:40:09 PDT 2025

Total time taken to generate the page: 0.87414 seconds